From 17a080e5297c380506e43516d6e5abda6884ed7d Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Thu, 13 Feb 2025 15:23:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor(liveRoom):=E8=B0=83=E6=95=B4=E7=9B=B4?= =?UTF-8?q?=E6=92=AD=E6=88=BF=E9=97=B4=E9=A1=B5=E9=9D=A2=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=92=8C=E6=92=AD=E6=94=BE=E5=99=A8=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 isPlayerReady 变量 - 更新 playerConfig 配置,增加 autoplay 设置 - 修改 autoplayPolicy 配置,添加 showUnmuteBtn属性 - 删除 definePageMeta 中的 title 属性 --- app/pages/liveRoom/index.client.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue index 44f394f..8a0c6d0 100644 --- a/app/pages/liveRoom/index.client.vue +++ b/app/pages/liveRoom/index.client.vue @@ -14,12 +14,10 @@ import {artworkBuy} from "@/api/goods/index.js" import {useI18n} from 'vue-i18n' const player = ref(null) const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink,fullLive} = liveStore() -const isPlayerReady = ref(false) const pullLink = ref('') definePageMeta({ - title: '主页', i18n: 'login.title', }) const handlePlayerError = (error) => { @@ -38,12 +36,14 @@ const initializePlayer = async () => { source: pullLink.value, isLive: true, preload: true, - autoplayPolicy: {fallbackToMute: true}, + autoplay: false, + autoplayPolicy: { + fallbackToMute: true, // 有声自动播放失败后,是否降级为静音自动播放,默认为false + showUnmuteBtn: true, // 静音自动播放时,是否居中显示静音大按钮,默认为true + }, controlBarVisibility: 'never', } - player.value = new Aliplayer(playerConfig, (playerInstance) => { - isPlayerReady.value = true playerInstance?.play() })