This commit is contained in:
yumoqing 2024-10-10 15:12:40 +08:00
parent dff8922a08
commit 66dc91a68b

View File

@ -28,6 +28,7 @@ bricks.Video = class extends bricks.Layout {
{ {
vtype: vtype:
url: url:
fullscreen:
autoplay: autoplay:
} }
*/ */
@ -74,12 +75,15 @@ bricks.Video = class extends bricks.Layout {
this.player.play(); this.player.play();
} }
set_fullscreen(){ set_fullscreen(){
var co = this.player.getChild('FullscreenToggle'); if (this.fullscreen){
if (!co){ if (!this.player.isFullscreen()) {
console.log('video.js can not found FullscreenToggle'); this.player.requestFullscreen();
return; }
} else {
if (this.player.isFullscreen()) {
this.player.exitFullscreen();
}
} }
co.trigger('click');
} }
create_player(){ create_player(){
if(this.url){ if(this.url){