This commit is contained in:
yumoqing 2024-03-15 20:10:40 +08:00
parent ca0f6320af
commit e476f7aa61

View File

@ -59,6 +59,8 @@ bricks.Video = class extends bricks.Layout {
auto_play(){ auto_play(){
this.hidedbtn.dispatch('click'); this.hidedbtn.dispatch('click');
schedule_once(this.disable_captions.bind(this), 2); schedule_once(this.disable_captions.bind(this), 2);
this.err_cnt = 0;
this.player.on('error',this.report_errorbind(this));
} }
play(){ play(){
this.player.play(); this.player.play();
@ -71,10 +73,13 @@ bricks.Video = class extends bricks.Layout {
this.player.ready(this.auto_play.bind(this)); this.player.ready(this.auto_play.bind(this));
this._set_source(); this._set_source();
if (this.opts.autoplay){ }
// schedule_once(this.auto_play.bind(this), 0.1); report_played(){
; console.log(this.video_body.cur_url, 'play ok');
} }
report_error(){
this.err_cnt += 1;
console.log(this.video_body.cur_url, 'play failed', this.err_cnt, 'times');
} }
_set_source(){ _set_source(){
this.player.src({ this.player.src({