From 6e2b8075c97e639b524b3b676be7cba1f501e837 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 5 Feb 2025 10:50:05 +0800 Subject: [PATCH] bugfix --- bricks/video.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bricks/video.js b/bricks/video.js index 32d6cbd..fdc9489 100644 --- a/bricks/video.js +++ b/bricks/video.js @@ -69,7 +69,6 @@ bricks.Video = class extends bricks.Layout { } auto_play(){ - return; schedule_once(this._auto_play.bind(this), 0.8); } _auto_play(){ @@ -78,15 +77,21 @@ bricks.Video = class extends bricks.Layout { console.log('vjs-big-play-button not found'); return; } + if (play_btn.style.display == 'none'){ + console.log('playing .............already'); + return; + } console.log('video ready, auto_playing ....'); var clickevent = new MouseEvent('click', { 'bubbles': true, // 事件是否冒泡 'cancelable': true // 事件是否可取消 }); play_btn.dispatchEvent(clickevent); + /* if (this.autounmute && this.player.muted){ - schedule_once(this.dispatch_mute.bind(this), 0.8); + schedule_once(this.dispatch_mute.bind(this), 1); } + */ } play(){ @@ -159,7 +164,7 @@ bricks.Video = class extends bricks.Layout { this.play_status = 'playok'; console.log(this.video_body.cur_url, 'play ok'); if (this.autounmute && this.player.muted){ - schedule_once(this.dispatch_mute.bind(this), 1); + schedule_once(this.dispatch_mute.bind(this), 1.5); console.log('mute btn clicked'); } else { console.log(this.autounmute, 'player.muted=', this.player.muted);