refactor(liveRoom):调整直播房间页面配置和播放器设置
- 移除 isPlayerReady 变量 - 更新 playerConfig 配置,增加 autoplay 设置 - 修改 autoplayPolicy 配置,添加 showUnmuteBtn属性 - 删除 definePageMeta 中的 title 属性
This commit is contained in:
parent
f5467618d3
commit
17a080e529
@ -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()
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user