This commit is contained in:
yumoqing 2024-10-10 11:49:09 +08:00
parent 195a8de10e
commit dede41601a

View File

@ -59,7 +59,15 @@ bricks.Video = class extends bricks.Layout {
}
}
}
set_muted(flg){
if (flg){
this.player.muted = true;
} else {
this.player.muted = false;
}
}
auto_play(){
this.set_muted(true);
schedule_once(this._auto_play.bind(this), 0.5);
}
_auto_play(){
@ -74,16 +82,19 @@ bricks.Video = class extends bricks.Layout {
this.hidedbtn.hide();
console.log('Video:play() called....');
this.player.play();
this.set_muted(false);
}
create_player(){
if(this.url){
this.player = videojs(this.video_body.dom_element, {
controls:true,
autoplay:this.autoplay,
muted:true,
nativeTextTracks:false,
textTrackSettings: false
});
this._set_source();
if (self.autoplay || self.auto_play){
if (self.autoplay){
this.player.ready(this.auto_play.bind(this));
} else {
console.log('autoplay=', this.autoplay, this.auto_play);