修改显示处理

master
于肖磊 2026-01-08 11:01:13 +08:00
parent 05d1200d2b
commit c171dfdc0c
1 changed files with 15 additions and 1 deletions

View File

@ -339,9 +339,18 @@
// //
attemptAutoPlay(videoElement, isMuted) { attemptAutoPlay(videoElement, isMuted) {
const playPromise = videoElement.play(); const playPromise = videoElement.play();
uni.showToast({
title: '开始尝试播放' + playPromise,
icon: 'success',
mask: true
})
if (playPromise !== undefined) { if (playPromise !== undefined) {
playPromise.then(() => { playPromise.then(() => {
uni.showToast({
title: '播放成功' + videoElement.muted,
icon: 'success',
mask: true
})
// //
this.autoplayRejected = false; this.autoplayRejected = false;
// //
@ -351,6 +360,11 @@
}); });
}) })
.catch((error) => { .catch((error) => {
uni.showToast({
title: '播放失败' + videoElement.muted,,
icon: 'error',
mask: true
})
// //
this.autoplayRejected = true; this.autoplayRejected = true;
// //