From 0a7ab15d299fa1cd4f4164d35e9aa937ffbeb1b9 Mon Sep 17 00:00:00 2001 From: xingyy <64720302+Concur-max@users.noreply.github.com> Date: Tue, 18 Feb 2025 09:47:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor(liveRoom):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=9B=B4=E6=92=AD=E5=AE=A4=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除静音提示按钮 - 添加诊断按钮配置 - 设置播放器容器大小 - 添加播放器 license配置 - 优化播放器初始化和播放逻辑 - 移除直播加载文本 --- app/components/liveLoading/index.vue | 1 - app/pages/liveRoom/index.client.vue | 42 ++++++++-------------------- 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/app/components/liveLoading/index.vue b/app/components/liveLoading/index.vue index 6381dac..dcc30e2 100644 --- a/app/components/liveLoading/index.vue +++ b/app/components/liveLoading/index.vue @@ -7,7 +7,6 @@
-
直播加载中...
diff --git a/app/pages/liveRoom/index.client.vue b/app/pages/liveRoom/index.client.vue index d57ff6e..6cccad8 100644 --- a/app/pages/liveRoom/index.client.vue +++ b/app/pages/liveRoom/index.client.vue @@ -47,11 +47,18 @@ const initializePlayer = async () => { preload: true, autoplay: true, // 改为 true muted: true, // 默认静音 + diagnosisButtonVisible:false, autoplayPolicy: { fallbackToMute: true }, + width: '100%', //容器的大小 + height: '100%', //容器的大小 skinLayout: false, controlBarVisibility: 'never', + license: { + domain: "szjixun.cn", + key: "OProxmWaOZ2XVHXLtf4030126521c43429403194970aa8af9" + } } player.value = new AliyunPlayer(playerConfig, (playerInstance) => { @@ -59,6 +66,7 @@ const initializePlayer = async () => { if (isWechat) { console.log('当前是微信浏览器环境') const startPlay = () => { + console.log('执行了startPlay') playerInstance?.play() document.removeEventListener('WeixinJSBridgeReady', startPlay) document.removeEventListener('touchstart', startPlay) @@ -67,18 +75,13 @@ const initializePlayer = async () => { document.addEventListener('WeixinJSBridgeReady', startPlay) document.addEventListener('touchstart', startPlay) } - + loading1.value = true playerInstance?.play() }) - - player.value.on('init', () => { - console.log('init') - loading1.value = true - }) - player.value.on('playing', () => { console.log('playing') loading1.value = false + }) player.value.on('error', handlePlayerError) @@ -170,17 +173,6 @@ const tipOpen = () => {
- -
-
-
- {{ t('live_room.tap_unmute') }} -
-
-
@@ -225,20 +217,8 @@ const tipOpen = () => {
- - -