refactor(liveRoom):调整直播房间页面配置和播放器设置

- 移除 isPlayerReady 变量
- 更新 playerConfig 配置,增加 autoplay 设置
- 修改 autoplayPolicy 配置,添加 showUnmuteBtn属性
- 删除 definePageMeta 中的 title 属性
This commit is contained in:
xingyy 2025-02-13 15:23:50 +08:00
parent f5467618d3
commit 17a080e529

View File

@ -14,12 +14,10 @@ import {artworkBuy} from "@/api/goods/index.js"
import {useI18n} from 'vue-i18n' import {useI18n} from 'vue-i18n'
const player = ref(null) const player = ref(null)
const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink,fullLive} = liveStore() const {quoteStatus, show, playerId, show1, auctionData, getSocketData, getLiveLink,fullLive} = liveStore()
const isPlayerReady = ref(false)
const pullLink = ref('') const pullLink = ref('')
definePageMeta({ definePageMeta({
title: '主页',
i18n: 'login.title', i18n: 'login.title',
}) })
const handlePlayerError = (error) => { const handlePlayerError = (error) => {
@ -38,12 +36,14 @@ const initializePlayer = async () => {
source: pullLink.value, source: pullLink.value,
isLive: true, isLive: true,
preload: true, preload: true,
autoplayPolicy: {fallbackToMute: true}, autoplay: false,
autoplayPolicy: {
fallbackToMute: true, // false
showUnmuteBtn: true, // true
},
controlBarVisibility: 'never', controlBarVisibility: 'never',
} }
player.value = new Aliplayer(playerConfig, (playerInstance) => { player.value = new Aliplayer(playerConfig, (playerInstance) => {
isPlayerReady.value = true
playerInstance?.play() playerInstance?.play()
}) })