From e476f7aa61945a988d151d1fecf8b0df1d9ccee3 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 15 Mar 2024 20:10:40 +0800 Subject: [PATCH] bugfix --- bricks/video.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bricks/video.js b/bricks/video.js index 948799a..e401aee 100755 --- a/bricks/video.js +++ b/bricks/video.js @@ -59,6 +59,8 @@ bricks.Video = class extends bricks.Layout { auto_play(){ this.hidedbtn.dispatch('click'); schedule_once(this.disable_captions.bind(this), 2); + this.err_cnt = 0; + this.player.on('error',this.report_error。bind(this)); } play(){ this.player.play(); @@ -71,10 +73,13 @@ bricks.Video = class extends bricks.Layout { this.player.ready(this.auto_play.bind(this)); 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(){ this.player.src({