Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Nov 9, 2024
1 parent 498cd13 commit 932a939
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions plugin/SeekButton/SeekButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,38 @@ public function getEmptyDataObject() {
$obj = new stdClass();
$obj->forward = 30;
$obj->back = 10;
$obj->hideOnMobile = true;
return $obj;
}

function shouldLoad(){
if(isVideoPlayerHasProgressBar()){
$obj = $this->getDataObject();
if($obj->hideOnMobile && isMobile()){
return false;
}
return true;
}
return false;
}

public function getHeadCode() {
global $global;
$css = "";
if (isVideoPlayerHasProgressBar() && !isMobile()) {
if ($this->shouldLoad()) {
$css = '<link href="' .getURL('node_modules/videojs-seek-buttons/dist/videojs-seek-buttons.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>';
if(isMobile()){
$css .= '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">';
}
//if(isMobile()){
//$css .= '<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">';
//}
}
return $css;
}

public function getFooterCode() {
global $global;
if (isVideoPlayerHasProgressBar() && !isMobile()) {
if ($this->shouldLoad()) {
$obj = $this->getDataObject();
$js = "";
if (isVideoPlayerHasProgressBar()) {
Expand Down

0 comments on commit 932a939

Please sign in to comment.