refactor(VideoPlayer): 移除未使用的移动端视频播放控制逻辑
移除`VideoPlayer.vue`中针对非PC端和微信PC端的视频播放控制逻辑,这些逻辑当前未被使用,简化代码结构。
Showing
1 changed file
with
26 additions
and
26 deletions
| ... | @@ -78,35 +78,35 @@ const handleMounted = (payload) => { | ... | @@ -78,35 +78,35 @@ const handleMounted = (payload) => { |
| 78 | player.value.play(); | 78 | player.value.play(); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | - if (!wxInfo().isPc && !wxInfo().isWeiXinDesktop) { // 非PC端,且非微信PC端 | 81 | + // if (!wxInfo().isPc && !wxInfo().isWeiXinDesktop) { // 非PC端,且非微信PC端 |
| 82 | - // 监听视频播放状态 | 82 | + // // 监听视频播放状态 |
| 83 | - player.value.on('play', () => { | 83 | + // player.value.on('play', () => { |
| 84 | - // 播放时隐藏controls | 84 | + // // 播放时隐藏controls |
| 85 | - // player.value.controlBar.hide(); | 85 | + // // player.value.controlBar.hide(); |
| 86 | - }); | 86 | + // }); |
| 87 | - player.value.on('pause', () => { | 87 | + // player.value.on('pause', () => { |
| 88 | 88 | ||
| 89 | - }) | 89 | + // }) |
| 90 | - // 添加touchstart事件监听 | 90 | + // // 添加touchstart事件监听 |
| 91 | - player.value.on('touchstart', (event) => { | 91 | + // player.value.on('touchstart', (event) => { |
| 92 | - // 阻止事件冒泡,避免触发controls的默认行为 | 92 | + // // 阻止事件冒泡,避免触发controls的默认行为 |
| 93 | - event.preventDefault(); | 93 | + // event.preventDefault(); |
| 94 | - event.stopPropagation(); | 94 | + // event.stopPropagation(); |
| 95 | 95 | ||
| 96 | - // 检查点击位置是否在controls区域 | 96 | + // // 检查点击位置是否在controls区域 |
| 97 | - const controlBar = player.value.getChild('ControlBar'); | 97 | + // const controlBar = player.value.getChild('ControlBar'); |
| 98 | - const controlBarEl = controlBar && controlBar.el(); | 98 | + // const controlBarEl = controlBar && controlBar.el(); |
| 99 | - if (controlBarEl && controlBarEl.contains(event.target)) { | 99 | + // if (controlBarEl && controlBarEl.contains(event.target)) { |
| 100 | - return; // 如果点击在controls区域,不执行自定义行为 | 100 | + // return; // 如果点击在controls区域,不执行自定义行为 |
| 101 | - } | 101 | + // } |
| 102 | 102 | ||
| 103 | - if (player.value.paused()) { | 103 | + // if (player.value.paused()) { |
| 104 | - player.value.play(); | 104 | + // player.value.play(); |
| 105 | - } else { | 105 | + // } else { |
| 106 | - player.value.pause(); | 106 | + // player.value.pause(); |
| 107 | - } | 107 | + // } |
| 108 | - }); | 108 | + // }); |
| 109 | - } | 109 | + // } |
| 110 | } | 110 | } |
| 111 | }; | 111 | }; |
| 112 | 112 | ... | ... |
-
Please register or login to post a comment