mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 09:49:28 +02:00
Fix the mobile player
This commit is contained in:
parent
b3cb6b6fdb
commit
8d903d01af
1 changed files with 70 additions and 70 deletions
|
@ -1,70 +1,70 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
global $global;
|
global $global;
|
||||||
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
require_once $global['systemRootPath'] . 'plugin/Plugin.abstract.php';
|
||||||
|
|
||||||
class SeekButton extends PluginAbstract {
|
class SeekButton extends PluginAbstract {
|
||||||
|
|
||||||
public function getTags() {
|
public function getTags() {
|
||||||
return array(
|
return array(
|
||||||
PluginTags::$FREE,
|
PluginTags::$FREE,
|
||||||
PluginTags::$PLAYER,
|
PluginTags::$PLAYER,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public function getDescription() {
|
public function getDescription() {
|
||||||
return "Add seek buttons to the control bar";
|
return "Add seek buttons to the control bar";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName() {
|
public function getName() {
|
||||||
return "SeekButton";
|
return "SeekButton";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getUUID() {
|
public function getUUID() {
|
||||||
return "f5c30980-9530-4650-8eab-9ab461ea6fdb";
|
return "f5c30980-9530-4650-8eab-9ab461ea6fdb";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPluginVersion() {
|
public function getPluginVersion() {
|
||||||
return "1.1";
|
return "1.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEmptyDataObject() {
|
public function getEmptyDataObject() {
|
||||||
global $global;
|
global $global;
|
||||||
$obj = new stdClass();
|
$obj = new stdClass();
|
||||||
$obj->forward = 30;
|
$obj->forward = 30;
|
||||||
$obj->back = 10;
|
$obj->back = 10;
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHeadCode() {
|
public function getHeadCode() {
|
||||||
global $global;
|
global $global;
|
||||||
$css = "";
|
$css = "";
|
||||||
if (isVideoPlayerHasProgressBar()) {
|
if (isVideoPlayerHasProgressBar() && !isMobile()) {
|
||||||
$css = '<link href="' .getCDN() . 'plugin/SeekButton/videojs-seek-buttons/videojs-seek-buttons.css?'. filectime($global['systemRootPath'] . 'plugin/SeekButton/videojs-seek-buttons/videojs-seek-buttons.css').'" rel="stylesheet" type="text/css"/>';
|
$css = '<link href="' .getURL('plugin/SeekButton/videojs-seek-buttons/videojs-seek-buttons.css') .'" rel="stylesheet" type="text/css"/>';
|
||||||
$css .= '<link href="' .getCDN() . 'plugin/SeekButton/seek.css?'. filectime($global['systemRootPath'] . 'plugin/SeekButton/seek.css').'" rel="stylesheet" type="text/css"/>';
|
$css .= '<link href="' .getURL('plugin/SeekButton/seek.css') .'" rel="stylesheet" type="text/css"/>';
|
||||||
$css .= '<style>.video-js .vjs-seek-button {font-size: 25px;width: 2em !important;}</style>';
|
$css .= '<style>.video-js .vjs-seek-button {font-size: 25px;width: 2em !important;}</style>';
|
||||||
if(isMobile()){
|
if(isMobile()){
|
||||||
$css .= '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">';
|
$css .= '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $css;
|
return $css;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFooterCode() {
|
public function getFooterCode() {
|
||||||
global $global;
|
global $global;
|
||||||
if (isVideoPlayerHasProgressBar()) {
|
if (isVideoPlayerHasProgressBar() && !isMobile()) {
|
||||||
$obj = $this->getDataObject();
|
$obj = $this->getDataObject();
|
||||||
$js = "";
|
$js = "";
|
||||||
if (isVideoPlayerHasProgressBar()) {
|
if (isVideoPlayerHasProgressBar()) {
|
||||||
$js .= '<script src="' .getCDN() . 'plugin/SeekButton/videojs-seek-buttons/videojs-seek-buttons.min.js" type="text/javascript"></script>';
|
$js .= '<script src="' .getURL('plugin/SeekButton/videojs-seek-buttons/videojs-seek-buttons.min.js') . '" type="text/javascript"></script>';
|
||||||
$js .= '<script>'
|
$js .= '<script>'
|
||||||
. 'var playerSeekForward = ' . $obj->forward . '; '
|
. 'var playerSeekForward = ' . $obj->forward . '; '
|
||||||
. 'var playerSeekBack = ' . $obj->back . ';'
|
. 'var playerSeekBack = ' . $obj->back . ';'
|
||||||
. 'var forwardLayer = ' . json_encode(file_get_contents($global['systemRootPath']."plugin/SeekButton/forward.html")) . ';'
|
. 'var forwardLayer = ' . json_encode(file_get_contents($global['systemRootPath']."plugin/SeekButton/forward.html")) . ';'
|
||||||
. 'var backLayer = ' . json_encode(file_get_contents($global['systemRootPath']."plugin/SeekButton/back.html")) . ';'
|
. 'var backLayer = ' . json_encode(file_get_contents($global['systemRootPath']."plugin/SeekButton/back.html")) . ';'
|
||||||
. '</script>';
|
. '</script>';
|
||||||
$js .= '<script>'.PlayerSkins::getStartPlayerJS(file_get_contents($global['systemRootPath']."plugin/SeekButton/seek.js")).'</script>';
|
$js .= '<script>'.PlayerSkins::getStartPlayerJS(file_get_contents($global['systemRootPath']."plugin/SeekButton/seek.js")).'</script>';
|
||||||
}
|
}
|
||||||
return $js;
|
return $js;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue