diff --git a/view/modeYoutubeBottom.php b/view/modeYoutubeBottom.php index 298941f9c5..f9dd8387b3 100644 --- a/view/modeYoutubeBottom.php +++ b/view/modeYoutubeBottom.php @@ -1,356 +1,362 @@ -' . humanTiming(strtotime($video['videoCreation'])) . ''); - $source = Video::getSourceFile($video['filename']); - if (($video['type'] !== "audio") && ($video['type'] !== "linkAudio") && !empty($source['url'])) { - $img = $source['url']; - $data = getimgsize($source['path']); - $imgw = $data[0]; - $imgh = $data[1]; - } elseif ($video['type'] == "audio") { - $img = "" . getCDN() . "view/img/audio_wave.jpg"; - } - $type = 'video'; - if ($video['type'] === 'pdf') { - $type = 'pdf'; - } elseif ($video['type'] === 'zip') { - $type = 'zip'; - } elseif ($video['type'] === 'article') { - $type = 'article'; - } - $images = Video::getImageFromFilename($video['filename'], $type); - $poster = $images->poster; - if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') { - $img = $images->posterPortrait; - $data = getimgsize($source['path']); - $imgw = $data[0]; - $imgh = $data[1]; - } -} -if (empty($video['created'])) { - return false; -} -if (User::hasBlockedUser($video['users_id'])) { - return false; -} -?> - - -
-
-
- <?php echo str_replace('" class="img img-responsive rotate" height="130" itemprop="thumbnail" /> - - - - - - - - - " /> - -
-
-

- -
- "> - - - -
- - - label === __("Group")) { - ?> - text; ?> - - -

-
- -
- - doNotDisplayViews)) { - ?> - - - -
-
- -
-
- disableShareAndPlaylist)) { ?> - - - - - - $theLink) { - //$notAllowedKeys = array('m3u8'); - $notAllowedKeys = []; - if (empty($advancedCustom->showImageDownloadOption)) { - $notAllowedKeys = array_merge($notAllowedKeys, ['jpg', 'gif', 'webp', 'pjpg']); - } - $keyFound = false; - foreach ($notAllowedKeys as $notAllowedKey) { - if (preg_match("/{$notAllowedKey}/", $key)) { - $keyFound = true; - break; - } - } - if ($keyFound) { - continue; - } - - if (!preg_match('/cdn\.ypt\.me(.*)\.m3u8/i', $theLink['url'])) { - $theLink['url'] = addQueryStringParameter($theLink['url'], "download", 1); - $theLink['url'] = addQueryStringParameter($theLink['url'], "title", $video['title'] . "_{$key}_." . ($video['type'] === 'audio' ? 'mp3' : 'mp4')); - - $parts = explode("_", $key); - $name = $key; - if (count($parts) > 1) { - $name = strtoupper($parts[0]); - if (is_numeric($parts[1])) { - $name .= "
{$parts[1]}p
" . getResolutionLabel($parts[1]); - } else { - $name .= "
" . strtoupper($parts[1]) . "
"; - } - } - - $filesToDownload[] = ['name' => $name, 'url' => $theLink['url']]; - } - } - - $videoHLSObj = AVideoPlugin::getDataObjectIfEnabled('VideoHLS'); - if (!empty($videoHLSObj)) { - if (!empty($videoHLSObj->saveMP4CopyOnCDNStorageToAllowDownload)) { - $filesToDownload[] = VideoHLS::getCDNDownloadLink($video['id'], 'mp4'); - } - if (!empty($videoHLSObj->saveMP3CopyOnCDNStorageToAllowDownload)) { - $filesToDownload[] = VideoHLS::getCDNDownloadLink($video['id'], 'mp3'); - } - } - - - if (!empty($filesToDownload)) { - ?> - - - - - '; - } - } else { - echo ''; - } - ?> - - removeThumbsUpAndDown)) { - ?> - " id="dislikeBtn" data-toggle="tooltip" title="" > - - - " id="likeBtn" data-toggle="tooltip" title="" > - - - - - - -
-
- -
- - - - - -
-
-
-
:
- - -
:
-
- -
- -
:
-
-
-
- -
-
- -
- -
-
- -
- -disableComments) && Video::showYoutubeModeOptions()) { - ?> -
- -
- +' . humanTiming(strtotime($video['videoCreation'])) . ''); + $source = Video::getSourceFile($video['filename']); + if (($video['type'] !== "audio") && ($video['type'] !== "linkAudio") && !empty($source['url'])) { + $img = $source['url']; + $data = getimgsize($source['path']); + $imgw = $data[0]; + $imgh = $data[1]; + } elseif ($video['type'] == "audio") { + $img = "" . getCDN() . "view/img/audio_wave.jpg"; + } + $type = 'video'; + if ($video['type'] === 'pdf') { + $type = 'pdf'; + } elseif ($video['type'] === 'zip') { + $type = 'zip'; + } elseif ($video['type'] === 'article') { + $type = 'article'; + } + $images = Video::getImageFromFilename($video['filename'], $type); + $poster = $images->poster; + if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') { + $img = $images->posterPortrait; + $data = getimgsize($source['path']); + $imgw = $data[0]; + $imgh = $data[1]; + } +} +if (empty($video['created'])) { + return false; +} +if (User::hasBlockedUser($video['users_id'])) { + return false; +} +?> + + +
+
+
+ <?php echo str_replace('" class="img img-responsive rotate" height="130" itemprop="thumbnail" /> + + + + + + + + - " /> + +
+
+

+ +
+ "> + + + +
+ + + label === __("Group")) { + ?> + text; ?> + + +

+
+ +
+ + doNotDisplayViews)) { + ?> + + + +
+
+ +
+
+ disableShareAndPlaylist)) { ?> + + + + + + $theLink) { + //$notAllowedKeys = array('m3u8'); + $notAllowedKeys = []; + if (empty($advancedCustom->showImageDownloadOption)) { + $notAllowedKeys = array_merge($notAllowedKeys, ['jpg', 'gif', 'webp', 'pjpg']); + } + $keyFound = false; + foreach ($notAllowedKeys as $notAllowedKey) { + if (preg_match("/{$notAllowedKey}/", $key)) { + $keyFound = true; + break; + } + } + if ($keyFound) { + continue; + } + + if (!preg_match('/cdn\.ypt\.me(.*)\.m3u8/i', $theLink['url'])) { + $theLink['url'] = addQueryStringParameter($theLink['url'], "download", 1); + $theLink['url'] = addQueryStringParameter($theLink['url'], "title", $video['title'] . "_{$key}_." . ($video['type'] === 'audio' ? 'mp3' : 'mp4')); + + $parts = explode("_", $key); + $name = $key; + if (count($parts) > 1) { + $name = strtoupper($parts[0]); + if (is_numeric($parts[1])) { + $name .= "
{$parts[1]}p
" . getResolutionLabel($parts[1]); + } else { + $name .= "
" . strtoupper($parts[1]) . "
"; + } + } + + $filesToDownload[] = ['name' => $name, 'url' => $theLink['url']]; + } + } + + $videoHLSObj = AVideoPlugin::getDataObjectIfEnabled('VideoHLS'); + if (!empty($videoHLSObj)) { + $cdnObj = AVideoPlugin::getDataObjectIfEnabled('CDN'); + if(!empty($cdnObj) && $cdnObj->enable_storage){ + if (!empty($videoHLSObj->saveMP4CopyOnCDNStorageToAllowDownload)) { + $filesToDownload[] = VideoHLS::getCDNDownloadLink($video['id'], 'mp4'); + } + if (!empty($videoHLSObj->saveMP3CopyOnCDNStorageToAllowDownload)) { + $filesToDownload[] = VideoHLS::getCDNDownloadLink($video['id'], 'mp3'); + } + } + } + + + if (!empty($filesToDownload)) { + ?> + + + + + '; + } + } else { + echo ''; + } + ?> + + removeThumbsUpAndDown)) { + ?> + " id="dislikeBtn" data-toggle="tooltip" title="" > + + + " id="likeBtn" data-toggle="tooltip" title="" > + + + + + + +
+
+ +
+ + + + + +
+
+
+
:
+ + +
:
+
+ +
+ +
:
+
+
+
+ +
+
+ +
+ +
+
+ +
+ +disableComments) && Video::showYoutubeModeOptions()) { + ?> +
+ +
+