';
case Video::$videoTypePdf:
case Video::$videoTypeArticle:
return '';
default:
// Add more cases as needed
return '';
}
}
function getMetaTagsContentVideoType($sourceFileURL)
{
if (preg_match('/\.m3u8/', $sourceFileURL)) {
return "application/x-mpegURL";
}
return "video/mp4";
}
function generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, $extraMetatags = array(), $canonicalURL='')
{
global $global, $config, $advancedCustom;
$ogType = determineOgType($videoType);
$title = str_replace('"', '', $title);
$description = str_replace('"', '', $description);
if (empty($customizePluginDescription)) {
if (AVideoPlugin::isEnabledByName('Customize')) {
$ec = new ExtraConfig();
$customizePluginDescription = $ec->getDescription();
}
}
if (empty($description)) {
if (empty($description)) {
$description = $title;
}
if (!empty($customizePluginDescription)) {
$metaTags[] = "";
$description = $customizePluginDescription;
} elseif (!empty($metaDescription)) {
$metaTags[] = "";
$description = $metaDescription;
}
}
$description = getSEODescription($description);
$metaTags = array();
$metaTags[] = '';
$metaTags[] = '';
if (preg_match('/\.m3u8/', $sourceFileURL)) {
$metaTags[] = '';;
} else if (!empty($videoType)) {
$metaTags[] = getMetaTagsContentType($videoType);
}
if (!empty($modifiedDate)) {
$metaTags[] = '';
$metaTags[] = '';
}
if (!empty($createdDate)) {
$metaTags[] = '';
}
$metaTags[] = '';
if (!empty($duration_in_seconds)) {
$metaTags[] = '';
}
if (!empty($imgURL)) {
$metaTags[] = "";
$metaTags[] = "";
$metaTags[] = "";
$metaTags[] = "";
$type = 'image/jpeg';
$imgw = 1024;
$imgh = 768;
if (!empty($imgPath)) {
$imgSize = @getimgsize($imgPath);
if ($imgSize) {
$imgw = $imgSize[0];
$imgh = $imgSize[1];
$type = $imgSize['mime'];
}
}
$metaTags[] = "";
$metaTags[] = "";
$metaTags[] = "";
}
$metaTags[] = "";
if ($title) {
$title = getSEOTitle(html2plainText($title));
$metaTags[] = "";
$metaTags[] = "";
}
if ($description) {
$metaTags[] = "";
$metaTags[] = "";
}
if ($pageURL) {
$metaTags[] = "";
$metaTags[] = "";
if(empty($canonicalURL)){
$canonicalURL = $pageURL;
}
}
if(!empty($canonicalURL)){
$metaTags[] = "";
}
if (!empty($advancedCustom->fb_app_id)) {
$metaTags[] = "";
}
$SecureVideosDirectoryIsEnabled = AVideoPlugin::isEnabledByName("SecureVideosDirectory");
if (!$SecureVideosDirectoryIsEnabled && !empty($sourceFileURL)) {
$metaTags[] = "";
$metaTags[] = "";
$metaTags[] = '';
$metaTags[] = '';
$metaTags[] = '';
} else {
if ($SecureVideosDirectoryIsEnabled) {
$metaTags[] = '';
}
if (empty($sourceFileURL)) {
$metaTags[] = '';
}
if (empty($pageURL)) {
$metaTags[] = '';
}
$metaTags[] = "";
$metaTags[] = "";
}
if (!empty($advancedCustom->twitter_player) && !empty($pageURLEmbed)) {
$metaTags[] = '';
$metaTags[] = "";
if (!$SecureVideosDirectoryIsEnabled && !empty($sourceFileURL)) {
$metaTags[] = '';
$metaTags[] = '';
$metaTags[] = '';
$metaTags[] = '';
} else {
$metaTags[] = '';
$metaTags[] = '';
}
} else {
if (!empty($advancedCustom->twitter_summary_large_image)) {
$metaTags[] = '';
} else {
$metaTags[] = '';
}
}
if (!empty($advancedCustom->twitter_site)) {
$metaTags[] = "twitter_site}\" />";
}
$metaTags = array_merge($metaTags, $extraMetatags);
return implode(PHP_EOL, $metaTags);
}
function getOpenGraphTag($tags_id)
{
global $global, $config, $advancedCustom;
$tag = new Tags($tags_id);
echo PHP_EOL . "" . PHP_EOL;
$videoType = '';
$modifiedDate = '';
$createdDate = '';
$title = $tag->getName();
$description = '';
$duration_in_seconds = 0;
$sourceFileURL = '';
$pageURL = VideoTags::getTagLink($tags_id);
$pageURLEmbed = '';
$imgURL = Configuration::getOGImage();
$imgPath = Configuration::getOGImagePath();
$extraMetatags = array('');
//var_dump(debug_backtrace());
return generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, $extraMetatags);
}
function getOpenGraphCategory($categories_id)
{
global $global, $config, $advancedCustom;
echo PHP_EOL . "" . PHP_EOL;
$cat = new Category($categories_id);
$videoType = '';
$modifiedDate = '';
$createdDate = '';
$title = $cat->getName();
$description = '';
$duration_in_seconds = 0;
$sourceFileURL = '';
$pageURL = $cat->getLink();
$pageURLEmbed = '';
$imgURL = Configuration::getOGImage();
$imgPath = Configuration::getOGImagePath();
$extraMetatags = array('');
//var_dump(debug_backtrace());
return generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, $extraMetatags);
}
function getOpenGraphChannel($users_id)
{
global $global, $config, $advancedCustom;
echo PHP_EOL . "" . PHP_EOL;
$videoType = '';
$modifiedDate = '';
$createdDate = '';
$title = User::getNameIdentificationById($users_id);
$description = '';
$duration_in_seconds = 0;
$sourceFileURL = '';
$pageURL = User::getChannelLink($users_id);
$pageURLEmbed = '';
$imgURL = User::getOGImage($users_id);
$imgPath = User::getOGImagePath($users_id);
$extraMetatags = array('', '');
//var_dump(debug_backtrace());
return generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, $extraMetatags);
}
function getOpenGraphSite()
{
global $global, $config, $advancedCustom;
echo PHP_EOL . "" . PHP_EOL;
$videoType = '';
$modifiedDate = '';
$createdDate = '';
$title = $config->getWebSiteTitle();
$description = '';
$duration_in_seconds = 0;
$sourceFileURL = '';
$pageURL = $global['webSiteRootURL'];
$pageURLEmbed = '';
$imgURL = Configuration::getOGImage();
$imgPath = Configuration::getOGImagePath();
$extraMetatags = array('');
//var_dump(debug_backtrace());
return generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, $extraMetatags);
}
function getOpenGraphVideo($videos_id)
{
global $global, $config, $advancedCustom;
$video = Video::getVideoLight($videos_id);
$canonicalURL = '';
if (!empty($_REQUEST['playlists_id'])) {
echo PHP_EOL . "" . PHP_EOL;
$pageURL = PlayLists::getLink($_REQUEST['playlists_id'], false, @$_REQUEST['playlist_index']);
$pageURLEmbed = PlayLists::getLink($_REQUEST['playlists_id'], true, @$_REQUEST['playlist_index']);
} else if (!empty($_REQUEST['tags_id']) && isset($_REQUEST['playlist_index'])) {
echo PHP_EOL . "" . PHP_EOL;
$pageURL = PlayLists::getTagLink($_REQUEST['tags_id'], false, @$_REQUEST['playlist_index']);
$pageURLEmbed = PlayLists::getTagLink($_REQUEST['tags_id'], true, @$_REQUEST['playlist_index']);
} else {
echo PHP_EOL . "" . PHP_EOL;
$pageURL = Video::getLinkToVideo($videos_id, '', false, Video::$urlTypeShort, [], true);
$pageURLEmbed = Video::getLinkToVideo($videos_id, '', true, Video::$urlTypeShort, [], true);
$canonicalURL = Video::getCanonicalLink($videos_id);
}
$sourceFileURL = '';
$source = Video::getHigestResolution($video['filename']);
if (empty($source['url'])) {
if (CustomizeUser::canDownloadVideos()) {
echo "";
}
if (empty($source['url'])) {
echo "";
}
} else {
$source['url'] = str_replace(".m3u8", ".m3u8.mp4", $source['url']);
$sourceFileURL = $source['url'];
}
$videoType = $video['type'];
$modifiedDate = $video['modified'];
$createdDate = $video['created'];
$title = $video['title'];
$description = $video['description'];
$duration_in_seconds = $video['duration_in_seconds'];
$imgURL = '';
$imgPath = '';
$images = Video::getImageFromFilename($video['filename']);
if (!isImageNotFound($images->posterPortraitThumbs)) {
$imgURL = $images->posterPortraitThumbs;
$imgPath = $images->posterPortraitPath;
} else if (!isImageNotFound($images->posterPortrait)) {
$imgURL = $images->posterPortrait;
$imgPath = $images->posterPortraitPath;
}
if (!isImageNotFound($images->posterLandscapeThumbs)) {
$imgURL = $images->posterLandscapeThumbs;
$imgPath = $images->posterLandscapePath;
} else if (!isImageNotFound($images->posterLandscape)) {
$imgURL = $images->posterLandscape;
$imgPath = $images->posterLandscapePath;
} else {
$imgURL = $images->posterPortrait;
$imgPath = $images->posterPortraitPath;
}
//var_dump(debug_backtrace());
return generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, array(), $canonicalURL);
}
function getOpenGraphLiveLink($liveLink_id)
{
global $global, $config, $advancedCustom;
$liveLink = new LiveLinksTable($liveLink_id);
echo PHP_EOL . "" . PHP_EOL;
$videoType = '';
$modifiedDate = '';
$createdDate = '';
$title = $liveLink->getTitle();
$description = '';
$duration_in_seconds = 0;
$sourceFileURL = $liveLink->getLink();
$pageURL = LiveLinks::getLinkToLiveFromId($liveLink_id);
$pageURLEmbed = LiveLinks::getLinkToLiveFromId($liveLink_id, true);
$imgURL = LiveLinks::getImageDafaultOrDynamic($liveLink_id);
$imgPath = '';
$extraMetatags = array();
//var_dump(debug_backtrace());
return generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, $extraMetatags);
}
function getOpenGraphLiveSchedule($live_schedule_id)
{
global $global, $config, $advancedCustom;
$liveS = new Live_schedule($live_schedule_id);
echo PHP_EOL . "" . PHP_EOL;
$videoType = '';
$modifiedDate = '';
$createdDate = '';
$title = $liveS->getTitle();
$description = '';
$duration_in_seconds = 0;
$poster = Live_schedule::getPosterURL($live_schedule_id, 0);
$liveStreamObject = new LiveStreamObject($liveS->getKey(), $liveS->getLive_servers_id(), 0, 0, @$_REQUEST['live_schedule']);
$sourceFileURL = $liveStreamObject->getM3U8(true);
$pageURL = $liveStreamObject->getURL();
$pageURLEmbed = $liveStreamObject->getURLEmbed();
$imgURL = getURL($poster);
$imgPath = $global['systemRootPath'] . $poster;
$extraMetatags = array();
//var_dump(debug_backtrace());
return generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, $extraMetatags);
}
function getOpenGraphLive()
{
global $global, $config, $advancedCustom;
$isLive = isLive();
$liveT = LiveTransmition::getFromKey($isLive['cleanKey']);
$users_id = $liveT['users_id'];
$poster = Live::getRegularPosterImage($users_id, $isLive['live_servers_id'], $isLive['live_schedule'], 0);
$liveStreamObject = new LiveStreamObject($isLive['cleanKey'], $isLive['live_servers_id'], $isLive['live_index'], 0);
echo PHP_EOL . "" . PHP_EOL;
$videoType = '';
$modifiedDate = '';
$createdDate = '';
$title = $liveT['title'];
if(empty($title)){
Live::getTitleFromUsers_Id($users_id);
}
if(empty($title)){
echo PHP_EOL . "" . PHP_EOL;
}
$description = $liveT['description'];
$duration_in_seconds = 0;
$sourceFileURL = $liveStreamObject->getM3U8(true);
$pageURL = $liveStreamObject->getURL();
$pageURLEmbed = $liveStreamObject->getURLEmbed();
$imgURL = getURL($poster);
$imgPath = $global['systemRootPath'] . $poster;
$extraMetatags = array();
//var_dump(debug_backtrace());
return generateMetaTags($videoType, $modifiedDate, $createdDate, $title, $description, $pageURL, $pageURLEmbed, $duration_in_seconds, $sourceFileURL, $imgPath, $imgURL, $extraMetatags);
}