url = ""; $o = new stdClass(); $o->type = array('center' => 'Center', 'top' => 'Top', 'bottom' => 'Bottom', 'top left' => 'Top Left', 'bottom left' => 'Bottom Left', 'top right' => 'Top Right', 'bottom right' => 'Bottom Right'); $o->value = 'top right'; $obj->position = $o; $obj->opacity = 50; $obj->useUserChannelImageAsLogo = true; return $obj; } public function getPluginVersion() { return "2.1"; } public function getPluginMenu() { global $global; $filename = $global['systemRootPath'] . 'plugin/VideoLogoOverlay/pluginMenu.html'; return file_get_contents($filename); } static function getStyle() { $obj = AVideoPlugin::getObjectData("VideoLogoOverlay"); $opacity = "opacity: " . ($obj->opacity / 100) . "; filter: alpha(opacity={$obj->opacity}); "; return $opacity; } static function getClass() { $obj = AVideoPlugin::getObjectData("VideoLogoOverlay"); $position = "VideoLogoOverlay"; switch ($obj->position->value) { case "center": $position .= " VideoLogoOverlay-Center"; break; case "top": $position .= " VideoLogoOverlay-Top"; break; case "bottom": $position .= " VideoLogoOverlay-Bottom"; break; case "top left": $position .= " VideoLogoOverlay-Top-Left"; break; case "bottom left": $position .= " VideoLogoOverlay-Bottom-Left"; break; case "top right": $position .= " VideoLogoOverlay-Top-Right"; break; case "bottom right": $position .= " VideoLogoOverlay-Bottom-Right"; break; } return $position; } static function getLink() { $obj = AVideoPlugin::getObjectData("VideoLogoOverlay"); if (!empty($obj->url)) { $url = $obj->url; } else { $url = "#"; } return $url; } function getFooterCode() { global $global; if (!isVideo() || isWebRTC()) { return ''; } $style = VideoLogoOverlay::getStyle(); $url = VideoLogoOverlay::getLink(); $class = VideoLogoOverlay::getClass(); $obj = AVideoPlugin::getObjectData("VideoLogoOverlay"); $logoOverlay = "{$global['webSiteRootURL']}videos/logoOverlay.png"; $html = ''; $js = ''; //$cols = "col-lg-12 col-md-8 col-sm-7 col-xs-6"; if ($obj->useUserChannelImageAsLogo) { $users_id = 0; if ($liveLink_id = isLiveLink()) { $js .= "/* VideoLogoOverlay livelink */"; $liveLink = new LiveLinksTable($liveLink_id); $users_id = $liveLink->getUsers_id(); } else if ($live = isLive()) { if(!empty($_REQUEST['live_schedule'])){ $js .= "/* VideoLogoOverlay live schedule {$_REQUEST['live_schedule']} */"; $ls = new Live_schedule($_REQUEST['live_schedule']); $users_id = $ls->getUsers_id(); }else{ $js .= "/* VideoLogoOverlay live */"; //$live = array('key' => false, 'live_servers_id' => false, 'live_index' => false); $lt = LiveTransmition::getFromKey($live['key']); $users_id = $lt['users_id']; } } else { $js .= "/* VideoLogoOverlay video */"; $videos_id = getVideos_id(); $video = Video::getVideoLight($videos_id); $users_id = $video['users_id']; } if (!empty($users_id)) { $logoOverlay = User::getPhoto($users_id); $url = User::getChannelLink($users_id); $class .= ' VideoLogoOverlay-User'; //$cols = "col-lg-12 col-md-8 col-sm-7 col-xs-6"; }else{ $js .= "/* VideoLogoOverlay empty users_id */"; } $js .= "/* VideoLogoOverlay users_id = {$users_id} */"; } $cols = ""; if (!empty($url)) { $class .= ' VideoLogoOverlay-URL'; } //$logoOverlay = "{$global['webSiteRootURL']}videos/logoOverlay.png"; $html .= '
'; $js .= "$('{$html}').appendTo('#mainVideo');"; PlayerSkins::addOnPlayerReady($js); } public function getHeadCode() { global $global; if (isWebRTC()) { return ''; } return ""; } }