mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
Fullscren control
This commit is contained in:
parent
0a00781816
commit
c60b4fb91e
2 changed files with 6 additions and 16 deletions
|
@ -482,8 +482,9 @@ class PlayerSkins extends PluginAbstract
|
||||||
static function includeFullscreenBlock(){
|
static function includeFullscreenBlock(){
|
||||||
//$o->type = array(0=>'Show In all devices', 1=>'Show In Mobile Only', 2=>'Show In Desktop Only');
|
//$o->type = array(0=>'Show In all devices', 1=>'Show In Mobile Only', 2=>'Show In Desktop Only');
|
||||||
$obj = AVideoPlugin::getObjectData('PlayerSkins');
|
$obj = AVideoPlugin::getObjectData('PlayerSkins');
|
||||||
|
//var_dump($obj->showFullscreenToggle->value);exit;
|
||||||
if (!empty($obj->showFullscreenToggle->value)) {
|
if (!empty($obj->showFullscreenToggle->value)) {
|
||||||
if (($obj->showFullscreenToggle->value==1 && isMobile()) || $obj->showFullscreenToggle->value==2) {
|
if (($obj->showFullscreenToggle->value==1 && !isMobile()) || $obj->showFullscreenToggle->value==2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -518,7 +519,7 @@ class PlayerSkins extends PluginAbstract
|
||||||
$controlBar[] = 'pictureInPictureToggle: false';
|
$controlBar[] = 'pictureInPictureToggle: false';
|
||||||
}
|
}
|
||||||
if (self::includeFullscreenBlock()) {
|
if (self::includeFullscreenBlock()) {
|
||||||
$controlBar[] = "fullscreenToggle: false";
|
//$controlBar[] = "fullscreenToggle: false";
|
||||||
}
|
}
|
||||||
if (!empty($controlBar)) {
|
if (!empty($controlBar)) {
|
||||||
$dataSetup[] = "controlBar: {" . implode(', ', $controlBar) . "}";
|
$dataSetup[] = "controlBar: {" . implode(', ', $controlBar) . "}";
|
||||||
|
|
|
@ -1,15 +1,4 @@
|
||||||
this.tech_.el_.addEventListener('fullscreenchange', function (e) {
|
player.on('fullscreenchange', function(e, data) {
|
||||||
if (isMobile() && this.player_.isFullscreen()) {
|
console.log('player fullscreenchange isFullscreen', player.isFullscreen());
|
||||||
this.player_.exitFullscreen();
|
player.exitFullscreen();
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.tech_.el_.addEventListener('dblclick', function (e) {
|
|
||||||
e.preventDefault(); // Prevents double-click fullscreen on supported devices/browsers
|
|
||||||
});
|
|
||||||
|
|
||||||
document.addEventListener('keydown', function (e) {
|
|
||||||
if (e.key === 'F11') { // Disables the F11 key for fullscreen
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
});
|
});
|
Loading…
Add table
Add a link
Reference in a new issue