thumbnails;
$poster = $evideo->thumbnails;
$imgw = 1280;
$imgh = 720;
$autoPlaySources = [];
$autoPlayURL = '';
$autoPlayPoster = '';
$autoPlayThumbsSprit = '';
} else {
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
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';
} elseif ($_GET['type'] == 'video') {
$_SESSION['type'] = 'video';
} elseif ($_GET['type'] == 'pdf') {
$_SESSION['type'] = 'pdf';
} else {
$_SESSION['type'] = '';
unset($_SESSION['type']);
}
} else {
unset($_SESSION['type']);
}
session_write_close();
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (empty($_GET['playlist_id']) && !empty($_GET['playlist_name'])) {
$_GET['playlist_id'] = $_GET['playlist_name'];
}else if (empty($_GET['playlist_id']) && !empty($_GET['playlists_id'])) {
$_GET['playlist_id'] = $_GET['playlists_id'];
}
if (!empty($_GET['playlist_id'])) {
$isSerie = 1;
$plp = new PlayListPlayer(@$_GET['playlist_id'], @$_GET['playlists_tags_id']);
$playListData = $plp->getPlayListData();
$video = $plp->getCurrentVideo();
$_getVideos_id = intval($video['id']);
$playlist_index = $plp->getIndex();
if (empty($playListData)) {
videoNotFound('');
}
$videosPlayList = $plp->getVideos();
$autoPlayVideo = $plp->getNextVideo();
$playlist_id = $plp->getPlaylists_id();
//var_dump($video);exit;
} else {
$catLink = '';
if (!empty($_GET['catName'])) {
$catLink = "cat/{$_GET['catName']}/";
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
// 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($_GET, $video);exit;
//var_dump('Line: '.__LINE__, $_REQUEST['v'], $video);exit;
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (empty($video)) {
$video = Video::getVideo("", "viewable", false, false, true, true);
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (empty($video)) {
$video = Video::getVideo("", "viewable", false, false, false, true);
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
if (empty($video)) {
$video = AVideoPlugin::getVideo();
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
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']);
}
$get = ['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'], 'suggested');
//var_dump($autoPlayVideo['id']);exit;
if (empty($autoPlayVideo['id'])) {
$autoPlayVideo = Video::getRandom($video['id']);
}
}
//}
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
$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);
}
TimeLogEnd($timeLogNameMY, __LINE__, $TimeLogLimitMY);
}
$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'], '