This commit is contained in:
yumoqing 2024-10-10 11:25:37 +08:00
parent bb1eab3172
commit 5fd34667bc

View File

@ -36,7 +36,7 @@ bricks.Video = class extends bricks.Layout {
this.video_body = new bricks.VideoBody(options);
this.add_widget(this.video_body);
schedule_once(this.create_player.bind(this), 0.1);
this.hidedbtn = new bricks.Button({text:'click me'});
this.hidedbtn = new bricks.Button({label:'click me'});
this.hidedbtn.bind('click', this.play.bind(this));
this.add_widget(this.hidedbtn);
}
@ -60,6 +60,9 @@ bricks.Video = class extends bricks.Layout {
}
}
auto_play(){
schedule_once(this._auto_play.bind(this), 0.1);
}
_auto_play(){
console.log('video ready, auto_playing ....');
schedule_once(this.disable_captions.bind(this), 2);
this.player.on('error',this.report_error.bind(this));