diff --git a/plugin/AdsForJesus/AdsForJesus.php b/plugin/AdsForJesus/AdsForJesus.php index 04fb78a702..adf74ce94a 100644 --- a/plugin/AdsForJesus/AdsForJesus.php +++ b/plugin/AdsForJesus/AdsForJesus.php @@ -67,11 +67,13 @@ class AdsForJesus extends PluginAbstract { if (!empty($videos_id)) { $showAds = AVideoPlugin::showAds($videos_id); if (!$showAds) { - return ""; + return ""; } global $global; $css .= ''; $css .= ''; + }else{ + $css .= ""; } return $js . $css; } @@ -88,10 +90,10 @@ class AdsForJesus extends PluginAbstract { if (!empty($videos_id)) { $showAds = AVideoPlugin::showAds($videos_id); if (!$showAds) { - return ""; + return ""; } if (empty($_GET['u'])) { - $video = Video::getVideoFromCleanTitle($_GET['videoName']); + $video = Video::getVideoLight($videos_id); $showAds = AVideoPlugin::showAds($video['id']); if (!$showAds) { return ""; @@ -104,7 +106,9 @@ class AdsForJesus extends PluginAbstract { $video_length = parseDurationToSeconds($video['duration']); $obj = $this->getDataObject(); PlayerSkins::setIMAADTag("https://forjesus.tv/vmap.xml?video_durarion={$video_length}&start={$obj->start}&mid25Percent={$obj->mid25Percent}&mid50Percent={$obj->mid50Percent}&mid75Percent={$obj->mid75Percent}&end={$obj->end}"); - } + }else{ + $js .= ""; + } return $js; } diff --git a/plugin/PlayLists/embed.php b/plugin/PlayLists/embed.php index 2478649732..273dc6525d 100644 --- a/plugin/PlayLists/embed.php +++ b/plugin/PlayLists/embed.php @@ -84,9 +84,9 @@ if (empty($playListData)) { $url = PlayLists::getLink($pl->getId()); $title = $pl->getName(); -if($serie = PlayLists::isPlayListASerie($pl->getId())){ +if ($serie = PlayLists::isPlayListASerie($pl->getId())) { setVideos_id($serie['id']); -}else if(!empty($playList[$playlist_index])){ +} else if (!empty($playList[$playlist_index])) { setVideos_id($playList[$playlist_index]['id']); } //var_dump($playListData);exit; @@ -246,36 +246,45 @@ if($serie = PlayLists::isPlayListASerie($pl->getId())){ diff --git a/plugin/PlayLists/player_old.php b/plugin/PlayLists/player_old.php new file mode 100644 index 0000000000..317c31e667 --- /dev/null +++ b/plugin/PlayLists/player_old.php @@ -0,0 +1,360 @@ +src = $images->thumbsJpg; + $thumbnail = array($src); + + $playListSources = array(); + foreach ($sources as $value2) { + if ($value2['type'] !== 'video' && $value2['type'] !== 'audio' && $value2['type'] !== 'serie') { + continue; + } + $playListSources[] = new playListSource($value2['url'], $value['type'] === 'embed'); + } + if (empty($playListSources)) { + continue; + } + $playListData[] = new PlayListElement($value['title'], $value['description'], $value['duration'], $playListSources, $thumbnail, $images->poster, parseDurationToSeconds(@$externalOptions->videoStartSeconds), $value['cre'], $value['likes'], $value['views_count'], $value['videos_id']); +} + +$video = PlayLists::isPlayListASerie($_GET['playlists_id']); +if (!empty($video['id'])) { + AVideoPlugin::getEmbed($video['id']); +} +?> + + + + <?php echo $playListObj->getName() . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> + + + + + + + + + + + + + + showChannelBannerOnModeYoutube)) { + ?> +
+ +
+ +
+ showAdsenseBannerOnTop)) { + ?> + +
+
+
+ +
+
+
+ + +
+
+
+
+ +
+ + + +
+ +
+ Logo +
+ + + +
+
+
+
+ +
+
+
+
+
+
+ +
+ "/> + +
+ +
+
+
+
+ +
+
+
+
+
+ ! videoNotFoundText->value) ? __("We have not found any videos or audios to show") : $advancedCustom->videoNotFoundText->value; ?>. +
+ +
+ + + + + + + + + diff --git a/view/include/navbar.php b/view/include/navbar.php index fbe4890d18..d343071324 100644 --- a/view/include/navbar.php +++ b/view/include/navbar.php @@ -286,11 +286,20 @@ if (!User::isLogged() && !empty($advancedCustomUser->userMustBeLoggedIn) && !emp $("#sidebar").fadeOut(); youTubeMenuIsOpened = false; } - $(document).ready(function () { - if (inIframe()) { - $("#mainNavBar").hide(); - $("body").css("padding-top", "0"); + + function YPTHidenavbar(){ + if(typeof inIframe == 'undefined'){ + setTimeout(function(){YPTHidenavbar()},500); + }else{ + if (inIframe()) { + $("#mainNavBar").hide(); + $("body").css("padding-top", "0"); + } } + } + + $(document).ready(function () { + YPTHidenavbar(); $('#buttonMenu').on("click.sidebar", function (event) { event.stopPropagation(); //$('#sidebar').fadeToggle(); diff --git a/view/include/playlist.php b/view/include/playlist.php index 17011b25a6..048ea4badc 100644 --- a/view/include/playlist.php +++ b/view/include/playlist.php @@ -57,6 +57,7 @@ if (!empty($videoSerie)) { <?php echo $value['title']; ?> - - " /> - " /> - - diff --git a/view/js/script.js b/view/js/script.js index 0f235fc637..a50da85ce9 100644 --- a/view/js/script.js +++ b/view/js/script.js @@ -152,19 +152,21 @@ function lazyImage() { lazyImage(); var pleaseWaitIsINUse = false; - +var pauseIfIsPlayinAdsInterval; function setPlayerListners() { if (typeof player !== 'undefined') { player.on('pause', function () { clearTimeout(promisePlayTimeout); console.log("setPlayerListners: pause"); //userIsControling = true; + clearInterval(pauseIfIsPlayinAdsInterval); }); player.on('play', function () { clearTimeout(promisePlayTimeout); console.log("setPlayerListners: play"); //userIsControling = true; + pauseIfIsPlayinAdsInterval = setInterval(function(){pauseIfIsPlayinAds();},500); }); $("#mainVideo .vjs-mute-control").click(function () { @@ -178,7 +180,6 @@ function setPlayerListners() { setPlayerListners(); }, 2000); } - pauseIfIsPlayinAds(); } function removeTracks() { @@ -858,6 +859,9 @@ function isPlayNextEnabled() { } function avideoAlert(title, msg, type) { + if(typeof msg == 'undefined'){ + return false; + } if (msg !== msg.replace(/<\/?[^>]+(>|$)/g, "")) {//it has HTML avideoAlertHTMLText(title, msg, type); } else { @@ -977,12 +981,8 @@ function playerHasAds() { } function pauseIfIsPlayinAds(){ - if(playerHasAds()){ - setTimeout(function(){ - if(playerIsPlayingAds()){ - player.pause(); - } - }, 1000); + if(!player.paused() && playerHasAds() && playerIsPlayingAds()){ + player.pause(); } } diff --git a/view/modeYoutube.php b/view/modeYoutube.php index 9958ae48e1..6baf60f1f3 100644 --- a/view/modeYoutube.php +++ b/view/modeYoutube.php @@ -73,7 +73,7 @@ if (!empty($evideo)) { } $videosArrayId = PlayList::getVideosIdFromPlaylist($playlist_id); - if(empty($videosArrayId)){ + if (empty($videosArrayId)) { videoNotFound(__('Playlist is empty or does not exist')); } $videosPlayList = Video::getAllVideos("viewable", false, false, $videosArrayId, false, true); @@ -83,9 +83,9 @@ if (!empty($evideo)) { unset($_GET['playlist_id']); $isPlayListTrailer = false; - + $playListObject = AVideoPlugin::getObjectData("PlayLists"); - + if (!empty($videoSerie)) { $videoSerie = Video::getVideo($videoSerie["id"], "", true); if (!empty($playListObject->showTrailerInThePlayList) && !empty($videoSerie["trailer1"]) && filter_var($videoSerie["trailer1"], FILTER_VALIDATE_URL) !== FALSE) { @@ -111,6 +111,12 @@ if (!empty($evideo)) { $autoPlayVideo = Video::getVideo($videosPlayList[0]['id'], "viewableNotUnlisted", false, false, false, true); $autoPlayVideo['url'] = $global['webSiteRootURL'] . "playlist/{$playlist_id}/0"; } + + if ($serie = PlayLists::isPlayListASerie($playlist_id)) { + setVideos_id($serie['id']); + } else if (!empty($videosPlayList[$playlist_index])) { + setVideos_id($videosPlayList[$playlist_index]['id']); + } } else { $catLink = ""; if (!empty($_GET['catName'])) { @@ -138,7 +144,7 @@ if (!empty($evideo)) { if (!empty($_GET['v']) && (empty($video) || $video['id'] != $_GET['v'])) { $video = false; } - if(!empty($video['id'])){ + if (!empty($video['id'])) { // allow users to count a view again in case it is refreshed Video::unsetAddView($video['id']); @@ -197,7 +203,7 @@ if (!empty($evideo)) { */ $modeYouTubeTimeLog['Code part 1.5'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); - if(!empty($video['id'])){ + if (!empty($video['id'])) { $autoPlayVideo = Video::getRandom($video['id']); } //} @@ -282,11 +288,12 @@ if (!empty($evideo)) { if (empty($_GET['videoName']) && !empty($video)) { $_GET['videoName'] = $video['clean_title']; } - - $v = Video::getVideoFromCleanTitle($_GET['videoName']); - if(empty($v)){ + if(!empty($_GET['videoName'])){ + $v = Video::getVideoFromCleanTitle($_GET['videoName']); + } + if (empty($v)) { videoNotFound(""); - }else{ + } else { $modeYouTubeTimeLog['Code part 4'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); AVideoPlugin::getModeYouTube($v['id']); @@ -347,11 +354,11 @@ if (!empty($video['users_id']) && User::hasBlockedUser($video['users_id'])) { @@ -468,9 +475,9 @@ if (!empty($video['users_id']) && User::hasBlockedUser($video['users_id'])) { - + diff --git a/view/modeYoutubeBottom.php b/view/modeYoutubeBottom.php index cdc218b5e5..cfb63927c7 100644 --- a/view/modeYoutubeBottom.php +++ b/view/modeYoutubeBottom.php @@ -1,5 +1,7 @@