Update Image path
|
@ -50,7 +50,7 @@ if (($video['type'] !== "audio") && ($video['type'] !== "linkAudio") && !empty($
|
|||
$imgw = $data[0];
|
||||
$imgh = $data[1];
|
||||
} elseif ($video['type'] == "audio") {
|
||||
$img = getCDN()."view/img/audio_wave.jpg";
|
||||
$img = ImagesPlaceHolders::getAudioLandscape(ImagesPlaceHolders::$RETURN_URL);
|
||||
}
|
||||
$type = 'video';
|
||||
if ($video['type'] === 'pdf') {
|
||||
|
|
|
@ -1212,52 +1212,6 @@ function cacheExpirationTime()
|
|||
return intval($cacheExpirationTime);
|
||||
}
|
||||
|
||||
function _getImagesURL($fileName, $type)
|
||||
{
|
||||
global $global;
|
||||
$files = [];
|
||||
$source = Video::getSourceFile($fileName, ".jpg");
|
||||
$file1 = $source['path'];
|
||||
if (file_exists($file1)) {
|
||||
$files["jpg"] = [
|
||||
'filename' => "{$fileName}.jpg",
|
||||
'path' => $file1,
|
||||
'url' => $source['url'],
|
||||
'type' => 'image',
|
||||
];
|
||||
} else {
|
||||
unset($file1);
|
||||
$files["jpg"] = [
|
||||
'filename' => "{$type}.png",
|
||||
'path' => getURL("view/img/{$type}.png"),
|
||||
'url' => getURL("view/img/{$type}.png"),
|
||||
'type' => 'image',
|
||||
];
|
||||
}
|
||||
$source = Video::getSourceFile($fileName, "_portrait.jpg");
|
||||
$file2 = $source['path'];
|
||||
if (file_exists($file2)) {
|
||||
$files["pjpg"] = [
|
||||
'filename' => "{$fileName}_portrait.jpg",
|
||||
'path' => $file2,
|
||||
'url' => $source['url'],
|
||||
'type' => 'image',
|
||||
];
|
||||
} elseif ($type !== 'image') {
|
||||
if (!empty($file1)) {
|
||||
$files["pjpg"] = $files["jpg"];
|
||||
} else {
|
||||
$files["pjpg"] = [
|
||||
'filename' => "{$type}_portrait.png",
|
||||
'path' => getURL("view/img/{$type}_portrait.png"),
|
||||
'url' => getURL("view/img/{$type}_portrait.png"),
|
||||
'type' => 'image',
|
||||
];
|
||||
}
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
function getVideosURLPDF($fileName)
|
||||
{
|
||||
global $global;
|
||||
|
@ -1277,7 +1231,7 @@ function getVideosURLPDF($fileName)
|
|||
'url' => $source['url'],
|
||||
'type' => 'pdf',
|
||||
];
|
||||
$files = array_merge($files, _getImagesURL($fileName, 'pdf'));
|
||||
$files = array_merge($files, array('jpg'=>ImagesPlaceHolders::getPdfLandscape(ImagesPlaceHolders::$RETURN_ARRAY)));
|
||||
$time = microtime();
|
||||
$time = explode(' ', $time);
|
||||
$time = $time[1] + $time[0];
|
||||
|
@ -1314,7 +1268,7 @@ function getVideosURLIMAGE($fileName)
|
|||
}
|
||||
}
|
||||
|
||||
$files = array_merge($files, _getImagesURL($fileName, 'image'));
|
||||
$files = array_merge($files, array('jpg'=>ImagesPlaceHolders::getImageLandscape(ImagesPlaceHolders::$RETURN_ARRAY)));
|
||||
$time = microtime();
|
||||
$time = explode(' ', $time);
|
||||
$time = $time[1] + $time[0];
|
||||
|
@ -1351,7 +1305,7 @@ function getVideosURLZIP($fileName)
|
|||
}
|
||||
}
|
||||
|
||||
$files = array_merge($files, _getImagesURL($fileName, 'zip'));
|
||||
$files = array_merge($files, array('jpg'=>ImagesPlaceHolders::getZipLandscape(ImagesPlaceHolders::$RETURN_ARRAY)));
|
||||
$time = microtime();
|
||||
$time = explode(' ', $time);
|
||||
$time = $time[1] + $time[0];
|
||||
|
@ -1371,8 +1325,7 @@ function getVideosURLArticle($fileName)
|
|||
$time = explode(' ', $time);
|
||||
$time = $time[1] + $time[0];
|
||||
$start = $time;
|
||||
//$files = array_merge($files, _getImagesURL($fileName, 'article'));
|
||||
$files = _getImagesURL($fileName, 'article');
|
||||
$files = array('jpg'=>ImagesPlaceHolders::getArticlesLandscape(ImagesPlaceHolders::$RETURN_ARRAY));
|
||||
$time = microtime();
|
||||
$time = explode(' ', $time);
|
||||
$time = $time[1] + $time[0];
|
||||
|
@ -1426,7 +1379,7 @@ function getVideosURLAudio($fileName, $fileNameisThePath = false)
|
|||
];
|
||||
}
|
||||
|
||||
$files = array_merge($files, _getImagesURL($fileName, 'audio_wave'));
|
||||
$files = array_merge($files, array('jpg'=>ImagesPlaceHolders::getAudioLandscape(ImagesPlaceHolders::$RETURN_ARRAY)));
|
||||
$time = microtime();
|
||||
$time = explode(' ', $time);
|
||||
$time = $time[1] + $time[0];
|
||||
|
@ -1713,10 +1666,14 @@ function getVideosURL_V2($fileName, $recreateCache = false, $checkFiles = true)
|
|||
ObjectYPT::setCacheGlobal($cacheName, $files);
|
||||
}
|
||||
/*
|
||||
if(empty($recreateCache) && $fileName == "video_230813150408_va39e"){
|
||||
if(empty($recreateCache) && $fileName == "v_230810144748_v424f"){
|
||||
var_dump($fileName, $files, debug_backtrace());exit;
|
||||
}
|
||||
*/
|
||||
if (empty($files) || empty($files['jpg'])) {
|
||||
// sort by resolution
|
||||
$files = array('jpg'=>ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_ARRAY));
|
||||
}else
|
||||
if (is_array($files)) {
|
||||
// sort by resolution
|
||||
uasort($files, "sortVideosURL");
|
||||
|
@ -1790,9 +1747,9 @@ function getResolutionFromFilename($filename)
|
|||
function getSources($fileName, $returnArray = false, $try = 0)
|
||||
{
|
||||
if ($returnArray) {
|
||||
$videoSources = $audioTracks = $subtitleTracks = [];
|
||||
$videoSources = $audioTracks = $subtitleTracks = $captionsTracks = [];
|
||||
} else {
|
||||
$videoSources = $audioTracks = $subtitleTracks = '';
|
||||
$videoSources = $audioTracks = $subtitleTracks = $captionsTracks = '';
|
||||
}
|
||||
|
||||
$video = Video::getVideoFromFileNameLight($fileName);
|
||||
|
@ -1821,10 +1778,14 @@ function getSources($fileName, $returnArray = false, $try = 0)
|
|||
if (function_exists('getVTTTracks')) {
|
||||
$subtitleTracks = getVTTTracks($fileName, $returnArray);
|
||||
}
|
||||
if (function_exists('getVTTCaptionTracks')) {
|
||||
$captionsTracks = getVTTCaptionTracks($fileName, $returnArray);
|
||||
}
|
||||
//var_dump($subtitleTracks, $captionsTracks);exit;
|
||||
if ($returnArray) {
|
||||
$return = array_merge($videoSources, $audioTracks, $subtitleTracks);
|
||||
$return = array_merge($videoSources, $audioTracks, $subtitleTracks, $captionsTracks);
|
||||
} else {
|
||||
$return = $videoSources . $audioTracks . $subtitleTracks;
|
||||
$return = $videoSources . $audioTracks . $subtitleTracks.$captionsTracks;
|
||||
}
|
||||
|
||||
$obj = new stdClass();
|
||||
|
@ -2955,6 +2916,10 @@ function getImageTagIfExists($relativePath, $title = '', $id = '', $style = '',
|
|||
$file = createWebPIfNotExists($file);
|
||||
}
|
||||
$url = getURL(getRelativePath($file));
|
||||
//var_dump($relativePath, $file, $url);exit;
|
||||
if(ImagesPlaceHolders::isDefaultImage($url)){
|
||||
$class .= ' ImagesPlaceHoldersDefaultImage';
|
||||
}
|
||||
if (file_exists($file)) {
|
||||
$image_info = @getimagesize($file);
|
||||
if (!empty($image_info)) {
|
||||
|
@ -2975,7 +2940,7 @@ function getImageTagIfExists($relativePath, $title = '', $id = '', $style = '',
|
|||
if (is_string($lazyLoad)) {
|
||||
$loading = getURL($lazyLoad);
|
||||
} else {
|
||||
$loading = getURL('view/img/loading-gif.png');
|
||||
$loading = ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL);
|
||||
}
|
||||
$img .= " src=\"{$loading}\" data-src=\"{$url}\" ";
|
||||
} else {
|
||||
|
@ -4041,7 +4006,7 @@ function siteMap()
|
|||
TimeLogEnd("siteMap Video::getLink $videos_id", __LINE__, 0.5);
|
||||
$title = strip_tags($video['title']);
|
||||
TimeLogStart("siteMap Video::getLinkToVideo $videos_id");
|
||||
$player_loc = Video::getLinkToVideo($video['id'], $video['clean_title'], true);
|
||||
$player_loc = Video::getLinkToVideo($video['id'], $video['clean_title'], true, 'permlink');
|
||||
TimeLogEnd("siteMap Video::getLinkToVideo $videos_id", __LINE__, 0.5);
|
||||
TimeLogStart("siteMap Video::isPublic $videos_id");
|
||||
$requires_subscription = Video::isPublic($video['id']) ? "no" : "yes";
|
||||
|
@ -10460,6 +10425,9 @@ function getIncludeFileContent($filePath, $varsArray = [], $setCacheName = false
|
|||
$return = '';
|
||||
if (!empty($setCacheName)) {
|
||||
$name = $filePath . '_' . User::getId() . '_' . getLanguage();
|
||||
if(is_string($setCacheName)){
|
||||
$name .= $setCacheName;
|
||||
}
|
||||
//var_dump($name);exit;
|
||||
$return = ObjectYPT::getSessionCache($name, 0);
|
||||
}
|
||||
|
@ -11636,20 +11604,6 @@ function isImageNotFound($imgURL){
|
|||
if(empty($imgURL)){
|
||||
return true;
|
||||
}
|
||||
if(preg_match('/notfound/i', $imgURL)){
|
||||
return true;
|
||||
}
|
||||
if(preg_match('/pdf_portrait/i', $imgURL)){
|
||||
return true;
|
||||
}
|
||||
if(preg_match('/article_portrait/i', $imgURL)){
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
if(preg_match('/audio_wave/i', $imgURL)){
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
return false;
|
||||
return ImagesPlaceHolders::isDefaultImage($imgURL);
|
||||
}
|
182
objects/images.php
Normal file
|
@ -0,0 +1,182 @@
|
|||
<?php
|
||||
|
||||
Class ImagesPlaceHolders {
|
||||
|
||||
public static $RETURN_RELATIVE = 0;
|
||||
public static $RETURN_PATH = 1;
|
||||
public static $RETURN_URL = 2;
|
||||
public static $RETURN_ARRAY = 3;
|
||||
private static $placeholders = [
|
||||
'imageIcon' => 'view/img/placeholders/image.png',
|
||||
'imageLandscape' => 'view/img/placeholders/imageLandscape.png',
|
||||
'imagePortrait' => 'view/img/placeholders/imagePortrait.png',
|
||||
'imageNotFoundIcon' => 'view/img/placeholders/imageNotFound.png',
|
||||
'imageNotFoundLandscape' => 'view/img/placeholders/imageNotFoundLandscape.png',
|
||||
'imageNotFoundPortrait' => 'view/img/placeholders/imageNotFoundPortrait.png',
|
||||
'articlesIcon' => 'view/img/placeholders/articles.png',
|
||||
'articlesLandscape' => 'view/img/placeholders/articlesLandscape.png',
|
||||
'articlesPortrait' => 'view/img/placeholders/articlesPortrait.png',
|
||||
'audioIcon' => 'view/img/placeholders/audio.png',
|
||||
'audioLandscape' => 'view/img/placeholders/audioLandscape.png',
|
||||
'audioPortrait' => 'view/img/placeholders/audioPortrait.png',
|
||||
'pdfIcon' => 'view/img/placeholders/pdf.png',
|
||||
'pdfLandscape' => 'view/img/placeholders/pdfLandscape.png',
|
||||
'pdfPortrait' => 'view/img/placeholders/pdfPortrait.png',
|
||||
'userIcon' => 'view/img/placeholders/user.png',
|
||||
'userLandscape' => 'view/img/placeholders/userLandscape.png',
|
||||
'userPortrait' => 'view/img/placeholders/userPortrait.png',
|
||||
'zipIcon' => 'view/img/placeholders/zip.png',
|
||||
'zipLandscape' => 'view/img/placeholders/zipLandscape.png',
|
||||
'zipPortrait' => 'view/img/placeholders/zipPortrait.png',
|
||||
'videoPlaceholder' => 'view/img/video-placeholder-gray.png',
|
||||
'videoPlaceholderPortrait' => 'view/img/video-placeholder-gray-portrait.png',
|
||||
'videoNotFoundPoster' => 'view/img/this-video-is-not-available.jpg'
|
||||
];
|
||||
|
||||
static private function getComponent($type, $return = 0) {
|
||||
global $global;
|
||||
if (!isset(self::$placeholders[$type])) {
|
||||
return null; // handle invalid type
|
||||
}
|
||||
$relativePath = self::$placeholders[$type];
|
||||
if (!empty($global[$type])) {
|
||||
$relativePath = $global[$type];
|
||||
}
|
||||
if ($return === ImagesPlaceHolders::$RETURN_URL) {
|
||||
return getURL($relativePath);
|
||||
}
|
||||
if ($return === ImagesPlaceHolders::$RETURN_PATH) {
|
||||
return $global['systemRootPath'] . $relativePath;
|
||||
}
|
||||
if ($return === ImagesPlaceHolders::$RETURN_ARRAY) {
|
||||
$extension = pathinfo($relativePath, PATHINFO_EXTENSION);
|
||||
return [
|
||||
'filename' =>basename($relativePath),
|
||||
'path' => $global['systemRootPath'] . $relativePath,
|
||||
'url' => getURL($relativePath),
|
||||
'url_noCDN' => $global['webSiteRootURL'] . $relativePath,
|
||||
'type' => 'image',
|
||||
'format' => $extension,
|
||||
];
|
||||
}
|
||||
return $relativePath;
|
||||
}
|
||||
|
||||
static function isDefaultImage($path) {
|
||||
global $global;
|
||||
|
||||
foreach (self::$placeholders as $key => $defaultImagePath) {
|
||||
$defaultImage = self::getComponent($key);
|
||||
if (strpos($defaultImage, $path) !== false) {
|
||||
return true;
|
||||
}
|
||||
$basename = basename($path);
|
||||
if (strpos($defaultImage, $basename) !== false) {
|
||||
return true;
|
||||
}
|
||||
$fullPath = $global['systemRootPath'] . $defaultImage;
|
||||
$urlPath = getURL($defaultImage);
|
||||
|
||||
if ($path === $defaultImage || $path === $fullPath || $path === $urlPath) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static function getImageIcon($return = 0) {
|
||||
return self::getComponent('imageIcon', $return);
|
||||
}
|
||||
|
||||
static function getImageLandscape($return = 0) {
|
||||
return self::getComponent('imageLandscape', $return);
|
||||
}
|
||||
|
||||
static function getImagePortrait($return = 0) {
|
||||
return self::getComponent('imagePortrait', $return);
|
||||
}
|
||||
|
||||
static function getImageNotFoundIcon($return = 0) {
|
||||
return self::getComponent('imageNotFoundIcon', $return);
|
||||
}
|
||||
|
||||
static function getImageNotFoundLandscape($return = 0) {
|
||||
return self::getComponent('imageNotFoundLandscape', $return);
|
||||
}
|
||||
|
||||
static function getImageNotFoundPortrait($return = 0) {
|
||||
return self::getComponent('imageNotFoundPortrait', $return);
|
||||
}
|
||||
|
||||
static function getArticlesIcon($return = 0) {
|
||||
return self::getComponent('articlesIcon', $return);
|
||||
}
|
||||
|
||||
static function getArticlesLandscape($return = 0) {
|
||||
return self::getComponent('articlesLandscape', $return);
|
||||
}
|
||||
|
||||
static function getArticlesPortrait($return = 0) {
|
||||
return self::getComponent('articlesPortrait', $return);
|
||||
}
|
||||
|
||||
static function getAudioIcon($return = 0) {
|
||||
return self::getComponent('audioIcon', $return);
|
||||
}
|
||||
|
||||
static function getAudioLandscape($return = 0) {
|
||||
return self::getComponent('audioLandscape', $return);
|
||||
}
|
||||
|
||||
static function getAudioPortrait($return = 0) {
|
||||
return self::getComponent('audioPortrait', $return);
|
||||
}
|
||||
|
||||
static function getPdfIcon($return = 0) {
|
||||
return self::getComponent('pdfIcon', $return);
|
||||
}
|
||||
|
||||
static function getPdfLandscape($return = 0) {
|
||||
return self::getComponent('pdfLandscape', $return);
|
||||
}
|
||||
|
||||
static function getPdfPortrait($return = 0) {
|
||||
return self::getComponent('pdfPortrait', $return);
|
||||
}
|
||||
|
||||
static function getUserIcon($return = 0) {
|
||||
return self::getComponent('userIcon', $return);
|
||||
}
|
||||
|
||||
static function getUserLandscape($return = 0) {
|
||||
return self::getComponent('userLandscape', $return);
|
||||
}
|
||||
|
||||
static function getUserPortrait($return = 0) {
|
||||
return self::getComponent('userPortrait', $return);
|
||||
}
|
||||
|
||||
static function getZipIcon($return = 0) {
|
||||
return self::getComponent('zipIcon', $return);
|
||||
}
|
||||
|
||||
static function getZipLandscape($return = 0) {
|
||||
return self::getComponent('zipLandscape', $return);
|
||||
}
|
||||
|
||||
static function getZipPortrait($return = 0) {
|
||||
return self::getComponent('zipPortrait', $return);
|
||||
}
|
||||
|
||||
static function getVideoPlaceholder($return = 0) {
|
||||
return self::getComponent('videoPlaceholder', $return);
|
||||
}
|
||||
static function getVideoPlaceholderPortrait($return = 0) {
|
||||
return self::getComponent('videoPlaceholderPortrait', $return);
|
||||
}
|
||||
static function getVideoNotFoundPoster($return = 0) {
|
||||
return self::getComponent('videoNotFoundPoster', $return);
|
||||
}
|
||||
|
||||
}
|
|
@ -113,6 +113,7 @@ $global['webSiteRootURL'] = fixTestURL($global['webSiteRootURL']);
|
|||
require_once $global['systemRootPath'] . 'objects/mysql_dal.php';
|
||||
require_once $global['systemRootPath'] . 'objects/configuration.php';
|
||||
require_once $global['systemRootPath'] . 'objects/security.php';
|
||||
require_once $global['systemRootPath'] . 'objects/images.php';
|
||||
|
||||
includeConfigLog(__LINE__);
|
||||
// for update config from old versions 2020-05-11
|
||||
|
|
|
@ -554,7 +554,7 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
}
|
||||
if (empty($photo)) {
|
||||
$photo = "view/img/userSilhouette.jpg";
|
||||
$photo = ImagesPlaceHolders::getUserIcon();
|
||||
}
|
||||
return $photo;
|
||||
}
|
||||
|
@ -580,7 +580,7 @@ if (typeof gtag !== \"function\") {
|
|||
}
|
||||
}
|
||||
if (empty($photo)) {
|
||||
$photo = "view/img/userSilhouette.jpg";
|
||||
$photo = ImagesPlaceHolders::getUserIcon();
|
||||
if (!$returnRelativePath) {
|
||||
$photo = getURL($photo);
|
||||
}
|
||||
|
@ -604,8 +604,8 @@ if (typeof gtag !== \"function\") {
|
|||
{
|
||||
global $global;
|
||||
$photo = self::_getPhoto($users_id);
|
||||
if ($photo == "view/img/userSilhouette.jpg") {
|
||||
return getURL('view/img/userSilhouette.jpg');
|
||||
if ($photo == ImagesPlaceHolders::getUserIcon()) {
|
||||
return getURL($photo);
|
||||
}
|
||||
if (empty($photo)) {
|
||||
return false;
|
||||
|
|
|
@ -4037,7 +4037,7 @@ if (!class_exists('Video')) {
|
|||
//self::_moveSourceFilesToDir($filename);
|
||||
$paths = self::getPaths($filename);
|
||||
if ($type == '_thumbsSmallV2.jpg' && empty($advancedCustom->usePreloadLowResolutionImages)) {
|
||||
return ['path' => $global['systemRootPath'] . 'view/img/loading-gif.png', 'url' => getURL('view/img/loading-gif.png')];
|
||||
return ['path' => ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_PATH), 'url' => ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL)];
|
||||
}
|
||||
|
||||
TimeLogEnd($timeLog1, __LINE__, $timeLog1Limit);
|
||||
|
@ -4458,7 +4458,7 @@ if (!class_exists('Video')) {
|
|||
return $matches[1];
|
||||
}
|
||||
|
||||
$search = ['_Low', '_SD', '_HD', '_thumbsV2', '_thumbsSmallV2', '_thumbsSprit', '_roku', '_portrait', '_portrait_thumbsV2', '_portrait_thumbsSmallV2', '_thumbsV2_jpg', '_spectrum', '_tvg', '.notfound'];
|
||||
$search = ['_Low', '_SD', '_HD', '_thumbsV2', '_thumbsSmallV2', '_thumbsSprit', '_roku', '_portrait', '_portrait_thumbsV2', '_portrait_thumbsSmallV2', '_thumbsV2_jpg', '_spectrum', '_tvg', '.notfound', '.chapters'];
|
||||
|
||||
if (!empty($global['langs_codes_values_withdot']) && is_array($global['langs_codes_values_withdot'])) {
|
||||
$search = array_merge($search, $global['langs_codes_values_withdot']);
|
||||
|
@ -4959,7 +4959,7 @@ if (!class_exists('Video')) {
|
|||
$relativePath = str_replace($global['systemRootPath'], '', $rokuImage);
|
||||
return getURL($relativePath);
|
||||
}
|
||||
return getURL("view/img/notfound.jpg");
|
||||
return ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL);
|
||||
}
|
||||
|
||||
public static function clearImageCache($filename, $type = "video")
|
||||
|
@ -4982,7 +4982,7 @@ if (!class_exists('Video')) {
|
|||
if (!empty($_getImageFromFilename_[$cacheFileName])) {
|
||||
$obj = $_getImageFromFilename_[$cacheFileName];
|
||||
} else {
|
||||
$cache = ObjectYPT::getCache($cacheFileName, 0, false, true, true);
|
||||
//$cache = ObjectYPT::getCache($cacheFileName, 0, false, true, true);
|
||||
if (!empty($cache)) {
|
||||
return $cache;
|
||||
}
|
||||
|
@ -5037,34 +5037,38 @@ if (!class_exists('Video')) {
|
|||
convertImageIfNotExists($jpegPortraitThumbsSmall['path'], $jpegPortraitThumbsSmall['path'], $advancedCustom->thumbsWidthPortrait / 2, $advancedCustom->thumbsHeightPortrait / 2, true);
|
||||
TimeLogEnd($timeLog1, __LINE__, $timeLog1Limit);
|
||||
} else {
|
||||
if ($type == "article") {
|
||||
$obj->posterPortrait = "" . getURL("view/img/article_portrait.png");
|
||||
$obj->posterPortraitPath = "{$global['systemRootPath']}view/img/article_portrait.png";
|
||||
$obj->posterPortraitThumbs = "" . getURL("view/img/article_portrait.png");
|
||||
$obj->posterPortraitThumbsSmall = "" . getURL("view/img/article_portrait.png");
|
||||
} elseif ($type == "pdf") {
|
||||
$obj->posterPortrait = "" . getURL("view/img/pdf_portrait.png");
|
||||
$obj->posterPortraitPath = "{$global['systemRootPath']}view/img/pdf_portrait.png";
|
||||
$obj->posterPortraitThumbs = "" . getURL("view/img/pdf_portrait.png");
|
||||
$obj->posterPortraitThumbsSmall = "" . getURL("view/img/pdf_portrait.png");
|
||||
} /* elseif ($type == "image") {
|
||||
$obj->posterPortrait = "".getCDN()."view/img/image_portrait.png";
|
||||
$obj->posterPortraitPath = "{$global['systemRootPath']}view/img/image_portrait.png";
|
||||
$obj->posterPortraitThumbs = "".getCDN()."view/img/image_portrait.png";
|
||||
$obj->posterPortraitThumbsSmall = "".getCDN()."view/img/image_portrait.png";
|
||||
} */ elseif ($type == "zip") {
|
||||
$obj->posterPortrait = "" . getURL("view/img/zip_portrait.png");
|
||||
$obj->posterPortraitPath = "{$global['systemRootPath']}view/img/zip_portrait.png";
|
||||
$obj->posterPortraitThumbs = "" . getURL("view/img/zip_portrait.png");
|
||||
$obj->posterPortraitThumbsSmall = "" . getURL("view/img/zip_portrait.png");
|
||||
if ($type == Video::$videoTypeArticle) {
|
||||
$obj->posterPortrait = ImagesPlaceHolders::getArticlesPortrait(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->posterPortraitPath = ImagesPlaceHolders::getArticlesLandscape(ImagesPlaceHolders::$RETURN_PATH);
|
||||
$obj->posterPortraitThumbs = $obj->posterPortrait;
|
||||
$obj->posterPortraitThumbsSmall = $obj->posterPortrait;
|
||||
} elseif ($type == Video::$videoTypePdf) {
|
||||
$obj->posterPortrait = ImagesPlaceHolders::getPdfPortrait(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->posterPortraitPath = ImagesPlaceHolders::getPdfPortrait(ImagesPlaceHolders::$RETURN_PATH);
|
||||
$obj->posterPortraitThumbs = $obj->posterPortrait;
|
||||
$obj->posterPortraitThumbsSmall = $obj->posterPortrait;
|
||||
} elseif ($type == Video::$videoTypeZip) {
|
||||
$obj->posterPortrait =ImagesPlaceHolders::getZipPortrait(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->posterPortraitPath = ImagesPlaceHolders::getZipPortrait(ImagesPlaceHolders::$RETURN_PATH);
|
||||
$obj->posterPortraitThumbs = $obj->posterPortrait;
|
||||
$obj->posterPortraitThumbsSmall = $obj->posterPortrait;
|
||||
} elseif ($type == Video::$videoTypeImage) {
|
||||
$obj->posterPortrait = ImagesPlaceHolders::getImageNotFoundPortrait(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->posterPortraitPath = ImagesPlaceHolders::getImageNotFoundPortrait(ImagesPlaceHolders::$RETURN_PATH);
|
||||
$obj->posterPortraitThumbs = $obj->posterPortrait;
|
||||
$obj->posterPortraitThumbsSmall = $obj->posterPortrait;
|
||||
} elseif ($type == Video::$videoTypeAudio || $type == Video::$videoTypeLinkAudio) {
|
||||
$obj->posterPortrait = ImagesPlaceHolders::getAudioPortrait(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->posterPortraitPath = ImagesPlaceHolders::getAudioPortrait(ImagesPlaceHolders::$RETURN_PATH);
|
||||
$obj->posterPortraitThumbs = $obj->posterPortrait;
|
||||
$obj->posterPortraitThumbsSmall = $obj->posterPortrait;
|
||||
} else {
|
||||
$obj->posterPortrait = "" . getURL("view/img/notfound_portrait.jpg");
|
||||
$obj->posterPortraitPath = "{$global['systemRootPath']}view/img/notfound_portrait.png";
|
||||
$obj->posterPortraitThumbs = "" . getURL("view/img/notfound_portrait.jpg");
|
||||
$obj->posterPortraitThumbsSmall = "" . getURL("view/img/notfound_portrait.jpg");
|
||||
$obj->posterPortrait = ImagesPlaceHolders::getVideoPlaceholderPortrait(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->posterPortraitPath = ImagesPlaceHolders::getVideoPlaceholderPortrait(ImagesPlaceHolders::$RETURN_PATH);
|
||||
$obj->posterPortraitThumbs = $obj->posterPortrait;
|
||||
$obj->posterPortraitThumbsSmall = $obj->posterPortrait;
|
||||
}
|
||||
}
|
||||
|
||||
TimeLogEnd($timeLog1, __LINE__, $timeLog1Limit);
|
||||
if (file_exists($jpegSource['path'])) {
|
||||
$obj->poster = $jpegSource['url'];
|
||||
|
@ -5074,36 +5078,36 @@ if (!class_exists('Video')) {
|
|||
|
||||
TimeLogEnd($timeLog1, __LINE__, $timeLog1Limit);
|
||||
} else {
|
||||
if ($type == "article") {
|
||||
$obj->poster = "" . getURL("view/img/article.png");
|
||||
$obj->thumbsJpg = "" . getURL("view/img/article.png");
|
||||
$obj->thumbsJpgSmall = "" . getURL("view/img/article.png");
|
||||
} elseif ($type == "pdf") {
|
||||
$obj->poster = "" . getURL("view/img/pdf.png");
|
||||
$obj->thumbsJpg = "" . getURL("view/img/pdf.png");
|
||||
$obj->thumbsJpgSmall = "" . getURL("view/img/pdf.png");
|
||||
} elseif ($type == "image") {
|
||||
$obj->poster = "" . getURL("view/img/image.png");
|
||||
$obj->thumbsJpg = "" . getURL("view/img/image.png");
|
||||
$obj->thumbsJpgSmall = "" . getURL("view/img/image.png");
|
||||
} elseif ($type == "zip") {
|
||||
$obj->poster = "" . getURL("view/img/zip.png");
|
||||
$obj->thumbsJpg = "" . getURL("view/img/zip.png");
|
||||
$obj->thumbsJpgSmall = "" . getURL("view/img/zip.png");
|
||||
} elseif (($type !== "audio") && ($type !== "linkAudio")) {
|
||||
if ($type == Video::$videoTypeArticle) {
|
||||
$obj->poster = ImagesPlaceHolders::getArticlesLandscape(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->thumbsJpg = $obj->poster;
|
||||
$obj->thumbsJpgSmall = $obj->poster;
|
||||
} elseif ($type == Video::$videoTypePdf) {
|
||||
$obj->poster = ImagesPlaceHolders::getPdfLandscape(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->thumbsJpg = $obj->poster;
|
||||
$obj->thumbsJpgSmall = $obj->poster;
|
||||
} elseif ($type == Video::$videoTypeImage) {
|
||||
$obj->poster = ImagesPlaceHolders::getImageLandscape(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->thumbsJpg = $obj->poster;
|
||||
$obj->thumbsJpgSmall = $obj->poster;
|
||||
} elseif ($type == Video::$videoTypeZip) {
|
||||
$obj->poster = ImagesPlaceHolders::getZipLandscape(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->thumbsJpg = $obj->poster;
|
||||
$obj->thumbsJpgSmall = $obj->poster;
|
||||
} elseif (($type !== Video::$videoTypeAudio) && ($type !== Video::$videoTypeLinkAudio)) {
|
||||
if (file_exists($spectrumSource['path'])) {
|
||||
$obj->poster = $spectrumSource['url'];
|
||||
$obj->thumbsJpg = $spectrumSource['url'];
|
||||
$obj->thumbsJpgSmall = $spectrumSource['url'];
|
||||
} else {
|
||||
$obj->poster = "" . getURL("view/img/notfound.jpg");
|
||||
$obj->thumbsJpg = "" . getURL("view/img/notfoundThumbs.jpg");
|
||||
$obj->thumbsJpgSmall = "" . getURL("view/img/notfoundThumbsSmall.jpg");
|
||||
$obj->poster = ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->thumbsJpg = $obj->poster;
|
||||
$obj->thumbsJpgSmall = $obj->poster;
|
||||
}
|
||||
} else {
|
||||
$obj->poster = "" . getURL("view/img/audio_wave.jpg");
|
||||
$obj->thumbsJpg = "" . getURL("view/img/audio_waveThumbs.jpg");
|
||||
$obj->thumbsJpgSmall = "" . getURL("view/img/audio_waveThumbsSmall.jpg");
|
||||
$obj->poster = ImagesPlaceHolders::getAudioLandscape(ImagesPlaceHolders::$RETURN_URL);
|
||||
$obj->thumbsJpg = $obj->poster;
|
||||
$obj->thumbsJpgSmall = $obj->poster;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5119,6 +5123,7 @@ if (!class_exists('Video')) {
|
|||
$obj->thumbsGif = false;
|
||||
}
|
||||
|
||||
//var_dump(__LINE__, $obj->poster);
|
||||
ObjectYPT::setCache($cacheFileName, $obj);
|
||||
//$cache = ObjectYPT::getCache($cacheFileName, 0);
|
||||
//_error_log("getImageFromFilename_($filename, $type) [$cacheFileName] ".!empty($cache).' ' .json_encode($response));
|
||||
|
@ -5181,7 +5186,7 @@ if (!class_exists('Video')) {
|
|||
} else if (!empty($return->posterPortrait)) {
|
||||
$return->default = ['url' => $return->posterPortrait, 'path' => $return->posterPortraitPath];
|
||||
} else {
|
||||
$return->default = ['url' => getURL("view/img/notfoundThumbs.jpg"), 'path' => "{$global['systemRootPath']}view/img/notfoundThumbs.jpg"];
|
||||
$return->default = ['url' => ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL), 'path' => ImagesPlaceHolders::getVideoPlaceholder()];
|
||||
}
|
||||
|
||||
return $return;
|
||||
|
|
|
@ -137,7 +137,7 @@ if (!User::isAdmin()) {
|
|||
<div class="row">
|
||||
<h3><?php echo __("Add Videos into Campaign"); ?> - <strong id="campaignName"></strong></h3>
|
||||
<div class="col-md-4">
|
||||
<img id="inputVideo-poster" src="<?php echo $global['webSiteRootURL']; ?>img/notfound.jpg" class="ui-state-default img-responsive" alt="">
|
||||
<img id="inputVideo-poster" src="<?php echo ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL); ?>" class="ui-state-default img-responsive" alt="">
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<input id="inputVideo" placeholder="<?php echo __("Video"); ?>" class="form-control">
|
||||
|
@ -237,7 +237,7 @@ if (!User::isAdmin()) {
|
|||
var tableLinks;
|
||||
var videoUploadModalinterval;
|
||||
function clearVideoForm() {
|
||||
$('#inputVideo-poster').attr('src', "<?php echo $global['webSiteRootURL']; ?>view/img/notfound.jpg");
|
||||
$('#inputVideo-poster').attr('src', "<?php echo ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL); ?>");
|
||||
$('#inputVideo').val('');
|
||||
$('#inputVideoClean').val('');
|
||||
$('#inputVideoURI').val('');
|
||||
|
|
|
@ -495,7 +495,7 @@ class API extends PluginAbstract
|
|||
if (is_array($tags)) {
|
||||
foreach ($tags as $key => $row) {
|
||||
$tags[$key]['videos'] = array();
|
||||
$tags[$key]['photo'] = $global['webSiteRootURL'] . 'view/img/notfound.jpg';
|
||||
$tags[$key]['photo'] = ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL);
|
||||
if (!empty($row['subscription'])) {
|
||||
$videos = TagsHasVideos::getAllVideosFromTagsId($row['id']);
|
||||
$tags[$key]['videos'] = PlayLists::videosToPlaylist($videos, @$parameters['index'], !empty($parameters['audioOnly']));
|
||||
|
|
|
@ -4,37 +4,46 @@ global $global;
|
|||
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||
require_once $global['systemRootPath'] . 'plugin/Bookmark/Objects/BookmarkTable.php';
|
||||
|
||||
class Bookmark extends PluginAbstract {
|
||||
class Bookmark extends PluginAbstract
|
||||
{
|
||||
|
||||
public function getDescription() {
|
||||
return "You can add bookmarks to indicate points of interest in a video or audio clip.";
|
||||
public function getDescription()
|
||||
{
|
||||
return "You can add bookmarks in a video or audio clip to highlight interest points or select chapters";
|
||||
}
|
||||
|
||||
public function getName() {
|
||||
public function getName()
|
||||
{
|
||||
return "Bookmark";
|
||||
}
|
||||
|
||||
public function getUUID() {
|
||||
public function getUUID()
|
||||
{
|
||||
return "27570956-dc62-46e3-ace9-86c6e8f9c84b";
|
||||
}
|
||||
|
||||
public function getPluginMenu(){
|
||||
public function getPluginMenu()
|
||||
{
|
||||
global $global;
|
||||
$filename = $global['systemRootPath'] . 'plugin/Bookmark/pluginMenu.html';
|
||||
return file_get_contents($filename);
|
||||
}
|
||||
|
||||
public function getFooterCode() {
|
||||
if(empty($_GET['videoName'])){
|
||||
return false;
|
||||
}
|
||||
public function getFooterCode()
|
||||
{
|
||||
global $global;
|
||||
$video = Video::getVideoFromCleanTitle($_GET['videoName']);
|
||||
$rows = BookmarkTable::getAllFromVideo($video['id']);
|
||||
$videos_id = getVideos_id();
|
||||
if (!empty($videos_id)) {
|
||||
$rows = BookmarkTable::getAllFromVideo($videos_id);
|
||||
//var_dump($rows);exit;
|
||||
if (!empty($rows)) {
|
||||
include $global['systemRootPath'] . 'plugin/Bookmark/footer.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getVideosManagerListButton() {
|
||||
public function getVideosManagerListButton()
|
||||
{
|
||||
global $global;
|
||||
|
||||
$btn = '';
|
||||
|
@ -42,4 +51,132 @@ class Bookmark extends PluginAbstract {
|
|||
return $btn;
|
||||
}
|
||||
|
||||
static function parseTimeString($str)
|
||||
{
|
||||
$pattern = "/\s*(\d{2}:\d{2}(?::\d{2})?)\s*-\s*(.+)$/m";
|
||||
preg_match_all($pattern, $str, $matches, PREG_SET_ORDER);
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($matches as $match) {
|
||||
// Normalize time format to HH:MM:SS
|
||||
$timeParts = explode(":", $match[1]);
|
||||
if (count($timeParts) == 2) {
|
||||
$match[1] = $match[1] . ":00";
|
||||
}
|
||||
|
||||
$result[] = [
|
||||
'seconds' => timeToSeconds($match[1]),
|
||||
'time' => $match[1],
|
||||
'text' => $match[2]
|
||||
];
|
||||
}
|
||||
// Sort the array by time
|
||||
usort($result, function ($a, $b) {
|
||||
return $a['seconds'] - $b['seconds'];
|
||||
});
|
||||
return $result;
|
||||
}
|
||||
|
||||
static function videoToVtt($videos_id)
|
||||
{
|
||||
$data = BookmarkTable::getAllFromVideo($videos_id);
|
||||
|
||||
$output = "WEBVTT\n\n";
|
||||
|
||||
foreach ($data as $index => $item) {
|
||||
$start_time = $item["timeInSeconds"];
|
||||
|
||||
// Assume each chapter is 5 seconds long if it's the last one,
|
||||
// or calculate the time until the next chapter starts
|
||||
$end_time = ($index == count($data) - 1) ? $start_time + 5 : $data[$index + 1]["timeInSeconds"] - 1;
|
||||
|
||||
$output .= secondsToTime($start_time) . " --> " . secondsToTime($end_time) . "\n";
|
||||
$output .= $item["name"] . "\n\n";
|
||||
}
|
||||
|
||||
// Save to a WebVTT file
|
||||
$bytes = file_put_contents(self::getChaptersFilename($videos_id), $output);
|
||||
return $bytes;
|
||||
//var_dump($bytes, self::getChaptersFilename($videos_id), $output);exit;
|
||||
}
|
||||
|
||||
static function getChaptersFilenameFromFilename($fileName, $lang='en') {
|
||||
$video = Video::getVideoFromFileNameLight($fileName);
|
||||
//var_dump($video);
|
||||
return self::getChaptersFilename($video['id'], $lang);
|
||||
}
|
||||
|
||||
static function getChaptersFilename($videos_id, $lang='en') {
|
||||
$video = new Video("", "", $videos_id);
|
||||
$filename = $video->getFilename();
|
||||
$path = Video::getPathToFile($filename);
|
||||
if (empty($lang) || strtoupper($lang) == 'CC') {
|
||||
$vttFilename = "{$path}.chapters.vtt";
|
||||
} else {
|
||||
$vttFilename = "{$path}.chapters.{$lang}.vtt";
|
||||
}
|
||||
|
||||
return $vttFilename;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getVTTCaptionTracks($fileName, $returnArray = false) {
|
||||
global $global;
|
||||
$cache = getVTTCaptionCache($fileName);
|
||||
if (!empty($cache)) {
|
||||
$objCache = _json_decode($cache);
|
||||
} else {
|
||||
$sourcesArray = array();
|
||||
$tracks = "";
|
||||
if (!empty($fileName)) {
|
||||
$defaultFile = Bookmark::getChaptersFilenameFromFilename($fileName);
|
||||
//var_dump( $defaultFile, Video::getCleanFilenameFromFile($defaultFile));exit;
|
||||
if (file_exists($defaultFile)) {
|
||||
$path_parts = pathinfo($defaultFile);
|
||||
$src = Video::getURLToFile($path_parts['basename']);
|
||||
$obj = new stdClass();
|
||||
$obj->srclang = 'en';
|
||||
$obj->src = $src;
|
||||
$obj->filename = $defaultFile;
|
||||
$obj->label = 'Chapters';
|
||||
$obj->desc = 'Chapters';
|
||||
|
||||
$tracks .= "<track kind=\"chapters\" src=\"{$obj->src}\" srclang=\"{$obj->srclang}\" label=\"{$obj->label}\" default>";
|
||||
|
||||
$sourcesArray[] = $obj;
|
||||
}
|
||||
}
|
||||
$objCache = new stdClass();
|
||||
$objCache->sourcesArray = $sourcesArray;
|
||||
$objCache->tracks = $tracks;
|
||||
createVTTCaptionCache($fileName, json_encode($objCache));
|
||||
}
|
||||
return $returnArray ? $objCache->sourcesArray : $objCache->tracks;
|
||||
}
|
||||
|
||||
function getVTTCaptionCache($fileName) {
|
||||
global $global;
|
||||
$cacheDir = $global['systemRootPath'] . 'videos/cache/vttCaption/';
|
||||
$file = "{$cacheDir}{$fileName}.cache";
|
||||
if (!file_exists($file)) {
|
||||
return false;
|
||||
}
|
||||
return file_get_contents($file);
|
||||
}
|
||||
|
||||
function createVTTCaptionCache($fileName, $data) {
|
||||
global $global;
|
||||
$cacheDir = $global['systemRootPath'] . 'videos/cache/vttCaption/';
|
||||
if (!file_exists($cacheDir)) {
|
||||
mkdir($cacheDir, 0777, true);
|
||||
}
|
||||
file_put_contents("{$cacheDir}{$fileName}.cache", $data);
|
||||
}
|
||||
|
||||
function deleteVTTCaptionCache($fileName) {
|
||||
global $global;
|
||||
$cacheDir = $global['systemRootPath'] . 'videos/cache/vttCaption/';
|
||||
@unlink("{$cacheDir}{$fileName}.cache");
|
||||
}
|
|
@ -29,7 +29,7 @@ class BookmarkTable extends ObjectYPT {
|
|||
}
|
||||
|
||||
function setTimeInSeconds($timeInSeconds) {
|
||||
$this->timeInSeconds = $timeInSeconds;
|
||||
$this->timeInSeconds = floatval($timeInSeconds);
|
||||
}
|
||||
|
||||
function setName($name) {
|
||||
|
@ -43,6 +43,7 @@ class BookmarkTable extends ObjectYPT {
|
|||
static function deleteAllFromVideo($videos_id) {
|
||||
global $global;
|
||||
if (!empty($videos_id)) {
|
||||
Bookmark::videoToVtt($videos_id);
|
||||
$sql = "DELETE FROM " . static::getTableName() . " ";
|
||||
$sql .= " WHERE videos_id = ?";
|
||||
$global['lastQuery'] = $sql;
|
||||
|
@ -64,8 +65,6 @@ class BookmarkTable extends ObjectYPT {
|
|||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
@ -84,8 +83,6 @@ class BookmarkTable extends ObjectYPT {
|
|||
foreach ($fullData as $row) {
|
||||
$rows[] = $row;
|
||||
}
|
||||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
return $rows;
|
||||
}
|
||||
|
@ -96,7 +93,22 @@ class BookmarkTable extends ObjectYPT {
|
|||
if(!empty($row)){
|
||||
$this->id = $row['id'];
|
||||
}
|
||||
parent::save();
|
||||
$id = parent::save();
|
||||
if(!empty($id)){
|
||||
Bookmark::videoToVtt($id);
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
public function delete() {
|
||||
if(!empty($this->id)){
|
||||
$b = new BookmarkTable($this->id);
|
||||
}
|
||||
$deleted = parent::delete();
|
||||
if(!empty($b)){
|
||||
Bookmark::videoToVtt($b->getVideos_id());
|
||||
}
|
||||
return $deleted;
|
||||
}
|
||||
|
||||
static protected function getFromTime($videos_id, $timeInSeconds) {
|
||||
|
|
|
@ -84,6 +84,6 @@
|
|||
|
||||
function clearBookmarkForm() {
|
||||
$('#bookmarkForm')[0].reset();
|
||||
$('#inputVideo-poster').attr('src','<?php echo $global['webSiteRootURL']; ?>img/notfound.jpg');
|
||||
$('#inputVideo-poster').attr('src','<?php echo ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL); ?>');
|
||||
}
|
||||
</script>
|
|
@ -417,10 +417,11 @@ Allow: /plugin/Gallery/*.js
|
|||
Allow: /plugin/YouPHPFlix2/*.png
|
||||
Allow: /plugin/Live/*.css
|
||||
Allow: /plugin/Live/*.js
|
||||
Allow: /plugin/LiveLink/?*
|
||||
Allow: /plugin/*.css
|
||||
Allow: /plugin/*.js
|
||||
Allow: .js
|
||||
Allow: .css
|
||||
Allow: *.js
|
||||
Allow: *.css
|
||||
Disallow: /user
|
||||
Disallow: /plugin
|
||||
Disallow: /mvideos
|
||||
|
@ -432,8 +433,8 @@ Disallow: /subscribes
|
|||
Disallow: /update
|
||||
Disallow: /locale
|
||||
Disallow: /objects/*
|
||||
Disallow: /view/?lang=*
|
||||
Allow: /plugin/Live/?*
|
||||
Allow: /plugin/LiveLink/?*
|
||||
Allow: /plugin/PlayLists/*.css
|
||||
Allow: /plugin/PlayLists/*.js
|
||||
Allow: /plugin/TopMenu/*.css
|
||||
|
@ -445,10 +446,12 @@ Allow: /plugin/Gallery/*.js
|
|||
Allow: /plugin/YouPHPFlix2/*.png
|
||||
Allow: /plugin/Live/*.css
|
||||
Allow: /plugin/Live/*.js
|
||||
Allow: /plugin/LiveLink/?*
|
||||
Allow: /plugin/*.css
|
||||
Allow: /plugin/*.js
|
||||
Allow: *.js
|
||||
Allow: *.css";
|
||||
Allow: *.css
|
||||
";
|
||||
$obj->robotsTXT = $o;
|
||||
self::addDataObjectHelper('robotsTXT', 'robots.txt file content', 'robots.txt is a plain text file that follows the Robots Exclusion Standard. A robots.txt file consists of one or more rules. Each rule blocks (or allows) access for a given crawler to a specified file path in that website.');
|
||||
|
||||
|
@ -903,6 +906,6 @@ $global['social_medias'] = array(
|
|||
'LinkedIn' => new SocialMedias('fab fa-linkedin-in', ''),
|
||||
'Wordpress' => new SocialMedias('fab fa-wordpress-simple', ''),
|
||||
'Pinboard' => new SocialMedias('fas fa-thumbtack', ''),
|
||||
'Gab' => new SocialMedias('', getURL('view/img/gab.png')),
|
||||
'CloutHub' => new SocialMedias('', getURL('view/img/cloutHub.png')),
|
||||
'Gab' => new SocialMedias('', getURL('view/img/social/gab.png')),
|
||||
'CloutHub' => new SocialMedias('', getURL('view/img/social/cloutHub.png')),
|
||||
);
|
||||
|
|
|
@ -4,7 +4,7 @@ require_once dirname(__FILE__) . '/../../videos/configuration.php';
|
|||
setIsConfirmationPage();
|
||||
$images = Video::getImageFromFilename($video['filename']);
|
||||
$img = $images->poster;
|
||||
if (!empty($images->posterPortrait) && strpos($images->posterPortrait, 'notfound_portrait') === false) {
|
||||
if (!empty($images->posterPortrait) && !ImagesPlaceHolders::isDefaultImage($images->posterPortrait)) {
|
||||
$img = $images->posterPortrait;
|
||||
}
|
||||
$imgw = 1280;
|
||||
|
|
|
@ -3,7 +3,7 @@ require_once '../videos/configuration.php';
|
|||
setIsConfirmationPage();
|
||||
$images = Video::getImageFromFilename($video['filename']);
|
||||
$img = $images->poster;
|
||||
if (!empty($images->posterPortrait) && strpos($images->posterPortrait, 'notfound_portrait') === false) {
|
||||
if (!empty($images->posterPortrait) && !ImagesPlaceHolders::isDefaultImage($images->posterPortrait)) {
|
||||
$img = $images->posterPortrait;
|
||||
}
|
||||
$imgw = 1280;
|
||||
|
|
|
@ -42,7 +42,7 @@ class Gallery extends PluginAbstract
|
|||
global $global;
|
||||
$obj = $this->getDataObject();
|
||||
// preload image
|
||||
$js = "<script>var img1 = new Image();img1.src=\"" . getURL('view/img/video-placeholder-gray.png') . "\";</script>";
|
||||
$js = "<script>var img1 = new Image();img1.src=\"" . ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL) . "\";</script>";
|
||||
$css = '<link href="' . getURL('plugin/Gallery/style.css') . '" rel="stylesheet" type="text/css"/>';
|
||||
|
||||
if (!empty($obj->playVideoOnFullscreenOnIframe)) {
|
||||
|
|
|
@ -116,7 +116,7 @@ if ((!empty($videos)) || (!empty($obj) && $obj->SubCategorys)) {
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
$poster = $global['webSiteRootURL'] . "view/img/notfound.jpg";
|
||||
$poster = ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL);
|
||||
?>
|
||||
<img src="<?php echo $poster; ?>" alt="" data-toggle="tooltip" title="<?php echo $description; ?>" class="thumbsJPG img img-responsive" id="thumbsJPG<?php echo $cat['id']; ?>" />
|
||||
<?php
|
||||
|
|
|
@ -39,7 +39,8 @@ $_REQUEST['rowCount'] = $obj->CategoriesRowCount;
|
|||
<?php
|
||||
$timeLogName = TimeLogStart('modeGalleryCategory');
|
||||
foreach ($categories as $_cat) {
|
||||
$setCacheName = "include{$_cat['clean_name']}";
|
||||
$setCacheName = "include{$_cat['id']}";
|
||||
//var_dump($_cat, $setCacheName);exit;
|
||||
$contents = getIncludeFileContent("{$global['systemRootPath']}plugin/Gallery/view/modeGalleryCategoryInclude.php",
|
||||
['_cat'=>$_cat, 'obj'=>$obj], $setCacheName);
|
||||
echo $contents;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
if (empty($_cat['clean_name'])) {
|
||||
return;
|
||||
}
|
||||
}//var_dump($_cat);exit;
|
||||
$_REQUEST['catName'] = $_cat['clean_name'];
|
||||
if (!empty($liveobj) && empty($liveobj->doNotShowLiveOnCategoryList)) {
|
||||
$currentCat = $_cat;
|
||||
|
|
|
@ -9,7 +9,7 @@ if (!empty($default_users_id)) {
|
|||
|
||||
if (empty($name)) {
|
||||
$name = '';
|
||||
$user_image = getURL('view/img/userSilhouette.jpg');
|
||||
$user_image = ImagesPlaceHolders::getUserIcon(ImagesPlaceHolders::$RETURN_URL);
|
||||
$default_users_id = 0;
|
||||
}
|
||||
?>
|
||||
|
@ -55,7 +55,7 @@ if (empty($name)) {
|
|||
function resetUserAutocomplete<?php echo $id; ?>() {
|
||||
$("#user<?php echo $id; ?>").val('');
|
||||
$("#<?php echo $id; ?>").val(0);
|
||||
var photoURL = webSiteRootURL + 'img/userSilhouette.jpg'
|
||||
var photoURL = webSiteRootURL + 'view/img/placeholders/user.png'
|
||||
$("#user-img<?php echo $id; ?>").attr("src", photoURL);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ if (empty($name)) {
|
|||
select: function (event, ui) {
|
||||
$("#user<?php echo $id; ?>").val(ui.item.identification);
|
||||
$("#<?php echo $id; ?>").val(ui.item.id);
|
||||
var photoURL = webSiteRootURL + 'img/userSilhouette.jpg'
|
||||
var photoURL = webSiteRootURL + 'view/img/placeholders/user.png'
|
||||
if (ui.item.photo) {
|
||||
photoURL = ui.item.photo;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ if (!empty($default_videos_id)) {
|
|||
|
||||
if (empty($name)) {
|
||||
$name = '';
|
||||
$video_image = getURL('img/notfound.jpg');
|
||||
$video_image = ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL);
|
||||
$default_videos_id = 0;
|
||||
}
|
||||
?>
|
||||
|
@ -56,7 +56,7 @@ if (empty($name)) {
|
|||
function resetvideoAutocomplete<?php echo $id; ?>() {
|
||||
$("#videoAutocomplete<?php echo $id; ?>").val('');
|
||||
$("#<?php echo $id; ?>").val(0);
|
||||
var photoURL = webSiteRootURL + 'img/notfound.jpg'
|
||||
var photoURL = '<?php echo ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL); ?>'
|
||||
$("#videoAutocomplete-img<?php echo $id; ?>").attr("src", photoURL);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ if (empty($name)) {
|
|||
select: function (event, ui) {
|
||||
$("#videoAutocomplete<?php echo $id; ?>").val(ui.item.title);
|
||||
$("#<?php echo $id; ?>").val(ui.item.id);
|
||||
var photoURL = webSiteRootURL + 'img/notfound.jpg'
|
||||
var photoURL = '<?php echo ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL); ?>'
|
||||
if (ui.item.videosURL.jpg.url) {
|
||||
photoURL = ui.item.videosURL.jpg.url;
|
||||
}
|
||||
|
|
|
@ -489,8 +489,8 @@ class Live extends PluginAbstract {
|
|||
$title,
|
||||
$u->getNameIdentificationBd(),
|
||||
$link,
|
||||
(!empty($imgJPG) ? '<img src="' . getURL('view/img/loading-gif.png') . '" data-src="' . $imgJPG . '" class="thumbsJPG img-responsive" height="130">' : ''),
|
||||
(!empty($imgGIF) ? ('<img src="' . getURL('view/img/loading-gif.png') . '" data-src="' . $imgGIF . '" style="position: absolute; top: 0px; height: 0px; width: 0px; display: none;" class="thumbsGIF img-responsive" height="130">') : ''),
|
||||
(!empty($imgJPG) ? '<img src="' . ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL) . '" data-src="' . $imgJPG . '" class="thumbsJPG img-responsive" height="130">' : ''),
|
||||
(!empty($imgGIF) ? ('<img src="' .ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_URL) . '" data-src="' . $imgGIF . '" style="position: absolute; top: 0px; height: 0px; width: 0px; display: none;" class="thumbsGIF img-responsive" height="130">') : ''),
|
||||
$LiveUsersLabelLive,
|
||||
$class,
|
||||
];
|
||||
|
|
|
@ -115,20 +115,6 @@ class PlayerSkins extends PluginAbstract {
|
|||
$htmlMediaTag .= "<!-- Video Link {$video['title']} {$video['filename']} --><source src='{$url}' type='" . ((strpos($video['videoLink'], 'm3u8') !== false) ? "application/x-mpegURL" : "video/mp4") . "' >";
|
||||
$html .= "<script>$(document).ready(function () {\$('time.duration').hide();});</script>";
|
||||
}
|
||||
/*
|
||||
if (AVideoPlugin::isEnabledByName('SubtitleSwitcher') && function_exists('getVTTTracks')) {
|
||||
$htmlMediaTag .= "<!-- getVTTTracks 1 -->";
|
||||
$htmlMediaTag .= getVTTTracks($video['filename']);
|
||||
}else{
|
||||
if(!AVideoPlugin::isEnabledByName('SubtitleSwitcher')){
|
||||
$htmlMediaTag .= "<!-- SubtitleSwitcher disabled -->";
|
||||
}
|
||||
if(!function_exists('getVTTTracks')){
|
||||
$htmlMediaTag .= "<!-- getVTTTracks not found -->";
|
||||
}
|
||||
}
|
||||
*
|
||||
*/
|
||||
$htmlMediaTag .= '<p>' . __("If you can't view this video, your browser does not support HTML5 videos") . '</p><p class="vjs-no-js">' . __("To view this video please enable JavaScript, and consider upgrading to a web browser that") . '<a href="http://videojs.com/html5-video-support/" target="_blank" rel="noopener noreferrer">supports HTML5 video</a></p></video>';
|
||||
} else if ($vType == 'audio') {
|
||||
$htmlMediaTag = '<audio ' . self::getPlaysinline() . '
|
||||
|
@ -491,107 +477,56 @@ class PlayerSkins extends PluginAbstract {
|
|||
$prepareStartPlayerJS_getDataSetup = array();
|
||||
}
|
||||
if (empty($noReadyFunction)) {
|
||||
$js .= "var originalVideo;
|
||||
var adTagOptions;
|
||||
var _adTagUrl = '{$IMAADTag}'; var player; "
|
||||
. "$(document).ready(function () {";
|
||||
$js .= "var originalVideo;";
|
||||
$js .= "var currentTime = $currentTime;";
|
||||
$js .= "var adTagOptions = {};";
|
||||
$js .= "var _adTagUrl = '{$IMAADTag}'; var player; ";
|
||||
$js .= "var startEvent = 'click';";
|
||||
}
|
||||
$js .= "$(document).ready(function () {";
|
||||
$js .= "
|
||||
originalVideo = $('#mainVideo').clone();
|
||||
/* prepareStartPlayerJS_onPlayerReady = " . count($prepareStartPlayerJS_onPlayerReady) . ", prepareStartPlayerJS_getDataSetup = " . count($prepareStartPlayerJS_getDataSetup) . " */
|
||||
if (typeof player === 'undefined' && $('#mainVideo').length) {
|
||||
player = videojs('mainVideo'" . (self::getDataSetup(implode(" ", $prepareStartPlayerJS_getDataSetup))) . ");
|
||||
";
|
||||
player = videojs('mainVideo'" . (self::getDataSetup(implode(" ", $prepareStartPlayerJS_getDataSetup))) . ");";
|
||||
if (!empty($IMAADTag) && isVideoPlayerHasProgressBar()) {
|
||||
$js .= "adTagOptions = {"
|
||||
. "id: 'mainVideo', "
|
||||
. "adTagUrl: '{$IMAADTag}', "
|
||||
. "debug: true, "
|
||||
. "/*useStyledLinearAds: false,*/"
|
||||
. "/*useStyledNonLinearAds: true,*/"
|
||||
. "forceNonLinearFullSlot: true, "
|
||||
. "/*adLabel: 'Advertisement',*/ "
|
||||
. "/*autoPlayAdBreaks:false,*/"
|
||||
. "}; "
|
||||
. "player.ima(adTagOptions);";
|
||||
$js .= "setInterval(function(){ fixAdSize(); }, 300);
|
||||
// first time it's clicked.
|
||||
var startEvent = 'click';";
|
||||
$adTagOptions = array(
|
||||
'id' => 'mainVideo',
|
||||
'adTagUrl' => $IMAADTag,
|
||||
'debug' => true,
|
||||
// 'useStyledLinearAds' => false,
|
||||
// 'useStyledNonLinearAds' => true,
|
||||
'forceNonLinearFullSlot' => true,
|
||||
'adLabel' => __('Advertisement'),
|
||||
// 'autoPlayAdBreaks' => false,
|
||||
);
|
||||
$js .= PHP_EOL."adTagOptions = " . json_encode($adTagOptions) . ";".PHP_EOL;
|
||||
$js .= "player.ima(adTagOptions);";
|
||||
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');
|
||||
$js .= file_get_contents($global['systemRootPath'].'plugin/PlayerSkins/events/playerAdsEventsMobile.js').PHP_EOL;
|
||||
}
|
||||
$js .= file_get_contents($global['systemRootPath'].'plugin/PlayerSkins/events/playerAdsEvents.js').PHP_EOL;
|
||||
}
|
||||
$js .= "};".PHP_EOL;
|
||||
|
||||
// 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('adsready');
|
||||
player.ima.setAdBreakReadyListener(function(e) {
|
||||
if(!_adWasPlayed){
|
||||
console.log('ADs !_adWasPlayed player.ima.playAdBreak();',e);
|
||||
//player.ima.requestAds();
|
||||
player.on('play', function () {
|
||||
if(!_adWasPlayed){
|
||||
player.ima.playAdBreak();
|
||||
_adWasPlayed = 1;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
console.log('ADs _adWasPlayed player.ima.playAdBreak();',e);
|
||||
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-loader', function (a) {
|
||||
console.log('ads-loader', a);
|
||||
});player.on('ads-request', function (a) {
|
||||
console.log('ads-request', a);
|
||||
});player.one(startEvent, function () {player.ima.initializeAdDisplayContainer();});";
|
||||
}
|
||||
$js .= "}";
|
||||
|
||||
$js .= "if(typeof player !== 'undefined'){";
|
||||
$js .= "player.ready(function () {console.log('player.ready');";
|
||||
$js .= "player.on('error', () => {AvideoJSError(player.error().code);});";
|
||||
$js .= PHP_EOL."if(typeof player !== 'undefined'){";
|
||||
$js .= file_get_contents($global['systemRootPath'].'plugin/PlayerSkins/events/playerReady.js');
|
||||
|
||||
// this is here because for some reason videos on the storage only works if it loads dinamically on android devices only
|
||||
if (isMobile()) {
|
||||
$js .= "player.src(player.currentSources());";
|
||||
$js .= file_get_contents($global['systemRootPath'].'plugin/PlayerSkins/events/playerReadyMobile.js');
|
||||
}
|
||||
if (empty($_REQUEST['mute'])) {
|
||||
$play = "playerPlayIfAutoPlay({$currentTime});";
|
||||
$js .= "player.persistvolume({namespace: 'AVideo'});";
|
||||
$js .= file_get_contents($global['systemRootPath'].'plugin/PlayerSkins/events/playerReadyUnmuted.js');
|
||||
} else {
|
||||
$play = "player.volume(0);player.muted(true);playerPlayMutedIfAutoPlay({$currentTime});";
|
||||
$js .= file_get_contents($global['systemRootPath'].'plugin/PlayerSkins/events/playerReadyMuted.js');
|
||||
}
|
||||
|
||||
$js .= "try {
|
||||
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)'});
|
||||
}} catch (e) {
|
||||
console.error('error-display', e);
|
||||
};";
|
||||
$js .= "try {";
|
||||
$js .= "player.ready(function () {";
|
||||
$js .= " try {";
|
||||
$js .= implode(' } catch (e) {console.error(\'onPlayerReady\', e);};try { ', $prepareStartPlayerJS_onPlayerReady) . ";";
|
||||
$js .= " } catch (e) {console.error('onPlayerReady', e);}";
|
||||
$js .= $play;
|
||||
$js .= " } catch (e) {";
|
||||
$js .= " console.error('onPlayerReady', e);";
|
||||
$js .= " }";
|
||||
$js .= "});";
|
||||
|
||||
if ($obj->showLoopButton && isVideoPlayerHasProgressBar()) {
|
||||
|
@ -600,10 +535,8 @@ class PlayerSkins extends PluginAbstract {
|
|||
$js .= file_get_contents($global['systemRootPath'] . 'plugin/PlayerSkins/fixCurrentSources.js');
|
||||
|
||||
$js .= "}";
|
||||
if (empty($noReadyFunction)) {
|
||||
$js .= "});";
|
||||
}
|
||||
|
||||
$js .= "});";
|
||||
//var_dump('getStartPlayerJSWasRequested', debug_backtrace());
|
||||
$getStartPlayerJSWasRequested = true;
|
||||
return $js;
|
||||
|
|
32
plugin/PlayerSkins/events/playerAdsEvents.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
setInterval(function () { fixAdSize(); }, 300);
|
||||
player.on('adsready', function () {
|
||||
console.log('adsready');
|
||||
player.ima.setAdBreakReadyListener(function (e) {
|
||||
if (!_adWasPlayed) {
|
||||
console.log('ADs !_adWasPlayed player.ima.playAdBreak();', e);
|
||||
//player.ima.requestAds();
|
||||
player.on('play', function () {
|
||||
if (!_adWasPlayed) {
|
||||
player.ima.playAdBreak();
|
||||
_adWasPlayed = 1;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log('ADs _adWasPlayed player.ima.playAdBreak();', e);
|
||||
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-loader', function (a) {
|
||||
console.log('ads-loader', a);
|
||||
});
|
||||
player.on('ads-request', function (a) {
|
||||
console.log('ads-request', a);
|
||||
});
|
||||
player.one(startEvent, function () { player.ima.initializeAdDisplayContainer(); });
|
15
plugin/PlayerSkins/events/playerAdsEventsMobile.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
// 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';
|
||||
}
|
22
plugin/PlayerSkins/events/playerReady.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
player.ready(function () {
|
||||
console.log('player.ready');
|
||||
player.on('error', () => { AvideoJSError(player.error().code); });
|
||||
try {
|
||||
var err = this.error();
|
||||
if (err && err.code) {
|
||||
$('.vjs-error-display').hide();
|
||||
$('#mainVideo').find('.vjs-poster').css({ 'background-image': 'url(' + webSiteRootURL + 'plugin/Live/view/Offline.jpg)' });
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('error-display', e);
|
||||
}
|
||||
setTimeout(() => {
|
||||
$('.vjs-menu-item').on('click', function() {
|
||||
// Remove vjs-selected class from all chapter menu items
|
||||
$(this).parent().find('.vjs-menu-item').removeClass('vjs-selected');
|
||||
|
||||
// Add vjs-selected class back to the clicked chapter
|
||||
$(this).addClass('vjs-selected');
|
||||
});
|
||||
}, 2000);
|
||||
});
|
3
plugin/PlayerSkins/events/playerReadyMobile.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
player.ready(function () {
|
||||
player.src(player.currentSources());
|
||||
});
|
5
plugin/PlayerSkins/events/playerReadyMuted.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
player.ready(function () {
|
||||
player.volume(0);
|
||||
player.muted(true);
|
||||
playerPlayMutedIfAutoPlay(currentTime);
|
||||
});
|
4
plugin/PlayerSkins/events/playerReadyUnmuted.js
Normal file
|
@ -0,0 +1,4 @@
|
|||
player.ready(function () {
|
||||
playerPlayIfAutoPlay(currentTime);
|
||||
player.persistvolume({ namespace: 'AVideo' });
|
||||
});
|
|
@ -20,3 +20,11 @@ function startAudioSpectrumProgress(spectrumImage) {
|
|||
setTimeout(function(){startAudioSpectrumProgress(spectrumImage);},500);
|
||||
}
|
||||
}
|
||||
|
||||
function appendOnPlayer(element){
|
||||
if (typeof player !== 'undefined') {
|
||||
$(element).insertBefore($(player.el()).find('.vjs-control-bar'));
|
||||
} else {
|
||||
setTimeout(function () { appendOnPlayer(element); }, 1000);
|
||||
}
|
||||
}
|
|
@ -145,8 +145,6 @@ class IP2Location extends ObjectYPT {
|
|||
}
|
||||
$content = json_encode($rows);
|
||||
file_put_contents($cachefile, $content);
|
||||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
} else {
|
||||
$content = file_get_contents($cachefile);
|
||||
|
@ -181,8 +179,6 @@ class IP2Location extends ObjectYPT {
|
|||
}
|
||||
$content = json_encode($rows);
|
||||
file_put_contents($cachefile, $content);
|
||||
} else {
|
||||
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
|
||||
}
|
||||
} else {
|
||||
$content = file_get_contents($cachefile);
|
||||
|
|
|
@ -42,6 +42,7 @@ class VideoTags extends PluginAbstract {
|
|||
$obj->maxTags = 100;
|
||||
$obj->maxChars = 100;
|
||||
$obj->disableTagsSubscriptions = false;
|
||||
$obj->showTagsOnEmbed = true;
|
||||
return $obj;
|
||||
}
|
||||
|
||||
|
@ -378,7 +379,7 @@ $(\'#inputTags' . $tagTypesId . '\').tagsinput({
|
|||
return $users;
|
||||
}
|
||||
|
||||
static function getLabels($videos_id, $showType = true) {
|
||||
static function getLabels($videos_id, $showType = true, $showSubscription = true) {
|
||||
global $global;
|
||||
|
||||
$currentPage = getCurrentPage();
|
||||
|
@ -400,7 +401,7 @@ $(\'#inputTags' . $tagTypesId . '\').tagsinput({
|
|||
if (empty($value['name']) || $value['name'] === '-') {
|
||||
continue;
|
||||
}
|
||||
if($obj->disableTagsSubscriptions){
|
||||
if($obj->disableTagsSubscriptions || empty($showSubscription)){
|
||||
$strT .= self::getTagHTMLLink($value['tags_id'], $value['total']);
|
||||
}else{
|
||||
$strT .= self::getButton($value['tags_id'], $videos_id);
|
||||
|
@ -492,7 +493,20 @@ $(\'#inputTags' . $tagTypesId . '\').tagsinput({
|
|||
return $css;
|
||||
}
|
||||
public function getFooterCode(){
|
||||
$js = '<script src="' .getURL('plugin/VideoTags/View/script.js') . '" type="text/javascript"></script>';
|
||||
$js = '';
|
||||
$obj = AVideoPlugin::getDataObject('VideoTags');
|
||||
if($obj->showTagsOnEmbed && isEmbed() && isVideo()){
|
||||
$videos_id = getVideos_id();
|
||||
if(!empty($videos_id)){
|
||||
$labels = self::getLabels($videos_id, true, false);
|
||||
//var_dump($labels);exit;
|
||||
if(!empty($labels)){
|
||||
$js .= '<script>videoTagsLabels = '.json_encode($labels).';</script>';
|
||||
}
|
||||
}
|
||||
}
|
||||
//var_dump($js);exit;
|
||||
$js .= '<script src="' .getURL('plugin/VideoTags/View/script.js') . '" type="text/javascript"></script>';
|
||||
return $js;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
function toogleTagSubscribe(encryptedIdAndUser, notify) {
|
||||
var data = {encryptedIdAndUser: encryptedIdAndUser, notify:notify};
|
||||
var data = { encryptedIdAndUser: encryptedIdAndUser, notify: notify };
|
||||
var url = webSiteRootURL + 'plugin/VideoTags/subscribe.json.php';
|
||||
modal.showPleaseWait();
|
||||
$.ajax({
|
||||
|
@ -27,3 +27,17 @@ function toogleTagSubscribe(encryptedIdAndUser, notify) {
|
|||
}
|
||||
});
|
||||
}
|
||||
function loadVideoTagsLabels() {
|
||||
if (typeof videoTagsLabels !== 'undefined') {
|
||||
var videoTagsLabelsElement = $('<div>' + videoTagsLabels + '</div>');
|
||||
videoTagsLabelsElement.addClass('hideOnPlayerUserInactive');
|
||||
videoTagsLabelsElement.addClass('pull-right');
|
||||
videoTagsLabelsElement.addClass('videoTagsLabelsElement');
|
||||
appendOnPlayer(videoTagsLabelsElement);
|
||||
} else {
|
||||
setTimeout(function () { loadVideoTagsLabels(); }, 1000);
|
||||
}
|
||||
}
|
||||
$(function () {
|
||||
loadVideoTagsLabels();
|
||||
})
|
|
@ -38,3 +38,18 @@ div.mainAreaTags .btn-link b{
|
|||
div.mainAreaTags .btn-link{
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#mainVideo .videoTagsLabelsElement{
|
||||
position: fixed;
|
||||
right: 10px;
|
||||
bottom: 100px;
|
||||
}
|
||||
|
||||
#mainVideo .videoTagsLabelsElement > div.text-muted{
|
||||
margin: 15px;
|
||||
}
|
||||
|
||||
|
||||
#mainVideo .videoTagsLabelsElement strong.label.text-muted{
|
||||
display: none;
|
||||
}
|
|
@ -10,7 +10,7 @@ if ($obj->BigVideo && empty($_GET['showOnly'])) {
|
|||
if (empty($video)) {
|
||||
?>
|
||||
<center>
|
||||
<img src="<?php echo $global['webSiteRootURL']; ?>view/img/this-video-is-not-available.jpg">
|
||||
<img src="<?php echo getURL('view/img/this-video-is-not-available.jpg'); ?>">
|
||||
</center>
|
||||
<?php
|
||||
} else {
|
||||
|
@ -45,15 +45,16 @@ if ($obj->BigVideo && empty($_GET['showOnly'])) {
|
|||
} else {
|
||||
$percent = 40;
|
||||
}
|
||||
$style = "
|
||||
padding: 60px 20px 56.25% 20px;
|
||||
background: -webkit-linear-gradient(left, rgba({$obj->backgroundRGB},1) {$percent}%, rgba({$obj->backgroundRGB},0) 100%);
|
||||
background: -o-linear-gradient(right, rgba({$obj->backgroundRGB},1) {$percent}%, rgba({$obj->backgroundRGB},0) 100%);
|
||||
background: linear-gradient(right, rgba({$obj->backgroundRGB},1) {$percent}%, rgba({$obj->backgroundRGB},0) 100%);
|
||||
background: -moz-linear-gradient(to right, rgba({$obj->backgroundRGB},1) {$percent}%, rgba({$obj->backgroundRGB},0) 100%);
|
||||
";
|
||||
?>
|
||||
|
||||
<div class="posterDetails" style="
|
||||
padding: 60px 20px 56.25% 20px;
|
||||
background: -webkit-linear-gradient(left, rgba(<?php echo $obj->backgroundRGB; ?>,1) <?php echo $percent; ?>%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: -o-linear-gradient(right, rgba(<?php echo $obj->backgroundRGB; ?>,1) <?php echo $percent; ?>%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: linear-gradient(right, rgba(<?php echo $obj->backgroundRGB; ?>,1) <?php echo $percent; ?>%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
background: -moz-linear-gradient(to right, rgba(<?php echo $obj->backgroundRGB; ?>,1) <?php echo $percent; ?>%, rgba(<?php echo $obj->backgroundRGB; ?>,0) 100%);
|
||||
">
|
||||
<div class="posterDetails" style="<?php echo $style; ?>">
|
||||
<?php
|
||||
include $global['systemRootPath'] . 'plugin/YouPHPFlix2/view/BigVideoInfoDetails.php';
|
||||
?>
|
||||
|
|
|
@ -50,6 +50,10 @@ TimeLogStart($timeLog3);
|
|||
$img = $images->posterPortraitThumbs;
|
||||
$cssClass = "posterPortrait";
|
||||
}
|
||||
|
||||
if(ImagesPlaceHolders::isDefaultImage($img)){
|
||||
$cssClass .= ' ImagesPlaceHoldersDefaultImage';
|
||||
}
|
||||
?>
|
||||
<div class="carousel-cell" >
|
||||
<div class="tile">
|
||||
|
@ -62,9 +66,9 @@ TimeLogStart($timeLog3);
|
|||
iframe="<?php echo $global['webSiteRootURL']; ?>videoEmbed/<?php echo $value['clean_title']; ?>"
|
||||
ajaxLoad="<?php echo $ajaxLoad; ?>">
|
||||
<div class="tile__media ">
|
||||
<img alt="<?php echo $value['title']; ?>" src="<?php echo $global['webSiteRootURL']; ?>view/img/placeholder-image.png" class="tile__img <?php echo $cssClass; ?> thumbsJPG img img-responsive carousel-cell-image" data-flickity-lazyload="<?php echo $img; ?>" />
|
||||
<img alt="<?php echo $value['title']; ?>" src="<?php echo ImagesPlaceHolders::getImageLandscape(ImagesPlaceHolders::$RETURN_URL); ?>" class="tile__img <?php echo $cssClass; ?> thumbsJPG img img-responsive carousel-cell-image" data-flickity-lazyload="<?php echo $img; ?>" />
|
||||
<?php if (!empty($imgGif)) { ?>
|
||||
<img style="position: absolute; top: 0; display: none;" src="<?php echo $global['webSiteRootURL']; ?>view/img/placeholder-image.png" alt="<?php echo $value['title']; ?>" id="tile__img thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive img carousel-cell-image" data-flickity-lazyload="<?php echo $imgGif; ?>" />
|
||||
<img style="position: absolute; top: 0; display: none;" src="<?php echo ImagesPlaceHolders::getImageLandscape(ImagesPlaceHolders::$RETURN_URL); ?>" alt="<?php echo $value['title']; ?>" id="tile__img thumbsGIF<?php echo $value['id']; ?>" class="thumbsGIF img-responsive img carousel-cell-image" data-flickity-lazyload="<?php echo $imgGif; ?>" />
|
||||
<?php } ?>
|
||||
<?php
|
||||
if ($advancedCustom->paidOnlyShowLabels && $obj->paidOnlyLabelOverPoster) {
|
||||
|
|
|
@ -65,7 +65,7 @@ TimeLogStart($timeLog6);
|
|||
</div>
|
||||
<div class="row">
|
||||
<?php
|
||||
if (!empty($images->posterPortrait) && basename($images->posterPortrait) !== 'notfound_portrait.jpg' && basename($images->posterPortrait) !== 'pdf_portrait.png' && basename($images->posterPortrait) !== 'article_portrait.png') {
|
||||
if (!empty($images->posterPortrait) && !ImagesPlaceHolders::isDefaultImage($images->posterPortrait)) {
|
||||
?>
|
||||
<!-- row video 1 -->
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
|
@ -74,7 +74,7 @@ TimeLogStart($timeLog6);
|
|||
</center>
|
||||
</div>
|
||||
<?php
|
||||
} else if (!empty($images->poster) && basename($images->poster) !== 'notfound.jpg' && basename($images->poster) !== 'pdf.png' && basename($images->poster) !== 'article.png') {
|
||||
} else if (!empty($images->poster) && !ImagesPlaceHolders::isDefaultImage($images->poster)) {
|
||||
?>
|
||||
<!-- row video 2 -->
|
||||
<div class="col-md-2 col-sm-3 col-xs-4 hidden-xs">
|
||||
|
|
|
@ -2018,6 +2018,19 @@ body.ypt-is-compressed #videoCol {
|
|||
display: none !important;
|
||||
}
|
||||
|
||||
.ImagesPlaceHoldersDefaultImage {
|
||||
filter: grayscale(100%);
|
||||
background-color: rgba(128, 128, 128, 0.25); /* This is the grey background with 80% transparency */
|
||||
transition: filter 0.3s ease, background-color 0.3s ease; /* This ensures a smooth transition effect */
|
||||
}
|
||||
|
||||
.thumbsImageContainer:hover .ImagesPlaceHoldersDefaultImage,
|
||||
.ImagesPlaceHoldersDefaultImage:hover {
|
||||
filter: grayscale(0%);
|
||||
background-color: rgba(128, 128, 128, 0.5); /* This is the grey background with 50% transparency on hover */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
#_avideoPageLoader{
|
||||
display: none !important;
|
||||
|
|
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 173 KiB |
Before Width: | Height: | Size: 173 KiB |
Before Width: | Height: | Size: 173 KiB |
Before Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 16 KiB |
|
@ -8,7 +8,7 @@ require_once $configFile;
|
|||
session_write_close();
|
||||
|
||||
// Default image settings
|
||||
$file = 'video-placeholder-gray.png';
|
||||
$file = ImagesPlaceHolders::getVideoPlaceholder(ImagesPlaceHolders::$RETURN_PATH);
|
||||
$type = 'image/png';
|
||||
|
||||
// Fetch requested image URL
|
||||
|
@ -59,7 +59,7 @@ if (preg_match('/videos\/(.*\/)?(.*)_thumbs(V2)?.jpg/', $imageURL, $matches)) {
|
|||
}
|
||||
|
||||
// If a 404 image needs to be shown, redirect to it
|
||||
if ($file === 'video-placeholder-gray.png' && empty($_GET['notFound'])) {
|
||||
if (empty($_GET['notFound']) && ImagesPlaceHolders::isDefaultImage($file)) {
|
||||
header("Location: " . getCDN() . "view/img/image404.php?notFound=1");
|
||||
exit;
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 28 KiB |
BIN
view/img/mp3.png
Before Width: | Height: | Size: 315 KiB |
Before Width: | Height: | Size: 2 MiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 901 KiB |
BIN
view/img/pdf.png
Before Width: | Height: | Size: 53 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 8.6 KiB |
BIN
view/img/placeholders/articles.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
view/img/placeholders/articlesLandscape.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
view/img/placeholders/articlesPortrait.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
view/img/placeholders/audio.png
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
view/img/placeholders/audioLandscape.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
view/img/placeholders/audioPortrait.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
view/img/placeholders/image.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
view/img/placeholders/imageLandscape.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
view/img/placeholders/imageNotFound.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
view/img/placeholders/imageNotFoundLandscape.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
view/img/placeholders/imageNotFoundPortrait.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
view/img/placeholders/imagePortrait.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
view/img/placeholders/pdf.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
view/img/placeholders/pdfLandscape.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
view/img/placeholders/pdfPortrait.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
view/img/placeholders/user.png
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
view/img/placeholders/userLandscape.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
view/img/placeholders/userPortrait.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
view/img/placeholders/zip.png
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
view/img/placeholders/zipLandscape.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
view/img/placeholders/zipPortrait.png
Normal file
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 783 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 252 KiB |
Before Width: | Height: | Size: 524 KiB |
BIN
view/img/this-video-is-not-available_jpg.webp
Normal file
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 16 KiB |
BIN
view/img/video-placeholder-gray-portrait.png
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 6.2 KiB |
BIN
view/img/zip.png
Before Width: | Height: | Size: 22 KiB |