diff --git a/plugin/Gallery/functions.php b/plugin/Gallery/functions.php index 7bcc1ba69..f9aaf7654 100644 --- a/plugin/Gallery/functions.php +++ b/plugin/Gallery/functions.php @@ -1,676 +1,677 @@

" . $info[1] . ""; } else { echo "{$title}"; } ?>

'; return 0; } $page = $totalPages; $_REQUEST['current'] = $totalPages; } $videos = Video::getAllVideos("viewableNotUnlisted", false, $ignoreGroup); // need to add dechex because some times it return an negative value and make it fails on javascript playlists ?>
" . __("Up") . ""; $mostLess = $mostWord; } else { if (strpos($orderString, $getName . "=ASC")) { $tmpOrderString = substr($orderString, 0, strpos($orderString, $getName . "=ASC")) . $getName . "=DESC" . substr($orderString, strpos($orderString, $getName . "=ASC") + strlen($getName . "=ASC"), strlen($orderString)); } else { $tmpOrderString .= $getName . "=DESC"; } $upDown = "" . __("Down") . ""; $mostLess = $lessWord; } if (substr($tmpOrderString, strlen($tmpOrderString) - 1, strlen($tmpOrderString)) == "&") { $tmpOrderString = substr($tmpOrderString, 0, strlen($tmpOrderString) - 1); } return array($tmpOrderString, $upDown, $mostLess); } function createGallerySection($videos, $crc = "", $get = array(), $ignoreAds = false, $screenColsLarge = 0, $screenColsMedium = 0, $screenColsSmall = 0, $screenColsXSmall = 0) { global $global, $config, $obj, $advancedCustom, $advancedCustomUser; $countCols = 0; $obj = AVideoPlugin::getObjectData("Gallery"); $zindex = 1000; $startG = microtime(true); $program = AVideoPlugin::loadPluginIfEnabled('PlayLists'); foreach ($videos as $value) { // that meas auto generate the channelName if (empty($get) && !empty($obj->filterUserChannel)) { $getCN = array('channelName' => $value['channelName'], 'catName' => @$_GET['catName']); } else { $getCN = $get; } $img_portrait = (@$value['rotation'] === "90" || @$value['rotation'] === "270") ? "img-portrait" : ""; - $name = User::getNameIdentificationById($value['users_id']); - $name .= " " . User::getEmailVerifiedIcon($value['users_id']); + $nameId = User::getNameIdentificationById($value['users_id']); + $name = $nameId." " . User::getEmailVerifiedIcon($value['users_id']); // make a row each 6 cols if ($countCols % $obj->screenColsLarge === 0) { echo '
'; } $countCols++; if (!empty($screenColsLarge)) { $obj->screenColsLarge = $screenColsLarge; } if (!empty($screenColsMedium)) { $obj->screenColsMedium = $screenColsMedium; } if (!empty($screenColsSmall)) { $obj->screenColsSmall = $screenColsSmall; } if (!empty($screenColsXSmall)) { $obj->screenColsXSmall = $screenColsXSmall; } $colsClass = "col-lg-" . (12 / $obj->screenColsLarge) . " col-md-" . (12 / $obj->screenColsMedium) . " col-sm-" . (12 / $obj->screenColsSmall) . " col-xs-" . (12 / $obj->screenColsXSmall); $isserie = Video::isSerie($value['id']); $isserieClass = ""; if ($isserie) { $isserieClass = "isserie"; } ?>
thumbsGif = ""; $images->poster = "" . getCDN() . "view/img/notfound.jpg"; $images->thumbsJpg = "" . getCDN() . "view/img/notfoundThumbs.jpg"; $images->thumbsJpgSmall = "" . getCDN() . "view/img/notfoundThumbsSmall.jpg"; } if ($value['type'] === 'serie' && !empty($value['serie_playlists_id']) && stripos($images->thumbsJpg, 'notfound') !== false) { $images = PlayList::getRandomImageFromPlayList($value['serie_playlists_id']); } $startG = microtime(true); $imgGif = $images->thumbsGif; $poster = $images->thumbsJpg; ?>
<?php echo $value['title']; ?>" id="thumbsJPG" />


showCategoryTag)) { $iconClass = 'fas fa-folder'; if (!empty($value['iconClass'])) { $iconClass = $value['iconClass']; } $icon = ''; ?> showTags)) { echo implode('', Video::getTagsHTMLLabelArray($value['id'])); } @$timesG[__LINE__] += microtime(true) - $startG; $startG = microtime(true); ?>
doNotDisplayViews)) { if (AVideoPlugin::isEnabledByName('LiveUsers')) { echo getLiveUsersLabelVideo($value['id'], $value['views_count'], "", ""); } else { ?>
-
+
- +
- +
Description)) { //$desc = str_replace(array('"', "'", "#", "/", "\\"), array('``', "`", "", "", ""), preg_replace("/\r|\n/", " ", nl2br(trim($value['description'])))); $desc = nl2br(trim($value['description'])); if (!empty($desc)) { $duid = uniqid(); $titleAlert = str_replace(array('"', "'"), array('``', "`"), $value['title']); ?>
- "> + ">
"> - +
1) { if ($countCols % $obj->screenColsLarge === 0) { echo ""; } if ($countCols % $obj->screenColsMedium === 0) { echo ""; } if ($countCols % $obj->screenColsSmall === 0) { echo ""; } if ($countCols % $obj->screenColsXSmall === 0) { echo ""; } } } ?>
screenColsLarge === 0) { echo '
'; } $countCols++; if (!empty($screenColsLarge)) { $obj->screenColsLarge = $screenColsLarge; } if (!empty($screenColsMedium)) { $obj->screenColsMedium = $screenColsMedium; } if (!empty($screenColsSmall)) { $obj->screenColsSmall = $screenColsSmall; } if (!empty($screenColsXSmall)) { $obj->screenColsXSmall = $screenColsXSmall; } $colsClass = "col-lg-" . (12 / $obj->screenColsLarge) . " col-md-" . (12 / $obj->screenColsMedium) . " col-sm-" . (12 / $obj->screenColsSmall) . " col-xs-" . (12 / $obj->screenColsXSmall); if (!empty($video['className'])) { $colsClass .= " {$video['className']}"; } $liveNow = '' . __("LIVE NOW") . ''; ?>
<?php echo $video['title'] ?>
showCategoryTag)) { ?>
Description)) { $desc = str_replace(array('"', "'", "#", "/", "\\"), array('``', "`", "", "", ""), preg_replace("/\r|\n/", " ", nl2br(trim($video['description'])))); if (!empty($desc)) { $titleAlert = str_replace(array('"', "'"), array('``', "`"), $video['title']); ?>
- "> + ">
1) { if ($countCols % $obj->screenColsLarge === 0) { echo ""; } if ($countCols % $obj->screenColsMedium === 0) { echo ""; } if ($countCols % $obj->screenColsSmall === 0) { echo ""; } if ($countCols % $obj->screenColsXSmall === 0) { echo ""; } } } ?>
'; } unset($_POST['disableAddTo']); return $countCols; } function createChannelItem($users_id, $photoURL = "", $identification = "", $rowCount = 12) { $total = Video::getTotalVideos("viewable", $users_id); if (empty($total)) { return false; } if (empty($photoURL)) { $photoURL = User::getPhoto($users_id); } if (empty($identification)) { $identification = User::getNameIdentificationById($users_id); } ?>

Channel Owner

"; return $countCols; } function canPrintCategoryTitle($title) { global $doNotRepeatCategoryTitle; if (!isset($doNotRepeatCategoryTitle)) { $doNotRepeatCategoryTitle = array(); } if (in_array($title, $doNotRepeatCategoryTitle)) { return false; } $doNotRepeatCategoryTitle[] = $title; return true; } ?> diff --git a/plugin/Live/index.php b/plugin/Live/index.php index 950c2f452..4940b4e69 100644 --- a/plugin/Live/index.php +++ b/plugin/Live/index.php @@ -1,347 +1,346 @@ getDataObject(); if (!empty($_GET['c'])) { $user = User::getChannelOwner($_GET['c']); if (!empty($user)) { $_GET['u'] = $user['user']; } } if (!empty($_GET['c'])) { $user = User::getChannelOwner($_GET['c']); if ($user['status'] !== 'a') { header("Location: {$global['webSiteRootURL']}"); } } if (!empty($_GET['u']) && !empty($_GET['embedv2'])) { include $global['systemRootPath'] . 'plugin/Live/view/videoEmbededV2.php'; exit; } else if (!empty($_GET['u']) && !empty($_GET['embed'])) { include $global['systemRootPath'] . 'plugin/Live/view/videoEmbeded.php'; exit; } else if (!empty($_GET['u'])) { include $global['systemRootPath'] . 'plugin/Live/view/modeYoutubeLive.php'; exit; } else if (!User::isLogged()) { gotToLoginAndComeBackHere(""); exit; } else if (!User::canStream()) { forbiddenPage(__($obj->streamDeniedMsg)); } require_once $global['systemRootPath'] . 'objects/userGroups.php'; require_once $global['systemRootPath'] . 'objects/functions.php'; require_once $global['systemRootPath'] . 'plugin/Live/Objects/LiveTransmition.php'; $users_id = User::getId(); if (!empty($_GET['users_id']) && User::isAdmin()) { $users_id = intval($_GET['users_id']); } // if user already have a key $trasnmition = LiveTransmition::createTransmitionIfNeed($users_id); $getLiveKey = array('key' => $trasnmition['key'], 'live_servers_id' => Live::getLiveServersIdRequest()); setLiveKey($trasnmition['key'], Live::getLiveServersIdRequest(), @$_REQUEST['live_index']); if (!empty($_GET['resetKey'])) { LiveTransmition::resetTransmitionKey($users_id); header("Location: {$global['webSiteRootURL']}plugin/Live/"); exit; } $trans = new LiveTransmition($trasnmition['id']); $groups = $trans->getGroups(); //check if channel name exists $channelName = User::getUserChannelName(); if (empty($channelName)) { $channelName = uniqid(); $user = new User($users_id); $user->setChannelName($channelName); $user->save(); } //$global['ignoreChat2'] = 1; $col1Class = "col-md-12 col-lg-12"; $col2Class = "hidden"; $chat2 = AVideoPlugin::getObjectDataIfEnabled("Chat2"); if (!empty($chat2) && !empty($chat2->useStaticLayout)) { $col1Class = "col-md-8 col-lg-8"; $col2Class = "col-md-4 col-lg-4"; } ?> <?php echo __("Live") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> -
getChat($trasnmition['key']); ?> diff --git a/plugin/Live/view/modeYoutubeLive.php b/plugin/Live/view/modeYoutubeLive.php index 73eea839c..e499306ae 100644 --- a/plugin/Live/view/modeYoutubeLive.php +++ b/plugin/Live/view/modeYoutubeLive.php @@ -1,231 +1,230 @@ userCanSeeTransmition()) { forbiddenPage("You are not allowed see this streaming"); } $uuid = LiveTransmition::keyNameFix($livet['key']); $u = new User(0, $_GET['u'], false); $user_id = $u->getBdId(); $video['users_id'] = $user_id; $subscribe = Subscribe::getButton($user_id); $name = $u->getNameIdentificationBd(); $name = "{$name} " . User::getEmailVerifiedIcon($user_id) . ""; $liveTitle = $livet['title']; $liveDescription = $livet['description']; $liveImg = User::getPhoto($user_id); if (!empty($_REQUEST['playlists_id_live'])) { $liveTitle = PlayLists::getNameOrSerieTitle($_REQUEST['playlists_id_live']); $liveDescription = PlayLists::getDescriptionIfIsSerie($_REQUEST['playlists_id_live']); $liveImg = PlayLists::getImage($_REQUEST['playlists_id_live']); } $video['creator'] = '
User Photo
' . $name . '
' . $subscribe . '
'; $img = "{$global['webSiteRootURL']}plugin/Live/getImage.php?u={$_GET['u']}&format=jpg"; $imgw = 640; $imgh = 360; $liveDO = AVideoPlugin::getObjectData("Live"); $video['type'] = 'video'; AVideoPlugin::getModeYouTubeLive($user_id); $isCompressed = AVideoPlugin::loadPluginIfEnabled('TheaterButton') && TheaterButton::isCompressed(); $sideAd = getAdsSideRectangle(); $modeYoutubeBottomClass1 = "col-sm-7 col-md-7 col-lg-6"; $modeYoutubeBottomClass2 = "col-sm-5 col-md-5 col-lg-4 "; if (empty($sideAd) && !AVideoPlugin::loadPluginIfEnabled("Chat2")) { $modeYoutubeBottomClass1 = "col-sm-12 col-md-12 col-lg-10"; $modeYoutubeBottomClass2 = "hidden "; } ?> <?php echo $liveTitle . $config->getPageTitleSeparator() . __("Live") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - getWebSiteTitle(); ?>" /> " />

isAPrivateLive()) { ?>

disableShareAndPlaylist) && empty($advancedCustom->disableShareOnly)) { ?>
disableShareAndPlaylist) && empty($advancedCustom->disableShareOnly)) { getShareMenu($liveTitle, $link, $link, addQueryStringParameter($link, 'embed', 1), $img,"row bgWhite list-group-item menusDiv"); } ?>
diff --git a/plugin/Live/view/videoEmbeded.php b/plugin/Live/view/videoEmbeded.php index 8c5c43714..ee43ba37d 100644 --- a/plugin/Live/view/videoEmbeded.php +++ b/plugin/Live/view/videoEmbeded.php @@ -1,115 +1,114 @@ verifyEmbedSecurity(); } $u = new User(0, $_GET['u'], false); $user_id = $u->getBdId(); $video['users_id'] = $user_id; AVideoPlugin::getModeYouTubeLive($user_id); $_REQUEST['live_servers_id'] = Live::getLiveServersIdRequest(); $poster = Live::getPosterImage($livet['users_id'], $_REQUEST['live_servers_id']); ?> <?php echo $config->getWebSiteTitle(); ?> -
diff --git a/plugin/Live/view/videoEmbededV2.php b/plugin/Live/view/videoEmbededV2.php index 3379d615a..d02e823eb 100644 --- a/plugin/Live/view/videoEmbededV2.php +++ b/plugin/Live/view/videoEmbededV2.php @@ -1,147 +1,146 @@ verifyEmbedSecurity(); } $u = new User(0, $_GET['u'], false); $user_id = $u->getBdId(); $video['users_id'] = $user_id; AVideoPlugin::getModeYouTubeLive($user_id); $_REQUEST['live_servers_id'] = Live::getLiveServersIdRequest(); $poster = Live::getPosterImage($livet['users_id'], $_REQUEST['live_servers_id']); ?> <?php echo $config->getWebSiteTitle(); ?> -
getChat($uuid); ?>
diff --git a/plugin/Live/webcamFullscreen.php b/plugin/Live/webcamFullscreen.php index 07e9417a1..8fe275ade 100644 --- a/plugin/Live/webcamFullscreen.php +++ b/plugin/Live/webcamFullscreen.php @@ -1,205 +1,204 @@ webRTC_player; $iframeURL = addQueryStringParameter($iframeURL, 'webSiteRootURL', $global['webSiteRootURL']); $iframeURL = addQueryStringParameter($iframeURL, 'userHash', Live::getUserHash(User::getId())); $chatURL = ''; $chat = AVideoPlugin::loadPluginIfEnabled('Chat2'); if (!empty($chat)) { $chatURL = Chat2::getChatRoomLink(User::getId(), 1, 1, 1, true, 1); if (!empty($_REQUEST['user'])) { $chatURL = addQueryStringParameter($chatURL, 'user', $_REQUEST['user']); } if (!empty($_REQUEST['pass'])) { $chatURL = addQueryStringParameter($chatURL, 'pass', $_REQUEST['pass']); } } $users_id = User::getId(); $trasnmition = LiveTransmition::createTransmitionIfNeed($users_id); $live_servers_id = Live::getCurrentLiveServersId(); $forceIndex = "Live" . date('YmdHis'); $liveStreamObject = new LiveStreamObject($trasnmition['key'], $live_servers_id, $forceIndex, 0); $streamName = $liveStreamObject->getKeyWithIndex($forceIndex, true); $controls = Live::getAllControlls($streamName); ?> <?php echo $config->getWebSiteTitle(); ?> -
diff --git a/plugin/LiveLinks/view/Live.php b/plugin/LiveLinks/view/Live.php index 8b99b64a2..a6976599c 100644 --- a/plugin/LiveLinks/view/Live.php +++ b/plugin/LiveLinks/view/Live.php @@ -1,218 +1,217 @@ getId(); if ($liveLink->getType() == 'logged_only' && !User::isLogged()) { die('Link for logged only'); } $uuid = $_GET['link']; $t['id'] = $uuid; $t['users_id'] = $liveLink->getUsers_id(); $t['title'] = $liveLink->getTitle(); $t['link'] = $liveLink->getLink(); $t['description'] = $liveLink->getDescription(); AVideoPlugin::getModeLiveLink($liveLink->getId()); $toTime = strtotime($liveLink->getStart_date()); } else { $isLiveLink = uniqid(); $uuid = $isLiveLink; $t = LiveLinks::decodeDinamicVideoLink(); $toTime = time(); } if (empty($t['users_id'])) { die('Link not found'); } if ($toTime > time()) { $message = "{$t['title']}
{$t['description']}"; $image = User::getPhoto($t['users_id']); $bgImage = LiveLinks::getImage($t['id']); countDownPage($toTime, $message, $image, $bgImage); } $u = new User($t['users_id']); $user_id = $u->getBdId(); $subscribe = Subscribe::getButton($user_id); $name = $u->getNameIdentificationBd(); $name = "{$name} " . User::getEmailVerifiedIcon($user_id) . ""; $video = array(); $video['creator'] = '
User Photo
' . $name . '
' . $subscribe . '
'; $video['type'] = "liveLink"; $video['title'] = $t['title']; $video['description'] = $t['description']; $video['users_id'] = $t['users_id']; $poster = $img = LiveLinks::getImage($t['id']); $imgw = 400; $imgh = 255; if (!empty($_GET['embed'])) { $video['videoLink'] = LiveLinks::getSourceLink($t['id']); include $global['systemRootPath'] . 'view/videoEmbeded.php'; return false; } $isCompressed = AVideoPlugin::loadPluginIfEnabled('TheaterButton') && TheaterButton::isCompressed(); $sideAd = getAdsSideRectangle(); $modeYoutubeBottomClass1 = "col-sm-7 col-md-7 col-lg-6"; $modeYoutubeBottomClass2 = "col-sm-5 col-md-5 col-lg-4 "; if (empty($sideAd) && !AVideoPlugin::loadPluginIfEnabled("Chat2")) { $modeYoutubeBottomClass1 = "col-sm-12 col-md-12 col-lg-10"; $modeYoutubeBottomClass2 = "hidden "; } ?> <?php echo $t['title'] . $config->getPageTitleSeparator() . __("Live Links") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - - getWebSiteTitle(); ?>" /> " />

getChat($uuid); } ?> diff --git a/plugin/PlayLists/embed.php b/plugin/PlayLists/embed.php index 12c8bad64..91069b343 100644 --- a/plugin/PlayLists/embed.php +++ b/plugin/PlayLists/embed.php @@ -1,481 +1,480 @@ verifyEmbedSecurity(); } require_once $global['systemRootPath'] . 'objects/playlist.php'; require_once $global['systemRootPath'] . 'plugin/PlayLists/PlayListElement.php'; if (!User::isAdmin() && !PlayList::canSee($_GET['playlists_id'], User::getId())) { die('{"error":"' . __("Permission denied") . '"}'); } $playlist_index = intval(@$_REQUEST['playlist_index']); $pl = new PlayList($_GET['playlists_id']); $playList = PlayList::getVideosFromPlaylist($_GET['playlists_id']); $playListData = array(); $collectionsList = PlayList::showPlayListSelector($playList); $videoStartSeconds = array(); $users_id = User::getId(); foreach ($playList as $key => $value) { $oldValue = $value; if (!User::isAdmin() && !Video::userGroupAndVideoGroupMatch($users_id, $value['videos_id'])) { unset($playList[$key]); continue; } if ($oldValue['type'] === 'serie' && !empty($oldValue['serie_playlists_id'])) { $subPlayList = PlayList::getVideosFromPlaylist($value['serie_playlists_id']); foreach ($subPlayList as $value) { $sources = getVideosURL($value['filename']); $images = Video::getImageFromFilename($value['filename'], $value['type']); $externalOptions = _json_decode($value['externalOptions']); $src = new stdClass(); $src->src = $images->thumbsJpg; $thumbnail = array(); $thumbnail[] = $src; $playListSources = array(); foreach ($sources as $value2) { if ($value2['type'] !== 'video' && $value2['type'] !== 'audio') { continue; } $playListSources[] = new playListSource($value2['url']); } if (empty($playListSources)) { continue; } if (User::isLogged()) { $videoStartSeconds = Video::getLastVideoTimePosition($value['videos_id']); } if (empty($videoStartSeconds)) { $videoStartSeconds = parseDurationToSeconds(@$externalOptions->videoStartSeconds); } $playListData[] = new PlayListElement($value['title'], $value['description'], $value['duration'], $playListSources, $thumbnail, $images->poster, $videoStartSeconds, $value['cre'], $value['likes'], $value['views_count'], $value['videos_id'], "embedPlayList subPlaylistCollection-{$oldValue['serie_playlists_id']}"); } } else { $sources = getVideosURL($value['filename']); $images = Video::getImageFromFilename($value['filename'], $value['type']); $externalOptions = _json_decode($value['externalOptions']); $src = new stdClass(); $src->src = $images->thumbsJpg; $thumbnail = array(); $thumbnail[] = $src; $playListSources = array(); foreach ($sources as $value2) { if ($value2['type'] !== 'video' && $value2['type'] !== 'audio') { continue; } $playListSources[] = new playListSource($value2['url']); } if (function_exists('getVTTTracks')) { $subtitleTracks = getVTTTracks($value['filename'], true); } if (empty($playListSources)) { continue; } if (User::isLogged()) { $videoStartSeconds = Video::getLastVideoTimePosition($value['videos_id']); } if (empty($videoStartSeconds)) { $videoStartSeconds = parseDurationToSeconds(@$externalOptions->videoStartSeconds); } $playListData[] = new PlayListElement($value['title'], $value['description'], $value['duration'], $playListSources, $thumbnail, $images->poster, $videoStartSeconds, $value['cre'], $value['likes'], $value['views_count'], $value['videos_id'], "embedPlayList ", $subtitleTracks); } } if (empty($playListData)) { forbiddenPage(__("The program is empty")); } $url = PlayLists::getLink($pl->getId()); $title = $pl->getName(); if ($serie = PlayLists::isPlayListASerie($pl->getId())) { setVideos_id($serie['id']); } else if (!empty($playList[$playlist_index])) { setVideos_id($playList[$playlist_index]['id']); } //var_dump($playListData);exit; ?> <?php echo $config->getWebSiteTitle(); ?> - \ No newline at end of file diff --git a/plugin/PlayLists/player.php b/plugin/PlayLists/player.php index 890866d0a..fc0a755fe 100644 --- a/plugin/PlayLists/player.php +++ b/plugin/PlayLists/player.php @@ -1,346 +1,345 @@ $value) { if(!User::isAdmin() && !Video::userGroupAndVideoGroupMatch($users_id, $value['videos_id'])){ unset($playList[$key]); continue; } if ($value['type'] === 'embed') { $sources[0]['type'] = 'video'; $sources[0]['url'] = $value["videoLink"]; } else { $sources = getVideosURL($value['filename']); } $images = Video::getImageFromFilename($value['filename'], $value['type']); $externalOptions = _json_decode($value['externalOptions']); $src = new stdClass(); $src->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']); $playlist_index = intval(@$_REQUEST['playlist_index']); if (!empty($video['id'])) { AVideoPlugin::getEmbed($video['id']); setVideos_id($video['id']); } else if (!empty($playListData[$playlist_index])) { setVideos_id($playListData[$playlist_index]->getVideos_id()); $video = Video::getVideo($playListData[$playlist_index]->getVideos_id()); } ?> <?php echo $playListObj->getName() . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - showChannelBannerOnModeYoutube)) { ?>
showAdsenseBannerOnTop)) { ?>
'; echo PlayerSkins::getMediaTag($video['filename'], $htmlMediaTag); ?>
"/>




! videoNotFoundText->value) ? __("We have not found any videos or audios to show") : $advancedCustom->videoNotFoundText->value; ?>.
diff --git a/plugin/PlayLists/player_old.php b/plugin/PlayLists/player_old.php index 7a60f64e4..38f9abd52 100644 --- a/plugin/PlayLists/player_old.php +++ b/plugin/PlayLists/player_old.php @@ -1,349 +1,348 @@ 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)) { ?>
"/>




! videoNotFoundText->value) ? __("We have not found any videos or audios to show") : $advancedCustom->videoNotFoundText->value; ?>.
diff --git a/plugin/PlayerSkins/PlayerSkins.php b/plugin/PlayerSkins/PlayerSkins.php index 72b69fafe..f35a3472c 100644 --- a/plugin/PlayerSkins/PlayerSkins.php +++ b/plugin/PlayerSkins/PlayerSkins.php @@ -1,618 +1,619 @@ The Skis options are: "; $dir = $global['systemRootPath'] . 'plugin/PlayerSkins/skins/'; $names = array(); foreach (glob($dir . '*.css') as $file) { $path_parts = pathinfo($file); $names[] = $path_parts['filename']; } return $desc . "" . implode(" or ", $names) . ""; } public function getName() { return "PlayerSkins"; } public function getUUID() { return "e9a568e6-ef61-4dcc-aad0-0109e9be8e36"; } public function getPluginVersion() { return "1.1"; } public function getEmptyDataObject() { global $global; $obj = new stdClass(); $obj->skin = "avideo"; $obj->playbackRates = "[0.5, 1, 1.5, 2]"; $obj->playerCustomDataSetup = ""; $obj->showSocialShareOnEmbed = true; $obj->showLoopButton = true; $obj->showLogo = false; $obj->showShareSocial = true; $obj->showShareAutoplay = true; $obj->showLogoOnEmbed = false; $obj->showLogoAdjustScale = "0.4"; $obj->showLogoAdjustLeft = "-74px"; $obj->showLogoAdjustTop = "-22px;"; $obj->disableEmbedTopInfo = false; $obj->contextMenuDisableEmbedOnly = false; $obj->contextMenuLoop = true; $obj->contextMenuCopyVideoURL = true; $obj->contextMenuCopyVideoURLCurrentTime = true; $obj->contextMenuCopyEmbedCode = true; $obj->contextMenuShare = true; $obj->playerFullHeight = false; return $obj; } static function getMediaTag($filename, $htmlMediaTag = false) { global $autoPlayURL, $global, $config, $isVideoTypeEmbed, $advancedCustom; $obj = AVideoPlugin::getObjectData('PlayerSkins'); $html = ''; if (empty($htmlMediaTag)) { $video = Video::getVideoFromFileName($filename, true); $vType = Video::getIncludeType($video); $_GET['isMediaPlaySite'] = $video['id']; if (is_object($video['externalOptions'])) { if (!empty($video['externalOptions']->videoStartSeconds)) { $video['externalOptions']->videoStartSeconds = parseDurationToSeconds($video['externalOptions']->videoStartSeconds); } else { $video['externalOptions']->videoStartSeconds = 0; } } else { //_error_log('externalOptions Error '.$video['externalOptions'], AVideoLog::$WARNING); $video['externalOptions'] = new stdClass(); $video['externalOptions']->videoStartSeconds = 0; } $images = Video::getImageFromFilename($filename); if ($vType == 'video') { $htmlMediaTag = ''; } else if ($vType == 'audio') { $htmlMediaTag = ''; } else if ($vType == 'embed') { $disableYoutubeIntegration = false; if (!empty($advancedCustom->disableYoutubePlayerIntegration) || isMobile()) { $disableYoutubeIntegration = true; } $_GET['isEmbedded'] = ""; if (($disableYoutubeIntegration) || ((strpos($video['videoLink'], "youtu.be") == false) && (strpos($video['videoLink'], "youtube.com") == false) && (strpos($video['videoLink'], "vimeo.com") == false))) { $_GET['isEmbedded'] = "e"; $isVideoTypeEmbed = 1; $url = parseVideos($video['videoLink']); if ($config->getAutoplay()) { $url = addQueryStringParameter($url, 'autoplay', 1); } $htmlMediaTag = ""; $htmlMediaTag .= ''; $htmlMediaTag .= '
'; $htmlMediaTag .= ''; $htmlMediaTag .= ''; $htmlMediaTag .= '
'; } else { // youtube! if ((stripos($video['videoLink'], "youtube.com") != false) || (stripos($video['videoLink'], "youtu.be") != false)) { $_GET['isEmbedded'] = "y"; } else if ((stripos($video['videoLink'], "vimeo.com") != false)) { $_GET['isEmbedded'] = "v"; } $_GET['isMediaPlaySite'] = $video['id']; PlayerSkins::playerJSCodeOnLoad($video['id'], @$video['url']); $htmlMediaTag = ""; $htmlMediaTag .= ''; $htmlMediaTag .= ''; } } else if ($vType == 'serie') { $isVideoTypeEmbed = 1; $link = "{$global['webSiteRootURL']}plugin/PlayLists/embed.php"; $link = addQueryStringParameter($link, 'playlists_id', $video['serie_playlists_id']); $link = addQueryStringParameter($link, 'autoplay', $config->getAutoplay()); $link = addQueryStringParameter($link, 'playlist_index', @$_REQUEST['playlist_index']); $htmlMediaTag = ""; $htmlMediaTag .= ''; $htmlMediaTag .= ''; $htmlMediaTag .= ''; } $html .= "'; } $col1Classes = 'col-md-2 firstC'; $col2Classes = 'col-md-8 secC'; $col3Classes = 'col-md-2 thirdC'; if ($obj->playerFullHeight) { $col2Classes .= ' text-center playerFullHeight'; } $html .= '
' . $htmlMediaTag . '
'; $html .= showCloseButton() . '
'; return $html; } public function getHeadCode() { if (isWebRTC()) { return ''; } global $global, $config, $video; $obj = $this->getDataObject(); $css = ""; $js = ""; if (isLive()) { $js .= ""; } if (isVideo() || !empty($_GET['videoName']) || !empty($_GET['u']) || !empty($_GET['evideo']) || !empty($_GET['playlists_id'])) { if (!empty($_REQUEST['autoplay'])) { $js .= ""; } else if (self::isAutoplayEnabled()) { $js .= ""; } else { $js .= ""; } $js .= ""; if (!empty($obj->skin)) { - $css .= "skin}.css\" rel=\"stylesheet\" type=\"text/css\"/>"; + $url = "plugin/PlayerSkins/skins/{$obj->skin}.css"; + $css .= ""; } if ($obj->showLoopButton && isVideoPlayerHasProgressBar()) { - $css .= ""; + $css .= ""; } - $css .= ""; - $css .= ""; + $css .= ""; + $css .= ""; if ($obj->showLogoOnEmbed && isEmbed() || $obj->showLogo) { $logo = "{$global['webSiteRootURL']}" . $config->getLogo(true); $css .= ""; } if ($obj->showShareSocial && CustomizeUser::canShareVideosFromVideo(@$video['id'])) { - $css .= ""; + $css .= ""; } if ($obj->showShareAutoplay && isVideoPlayerHasProgressBar()) { - $css .= ""; + $css .= ""; } } $url = urlencode(getSelfURI()); $oembed = ''; $oembed .= ''; return $js . $css . $oembed; } public function getFooterCode() { if (isWebRTC()) { return ''; } global $global, $config, $getStartPlayerJSWasRequested, $video, $url, $title; $js = ""; $obj = $this->getDataObject(); if (!empty($_GET['videoName']) || !empty($_GET['u']) || !empty($_GET['evideo']) || !empty($_GET['playlists_id'])) { if (empty($obj->showLoopButton) && empty($playerSkinsObj->contextMenuLoop)) { $js .= ""; } if ($obj->showLogoOnEmbed && isEmbed() || $obj->showLogo) { $title = $config->getWebSiteTitle(); $url = "{$global['webSiteRootURL']}{$config->getLogo(true)}"; $js .= ""; PlayerSkins::getStartPlayerJS(file_get_contents("{$global['systemRootPath']}plugin/PlayerSkins/logo.js")); //$js .= ""; } if ($obj->showShareSocial && CustomizeUser::canShareVideosFromVideo(@$video['id'])) { $social = getSocialModal(@$video['id'], @$url, @$title); PlayerSkins::getStartPlayerJS(file_get_contents("{$global['systemRootPath']}plugin/PlayerSkins/shareButton.js")); //$js .= ""; $js .= $social['html']; $js .= ""; } if ($obj->showShareAutoplay && isVideoPlayerHasProgressBar()) { PlayerSkins::getStartPlayerJS(file_get_contents("{$global['systemRootPath']}plugin/PlayerSkins/autoplayButton.js")); } } if (isAudio()) { $videos_id = getVideos_id(); $video = Video::getVideoLight($videos_id); $spectrumSource = Video::getSourceFile($video['filename'], "_spectrum.jpg"); if (!empty($spectrumSource["path"])) { $onPlayerReady = "startAudioSpectrumProgress('{$spectrumSource["url"]}');"; self::prepareStartPlayerJS($onPlayerReady); } } if (!empty($getStartPlayerJSWasRequested) || isVideo()) { $js .= ""; $js .= ""; } return $js; } static function getDataSetup($str = "") { global $video, $disableYoutubeIntegration, $global; $obj = AVideoPlugin::getObjectData('PlayerSkins'); $dataSetup = array(); $dataSetup[] = "errorDisplay: false"; if (isVideoPlayerHasProgressBar() && !empty($obj->playbackRates)) { $dataSetup[] = "'playbackRates':{$obj->playbackRates}"; } if (isVideoPlayerHasProgressBar() && (isset($_GET['isEmbedded'])) && ($disableYoutubeIntegration == false) && !empty($video['videoLink'])) { if ($_GET['isEmbedded'] == "y") { $dataSetup[] = "techOrder:[\"youtube\"]"; $dataSetup[] = "sources:[{type: \"video/youtube\", src: \"{$video['videoLink']}\"}]"; $dataSetup[] = "youtube:{customVars: {wmode: \"transparent\", origin: \"{$global['webSiteRootURL']}\"}}"; } else if ($_GET['isEmbedded'] == "v") { $dataSetup[] = "techOrder:[\"vimeo\"]"; $dataSetup[] = "sources:[{type: \"video/vimeo\", src: \"{$video['videoLink']}\"}]"; $dataSetup[] = "vimeo:{customVars: {wmode: \"transparent\", origin: \"{$global['webSiteRootURL']}\"}}"; } } $pluginsDataSetup = AVideoPlugin::dataSetup(); if (!empty($pluginsDataSetup)) { $dataSetup[] = $pluginsDataSetup; } if (!empty($dataSetup)) { return ",{" . implode(",", $dataSetup) . "{$str}{$obj->playerCustomDataSetup}}"; } return ""; } // this function was modified, maybe removed in the future static function getStartPlayerJS($onPlayerReady = "", $getDataSetup = "", $noReadyFunction = false) { global $prepareStartPlayerJS_onPlayerReady, $prepareStartPlayerJS_getDataSetup; global $getStartPlayerJSWasRequested; self::prepareStartPlayerJS($onPlayerReady, $getDataSetup); //var_dump('getStartPlayerJSWasRequested', debug_backtrace()); $getStartPlayerJSWasRequested = true; //return '/* getStartPlayerJS $prepareStartPlayerJS_onPlayerReady = "' . count($prepareStartPlayerJS_onPlayerReady) . '", $prepareStartPlayerJS_getDataSetup = "' . count($prepareStartPlayerJS_getDataSetup) . '", $onPlayerReady = "' . $onPlayerReady . '", $getDataSetup = "' . $getDataSetup . '" */'; return '/* getStartPlayerJS $prepareStartPlayerJS_onPlayerReady = "' . count($prepareStartPlayerJS_onPlayerReady) . '", $prepareStartPlayerJS_getDataSetup = "' . count($prepareStartPlayerJS_getDataSetup) . '" */'; } static function addOnPlayerReady($onPlayerReady) { return self::getStartPlayerJS($onPlayerReady); } static function getStartPlayerJSCode($noReadyFunction = false, $currentTime = 0) { if (isWebRTC()) { return ''; } global $config, $global, $prepareStartPlayerJS_onPlayerReady, $prepareStartPlayerJS_getDataSetup, $IMAADTag; $obj = AVideoPlugin::getObjectData('PlayerSkins'); $js = ""; if (empty($currentTime) && isVideoPlayerHasProgressBar()) { $currentTime = self::getCurrentTime(); } if (!empty($global['doNotLoadPlayer'])) { return ''; } if (empty($prepareStartPlayerJS_onPlayerReady)) { $prepareStartPlayerJS_onPlayerReady = array(); } if (empty($prepareStartPlayerJS_getDataSetup)) { $prepareStartPlayerJS_getDataSetup = array(); } if (empty($noReadyFunction)) { $js .= "var originalVideo; var adTagOptions; var _adTagUrl = '{$IMAADTag}'; var player; " . "$(document).ready(function () {"; } $js .= " originalVideo = $('#mainVideo').clone(); /* prepareStartPlayerJS_onPlayerReady = " . count($prepareStartPlayerJS_onPlayerReady) . ", prepareStartPlayerJS_getDataSetup = " . count($prepareStartPlayerJS_getDataSetup) . " */ if (typeof player === 'undefined') { player = videojs('mainVideo'" . (self::getDataSetup(implode(" ", $prepareStartPlayerJS_getDataSetup))) . "); "; if (!empty($IMAADTag) && isVideoPlayerHasProgressBar()) { $js .= "adTagOptions = {id: 'mainVideo', adTagUrl: '{$IMAADTag}', autoPlayAdBreaks:false}; player.ima(adTagOptions);"; $js .= "setInterval(function(){ fixAdSize(); }, 300); // first time it's clicked. var startEvent = 'click';"; if (isMobile()) { $js .= "// Remove controls from the player on iPad to stop native controls from stealing // our click var contentPlayer = document.getElementById('content_video_html5_api'); if (contentPlayer && (navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i)) && contentPlayer.hasAttribute('controls')) { contentPlayer.removeAttribute('controls'); } // Initialize the ad container when the video player is clicked, but only the if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/Android/i)) { startEvent = 'touchend'; }"; } $js .= " player.on('adsready', function () { console.log('reloadAds adIsReady '); player.ima.setAdBreakReadyListener(function() {console.log('Ads playAdBreak()');player.ima.playAdBreak();}); });player.on('ads-ad-started', function () { console.log('ads-ad-started'); });player.on('ads-manager', function (a) { console.log('ads-manager', a); });player.on('ads-manager', function (a) { console.log('ads-loader', a); });player.on('ads-manager', function (a) { console.log('ads-request', a); });player.one(startEvent, function () {player.ima.initializeAdDisplayContainer();});"; } $js .= "} player.ready(function () {"; $js .= "var err = this.error(); if (err && err.code) { $('.vjs-error-display').hide(); $('#mainVideo').find('.vjs-poster').css({'background-image': 'url({$global['webSiteRootURL']}plugin/Live/view/Offline.jpg)'}); } " . implode(PHP_EOL, $prepareStartPlayerJS_onPlayerReady) . " playerPlayIfAutoPlay({$currentTime}); }); player.persistvolume({ namespace: 'AVideo' });"; if ($obj->showLoopButton && isVideoPlayerHasProgressBar()) { $js .= file_get_contents($global['systemRootPath'] . 'plugin/PlayerSkins/loopbutton.js'); } $js .= file_get_contents($global['systemRootPath'] . 'plugin/PlayerSkins/fixCurrentSources.js'); if (empty($noReadyFunction)) { $js .= "});"; } //var_dump('getStartPlayerJSWasRequested', debug_backtrace()); $getStartPlayerJSWasRequested = true; return $js; } static private function getCurrentTime() { $currentTime = 0; if (isset($_GET['t'])) { $currentTime = intval($_GET['t']); } else { $videos_id = getVideos_id(); if (!empty($videos_id)) { $video = Video::getVideoLight($videos_id); $progress = Video::getVideoPogressPercent($videos_id); if (!empty($progress) && !empty($progress['lastVideoTime'])) { $currentTime = intval($progress['lastVideoTime']); } else if (!empty($video['externalOptions'])) { $json = _json_decode($video['externalOptions']); if (!empty($json->videoStartSeconds)) { $currentTime = intval(parseDurationToSeconds($json->videoStartSeconds)); } else { $currentTime = 0; } } $maxCurrentTime = parseDurationToSeconds($video['duration']); if ($maxCurrentTime <= $currentTime + 5) { $currentTime = 0; } } } return $currentTime; } static function setIMAADTag($tag) { global $IMAADTag; $IMAADTag = $tag; } static function playerJSCodeOnLoad($videos_id, $nextURL = "") { $js = ""; $videos_id = intval($videos_id); if (empty($videos_id)) { return false; } $video = new Video("", "", $videos_id); if (!empty($video) && empty($nextURL)) { if (!empty($video->getNext_videos_id())) { $next_video = Video::getVideo($video->getNext_videos_id()); if (!empty($next_video['id'])) { $nextURL = Video::getURLFriendly($next_video['id'], isEmbed()); } } else { $catName = @$_GET['catName']; $cat = new Category($video->getCategories_id()); $_GET['catName'] = $cat->getClean_name(); $next_video = Video::getVideo('', 'viewable', false, true); $_GET['catName'] = $catName; if (!empty($next_video['id'])) { $nextURL = Video::getURLFriendly($next_video['id'], isEmbed()); } } } $url = Video::getURLFriendly($videos_id); $js .= " player.on('play', function () { addView({$videos_id}, this.currentTime()); _addViewBeaconAdded = false; }); player.on('timeupdate', function () { var time = Math.round(this.currentTime()); playerCurrentTime = time; var url = '{$url}'; if (url.indexOf('?') > -1) { url += '&t=' + time; } else { url += '?t=' + time; } $('#linkCurrentTime, .linkCurrentTime').val(url); if (time >= 5 && time % 30 === 0) { addView({$videos_id}, time); } }); player.on('ended', function () { var time = Math.round(this.currentTime()); addView({$videos_id}, time); });"; if (!empty($nextURL)) { $js .= "playNextURL = '{$nextURL}';"; $js .= "player.on('ended', function () {setTimeout(function(){if(playNextURL){playNext(playNextURL);}},playerHasAds()?10000:500);});"; } self::getStartPlayerJS($js); return true; } static private function prepareStartPlayerJS($onPlayerReady = "", $getDataSetup = "") { global $prepareStartPlayerJS_onPlayerReady, $prepareStartPlayerJS_getDataSetup; if (empty($prepareStartPlayerJS_onPlayerReady)) { $prepareStartPlayerJS_onPlayerReady = array(); } if (empty($prepareStartPlayerJS_getDataSetup)) { $prepareStartPlayerJS_getDataSetup = array(); } if (!empty($onPlayerReady)) { $prepareStartPlayerJS_onPlayerReady[] = $onPlayerReady; } if (!empty($getDataSetup)) { $prepareStartPlayerJS_getDataSetup[] = $getDataSetup; } } static function isAutoplayEnabled() { global $config; if (isLive()) { return true; } if (!empty($_COOKIE['autoplay'])) { if (strtolower($_COOKIE['autoplay']) === 'false') { return false; } else { return true; } } return $config->getAutoplay(); } public static function getVideoTags($videos_id) { if (empty($videos_id)) { return array(); } $name = "PlayeSkins_getVideoTags{$videos_id}"; $tags = ObjectYPT::getCache($name, 0); if (empty($tags)) { //_error_log("Cache not found $name"); $video = new Video("", "", $videos_id); $fileName = $video->getFilename(); $resolution = Video::getHigestResolution($fileName); $obj = new stdClass(); if (empty($resolution) || empty($resolution['resolution_text'])) { $obj->label = ''; $obj->type = ""; $obj->text = ""; } else { $obj->label = 'Plugin'; $obj->type = "danger"; $obj->text = $resolution['resolution_text']; $obj->tooltip = $resolution['resolution'] . 'p'; } $tags = $obj; ObjectYPT::setCache($name, $tags); } return array($tags); } } diff --git a/plugin/PlayerSkins/player.css b/plugin/PlayerSkins/player.css index cfd12ed70..99179a2c1 100644 --- a/plugin/PlayerSkins/player.css +++ b/plugin/PlayerSkins/player.css @@ -1,26 +1,45 @@ @media all and (max-width: 767px) { - .vjs-picture-in-picture-control , + .vjs-picture-in-picture-control, .player-logo, .vjs-seek-button{ display: none !important; } + .vjs-paused #seekBG{ + background-size: contain; + } } @media (max-width: 1200px) { .vjs-button:not(.player-logo) { max-width: 30px; } .vjs-remaining-time{ display: none !important; } } #avideo-audio-progress{ background-color: #00000099; height: 100%; width: 0; position: absolute; left: 0; top: 0; padding: 0; transition: width .1s; border-right: solid 2px #FF000099; +} +.img-portrait { + transform: scale(0.56) rotate(90deg); +} +.embed-responsive-9by16 { + padding-bottom: 100%; +} +.video-js.vjs-9-16 { + padding-top: 100%; +} +.vjs-rotate90 { + rotate: 90; + zoom: 1.0; +} +.vjs-thumbnail-holder { + margin-bottom: 10px; } \ No newline at end of file diff --git a/plugin/PlayerSkins/playerSample.php b/plugin/PlayerSkins/playerSample.php index 59e3c3af8..2ae26f167 100644 --- a/plugin/PlayerSkins/playerSample.php +++ b/plugin/PlayerSkins/playerSample.php @@ -1,64 +1,63 @@ <?php echo __("Player Sample") . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> - diff --git a/view/css/player.css b/view/css/player.css deleted file mode 100644 index 0071224b3..000000000 --- a/view/css/player.css +++ /dev/null @@ -1,20 +0,0 @@ -.img-portrait { - transform: scale(0.56) rotate(90deg); -} -.embed-responsive-9by16 { - padding-bottom: 100%; -} -.video-js.vjs-9-16 { - padding-top: 100%; -} - -.vjs-rotate90 { - rotate: 90; - zoom: 1.0; -} - -.vjs-thumbnail-holder { - - margin-bottom: 10px; - -} \ No newline at end of file diff --git a/view/modeYoutube.php b/view/modeYoutube.php index c96e0b329..b2f838897 100644 --- a/view/modeYoutube.php +++ b/view/modeYoutube.php @@ -1,421 +1,420 @@ thumbnails; $poster = $evideo->thumbnails; $imgw = 1280; $imgh = 720; $autoPlaySources = array(); $autoPlayURL = ''; $autoPlayPoster = ''; $autoPlayThumbsSprit = ''; } else { require_once $global['systemRootPath'] . 'objects/user.php'; require_once $global['systemRootPath'] . 'objects/category.php'; require_once $global['systemRootPath'] . 'objects/subscribe.php'; require_once $global['systemRootPath'] . 'objects/functions.php'; $img = "".getCDN()."view/img/notfound.jpg"; $poster = "".getCDN()."view/img/notfound.jpg"; $imgw = 1280; $imgh = 720; if (!empty($_GET['type'])) { if ($_GET['type'] == 'audio') { $_SESSION['type'] = 'audio'; } else if ($_GET['type'] == 'video') { $_SESSION['type'] = 'video'; } else if ($_GET['type'] == 'pdf') { $_SESSION['type'] = 'pdf'; } else { $_SESSION['type'] = ""; unset($_SESSION['type']); } } else { unset($_SESSION['type']); } session_write_close(); $modeYouTubeTimeLog['Code part 1'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($_GET['playlist_id'])) { $isSerie = 1; if (preg_match("/^[0-9]+$/", $_GET['playlist_id'])) { $playlist_id = $_GET['playlist_id']; } else if (User::isLogged()) { if ($_GET['playlist_id'] == "favorite") { $playlist_id = PlayList::getFavoriteIdFromUser(User::getId()); } else { $playlist_id = PlayList::getWatchLaterIdFromUser(User::getId()); } } if (!empty($_GET['playlist_index'])) { $playlist_index = $_GET['playlist_index']; } $videosArrayId = PlayList::getVideosIdFromPlaylist($playlist_id); if (empty($videosArrayId)) { videoNotFound(__('Playlist is empty or does not exist')); } $videosPlayList = Video::getAllVideos("viewable", false, false, $videosArrayId, false, true); $videosPlayList = PlayList::sortVideos($videosPlayList, $videosArrayId); $videoSerie = Video::getVideoFromSeriePlayListsId($playlist_id); 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) { $videoSerie["type"] = "embed"; $videoSerie["videoLink"] = $videoSerie["trailer1"]; array_unshift($videosPlayList, $videoSerie); array_unshift($videosArrayId, $videoSerie['id']); $isPlayListTrailer = true; } } if (empty($playlist_index) && $isPlayListTrailer && !empty($videoSerie)) { $video = $videoSerie; } else { $vid = new Video("", "", $videosPlayList[$playlist_index]['id']); $_GET['videoName'] = $vid->getClean_title(); $video = Video::getVideo($videosPlayList[$playlist_index]['id'], "viewable", false, false, false, true); } if (!empty($videosPlayList[$playlist_index + 1])) { $autoPlayVideo = Video::getVideo($videosPlayList[$playlist_index + 1]['id'], "viewableNotUnlisted", false, false, false, true); $autoPlayVideo['url'] = $global['webSiteRootURL'] . "playlist/{$playlist_id}/" . ($playlist_index + 1); } else if (!empty($videosPlayList[0])) { $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'])) { $catLink = "cat/{$_GET['catName']}/"; } // add this because if you change the video category the video was not loading anymore $catName = @$_GET['catName']; if (empty($_GET['clean_title']) && (isset($advancedCustom->forceCategory) && $advancedCustom->forceCategory === false)) { $_GET['catName'] = ""; } if (empty($video) && !empty($_REQUEST['v'])) { $video = Video::getVideo($_REQUEST['v'], "viewable", false, false, false, true); //var_dump('Line: '.__LINE__, $_REQUEST['v'], $video);exit; } if (empty($video)) { $video = Video::getVideo("", "viewable", false, false, true, true); } if (empty($video)) { $video = Video::getVideo("", "viewable", false, false, false, true); } if (empty($video)) { $video = AVideoPlugin::getVideo(); } if (!empty($_GET['v']) && (empty($video) || $video['id'] != $_GET['v'])) { $video = false; } if (!empty($video['id'])) { // allow users to count a view again in case it is refreshed Video::unsetAddView($video['id']); // add this because if you change the video category the video was not loading anymore $_GET['catName'] = $catName; $_GET['isMediaPlaySite'] = $video['id']; $obj = new Video("", "", $video['id']); } /* if (empty($_SESSION['type'])) { $_SESSION['type'] = $video['type']; } * */ // $resp = $obj->addView(); $get = array('channelName' => @$_GET['channelName'], 'catName' => @$_GET['catName']); $modeYouTubeTimeLog['Code part 1.1'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($video['next_videos_id'])) { $modeYouTubeTimeLog['Code part 1.2'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); $autoPlayVideo = Video::getVideo($video['next_videos_id']); } else { $modeYouTubeTimeLog['Code part 1.3'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); $modeYouTubeTimeLog['Code part 1.5'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($video['id'])) { $autoPlayVideo = Video::getRandom($video['id']); } //} } $modeYouTubeTimeLog['Code part 1.6'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($autoPlayVideo)) { $autoPlayVideo['creator'] = Video::getCreatorHTML($autoPlayVideo['users_id']); $autoPlayVideo['tags'] = Video::getTags($autoPlayVideo['id'], '
' . humanTiming(strtotime($autoPlayVideo['videoCreation'])) . ''); $autoPlayVideo['url'] = Video::getLink($autoPlayVideo['id'], $autoPlayVideo['clean_title'], false, $get); } } $modeYouTubeTimeLog['Code part 2'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($video)) { $name = User::getNameIdentificationById($video['users_id']); $name = "{$name} " . User::getEmailVerifiedIcon($video['users_id']) . ""; $subscribe = Subscribe::getButton($video['users_id']); $video['creator'] = Video::getCreatorHTML($video['users_id'], '
' . humanTiming(strtotime($video['videoCreation'])) . ''); $obj = new Video("", "", $video['id']); // Don't need because have an embedded video on this page // $resp = $obj->addView(); } if (!empty($video) && $video['type'] == "video") { $poster = "{$global['webSiteRootURL']}videos/{$video['filename']}.jpg"; } else { $poster = "".getCDN()."view/img/audio_wave.jpg"; } if (!empty($video)) { $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]; } else if ($video['type'] == "audio") { $img = "".getCDN()."view/img/audio_wave.jpg"; } $type = 'video'; if ($video['type'] === 'pdf') { $type = 'pdf'; } else if ($video['type'] === 'zip') { $type = 'zip'; } else if ($video['type'] === 'article') { $type = 'article'; } $images = Video::getImageFromFilename($video['filename'], $type); $poster = isMobile() ? $images->thumbsJpg : $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]; } else { $img = isMobile() ? $images->thumbsJpg : $images->poster; } } else { $poster = "".getCDN()."view/img/notfound.jpg"; } $objSecure = AVideoPlugin::getObjectDataIfEnabled('SecureVideosDirectory'); $modeYouTubeTimeLog['Code part 3'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); if (!empty($autoPlayVideo) && !empty($autoPlayVideo['filename'])) { $autoPlaySources = getSources($autoPlayVideo['filename'], true); $autoPlayURL = $autoPlayVideo['url']; $autoPlayPoster = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}.jpg"; $autoPlayThumbsSprit = "{$global['webSiteRootURL']}videos/{$autoPlayVideo['filename']}_thumbsSprit.jpg"; } else { $autoPlaySources = array(); $autoPlayURL = ''; $autoPlayPoster = ''; $autoPlayThumbsSprit = ""; } if (empty($_GET['videoName']) && !empty($video)) { $_GET['videoName'] = $video['clean_title']; } if(!empty($_GET['videoName'])){ $v = Video::getVideoFromCleanTitle($_GET['videoName']); } if (empty($v) && empty($videosPlayList[$playlist_index]['id'])) { videoNotFound(""); } else { $modeYouTubeTimeLog['Code part 4'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); AVideoPlugin::getModeYouTube($v['id']); $modeYouTubeTimeLog['Code part 5'] = microtime(true) - $modeYouTubeTime; $modeYouTubeTime = microtime(true); } } // video not found if (empty($video)) { /* $img = "".getCDN()."view/img/this-video-is-not-available.jpg"; $poster = "".getCDN()."view/img/this-video-is-not-available.jpg"; $imgw = 1280; $imgh = 720; unset($_SESSION['type']); session_write_close(); $video = array(); $video['id'] = 0; $video['type'] = 'notfound'; $video['rotation'] = 0; $video['videoLink'] = ""; $video['title'] = __("Video Not Available"); $video['clean_title'] = "video-not-available"; $video['description'] = ""; $video['duration'] = ""; $video['creator'] = ""; $video['likes'] = ""; $video['dislikes'] = ""; $video['category'] = "embed"; $video['views_count'] = 0; $video['filename'] = ""; header('HTTP/1.0 404 Not Found', true, 404); * */ videoNotFound('The video is not available'); } $metaDescription = " {$video['id']}"; // make sure the title tag does not have more then 70 chars $titleTag = $video['title']; $titleTag = (strlen($titleTag) > 50) ? (substr($titleTag, 0, 48) . " …") : $titleTag; $titleTag .= getSEOComplement(array("allowedTypes" => array("audio", "video", "pdf"))) . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); $titleTag = (strlen($titleTag) > 70) ? (substr($titleTag, 0, 68) . " …") : $titleTag; if (!empty($video['users_id']) && User::hasBlockedUser($video['users_id'])) { $video['type'] = "blockedUser"; } ?> <?php echo $titleTag; ?> - showChannelBannerOnModeYoutube)) { ?>




! videoNotFoundText->value) ? __("We have not found any videos or audios to show") : $advancedCustom->videoNotFoundText->value; ?>.
disableYoutubePlayerIntegration || isMobile(); if ((isset($_GET['isEmbedded'])) && ($disableYoutubeIntegration == false)) { if ($_GET['isEmbedded'] == "y") { ?> $value) { if ($value > 0.5) { echo "*** "; } echo "{$key} = {$value} seconds \n"; } echo "\n -->"; ?> diff --git a/view/videoEmbeded.php b/view/videoEmbeded.php index 28cddd81a..6ca30231d 100644 --- a/view/videoEmbeded.php +++ b/view/videoEmbeded.php @@ -1,580 +1,579 @@ thumbnails; $poster = $evideo->thumbnails; $imgw = 1280; $imgh = 720; $autoPlaySources = array(); $autoPlayURL = ''; $autoPlayPoster = ''; $autoPlayThumbsSprit = ''; } else if (!empty($_GET['v'])) { $video = Video::getVideo($_GET['v'], "", true, false, false, true); //$video['id'] = $_GET['v']; } else if (!empty($_GET['videoName'])) { $video = Video::getVideoFromCleanTitle($_GET['videoName']); } Video::unsetAddView($video['id']); AVideoPlugin::getEmbed($video['id']); if (empty($video)) { forbiddenPage("Video not found"); } if (empty($video['users_id'])) { $video['users_id'] = User::getId(); } if (empty($customizedAdvanced)) { $customizedAdvanced = AVideoPlugin::getObjectDataIfEnabled('CustomizeAdvanced'); } if (!isSameDomain(@$_SERVER['HTTP_REFERER'], $global['webSiteRootURL']) && !isAVideoMobileApp()) { if (!empty($advancedCustomUser->blockEmbedFromSharedVideos) && !CustomizeUser::canShareVideosFromVideo($video['id'])) { if (!empty($advancedCustomUser->blockEmbedFromSharedVideos)) { error_log("Embed is forbidden: \$advancedCustomUser->blockEmbedFromSharedVideos"); } if (!CustomizeUser::canShareVideosFromVideo($video['id'])) { error_log("Embed is forbidden: !CustomizeUser::canShareVideosFromVideo(\$video['id'])"); } forbiddenPage("Embed is forbidden"); } } $source = array(); $img = ""; $imgw = 1280; $imgh = 720; if ($video['type'] !== "pdf") { if (!empty($video['filename'])) { $source = Video::getSourceFile($video['filename']); $poster = $img = $source['url']; $data = getimgsize($source['path']); $imgw = $data[0]; $imgh = $data[1]; } } if (empty($poster)) { $poster = ""; if (!empty($video['filename'])) { $images = Video::getImageFromFilename($video['filename']); $poster = $images->poster; if (!empty($images->posterPortrait)) { $img = $images->posterPortrait; $data = getimgsize($source['path']); $imgw = $data[0]; $imgh = $data[1]; } } else { $images = array(); $poster = ""; $imgw = 0; $imgh = 0; } if (empty($poster) && !empty($video['filename'])) { if (($video['type'] !== "audio") && ($video['type'] !== "linkAudio")) { $poster = "{$global['webSiteRootURL']}videos/{$video['filename']}.jpg"; } else { $poster = "" . getCDN() . "view/img/audio_wave.jpg"; } } } require_once $global['systemRootPath'] . 'plugin/AVideoPlugin.php'; /* * Swap aspect ratio for rotated (vvs) videos if ($video['rotation'] === "90" || $video['rotation'] === "270") { $embedResponsiveClass = "embed-responsive-9by16"; $vjsClass = "vjs-9-16"; } else { $embedResponsiveClass = "embed-responsive-16by9"; $vjsClass = "vjs-16-9"; } */ $vjsClass = ""; $obj = new Video("", "", $video['id']); $resp = $obj->addView(); //https://.../vEmbed/527?modestbranding=1&showinfo=0&autoplay=1&controls=0&loop=1&mute=1&t=0 $modestbranding = false; $autoplay = false; $controls = "controls"; $showOnlyBasicControls = false; $loop = ""; $mute = ""; $objectFit = ""; $t = 0; if (isset($_GET['modestbranding']) && $_GET['modestbranding'] == "1") { $modestbranding = true; } if (!empty($_GET['autoplay']) || $config->getAutoplay()) { $autoplay = true; } if (isset($_GET['controls'])) { if($_GET['controls'] == "0"){ $controls = ""; }else if($_GET['controls'] == "-1"){ $showOnlyBasicControls = true; } } if (!empty($_GET['loop'])) { $loop = "loop"; } if (!empty($_GET['mute'])) { $mute = 'muted="muted"'; } if (!empty($_GET['objectFit'])) { $objectFit = 'object-fit: ' . $_GET['objectFit']; } if (!empty($_GET['t'])) { $t = intval($_GET['t']); } else if (!empty($video['progress']['lastVideoTime'])) { $t = intval($video['progress']['lastVideoTime']); } else if (!empty($video['externalOptions']->videoStartSeconds)) { $t = parseDurationToSeconds($video['externalOptions']->videoStartSeconds); } $playerSkinsO = AVideoPlugin::getObjectData("PlayerSkins"); $disableEmbedTopInfo = $playerSkinsO->disableEmbedTopInfo; if (isset($_REQUEST['showinfo']) && empty($_REQUEST['showinfo'])) { $disableEmbedTopInfo = true; $modestbranding = true; } $url = Video::getLink($video['id'], $video['clean_title'], false); $title = str_replace('"', '', $video['title']) . ' - ' . $config->getWebSiteTitle(); $photo = User::getPhoto($video['users_id']); if (empty($currentTime)) { $currentTime = 0; } if (User::hasBlockedUser($video['users_id'])) { $disableEmbedTopInfo = true; $video['type'] = "blockedUser"; } ?> <?php echo $video['title'] . $config->getPageTitleSeparator() . $config->getWebSiteTitle(); ?> -


You've blocked user ()
You won't see any comments or videos from this user


" class="img img-responsive" style="height: 100%;" >
    open($sources['zip']["path"]); for ($i = 0; $i < $za->numFiles; $i++) { $stat = $za->statIndex($i); $fname = basename($stat['name']); ?>