From 05d1200d2b978a719ca7cf55930a47f73518b4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 8 Jan 2026 10:59:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../live/pull/components/h5-hls-video/h5-hls-video.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/plugins/live/pull/components/h5-hls-video/h5-hls-video.vue b/pages/plugins/live/pull/components/h5-hls-video/h5-hls-video.vue index 51c3f910..c856bc29 100644 --- a/pages/plugins/live/pull/components/h5-hls-video/h5-hls-video.vue +++ b/pages/plugins/live/pull/components/h5-hls-video/h5-hls-video.vue @@ -636,7 +636,10 @@ this.videoEl.controls = controls this.videoEl.muted = muted this.videoEl.playbackRate = playbackRate - + uni.showToast({ + title: this.autoplayRejected && autoplay ? '自动播放失败,请手动播放' : '自动播放成功', + icon: 'none' + }); // 如果更改了静音状态且之前自动播放被拒绝,重新尝试播放 if (this.autoplayRejected && autoplay) { this.attemptAutoPlay(this.videoEl, muted); From c171dfdc0c853e2bb0574650bd4c8cd90fe35898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Thu, 8 Jan 2026 11:01:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/h5-hls-video/h5-hls-video.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pages/plugins/live/pull/components/h5-hls-video/h5-hls-video.vue b/pages/plugins/live/pull/components/h5-hls-video/h5-hls-video.vue index c856bc29..00aee391 100644 --- a/pages/plugins/live/pull/components/h5-hls-video/h5-hls-video.vue +++ b/pages/plugins/live/pull/components/h5-hls-video/h5-hls-video.vue @@ -339,9 +339,18 @@ // 尝试自动播放视频 attemptAutoPlay(videoElement, isMuted) { const playPromise = videoElement.play(); - + uni.showToast({ + title: '开始尝试播放' + playPromise, + icon: 'success', + mask: true + }) if (playPromise !== undefined) { playPromise.then(() => { + uni.showToast({ + title: '播放成功' + videoElement.muted, + icon: 'success', + mask: true + }) // 自动播放成功 this.autoplayRejected = false; // 通知父组件静音播放成功 @@ -351,6 +360,11 @@ }); }) .catch((error) => { + uni.showToast({ + title: '播放失败' + videoElement.muted,, + icon: 'error', + mask: true + }) // 自动播放被拒绝 this.autoplayRejected = true; // 通知父组件静音播放成功