feat:【antd】【mp】mp 的代码评审(components)
This commit is contained in:
@@ -1 +1,3 @@
|
||||
export { default } from './wx-video-play.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
<!--
|
||||
- Copyright (C) 2018-2019
|
||||
- All rights reserved, Designed By www.joolun.com
|
||||
【微信消息 - 视频】
|
||||
芋道源码:
|
||||
① bug 修复:
|
||||
1)joolun 的做法:使用 mediaId 从微信公众号,下载对应的 mp4 素材,从而播放内容;
|
||||
存在的问题:mediaId 有效期是 3 天,超过时间后无法播放
|
||||
2)重构后的做法:后端接收到微信公众号的视频消息后,将视频消息的 media_id 的文件内容保存到文件服务器中,这样前端可以直接使用 URL 播放。
|
||||
② 体验优化:弹窗关闭后,自动暂停视频的播放
|
||||
|
||||
-->
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
@@ -20,8 +8,10 @@ import { ElDialog } from 'element-plus';
|
||||
|
||||
import 'video.js/dist/video-js.css';
|
||||
|
||||
defineOptions({ name: 'VideoPlayer' });
|
||||
/** 微信消息 - 视频 */
|
||||
defineOptions({ name: 'WxVideoPlayer' });
|
||||
|
||||
// TODO @hw:antd 或者 ele,props 保持一致;
|
||||
const props = defineProps({
|
||||
url: {
|
||||
type: String,
|
||||
@@ -31,10 +21,6 @@ const props = defineProps({
|
||||
|
||||
const dialogVideo = ref(false);
|
||||
|
||||
// const handleEvent = (log) => {
|
||||
// console.log('Basic player event', log)
|
||||
// }
|
||||
|
||||
const playVideo = () => {
|
||||
dialogVideo.value = true;
|
||||
};
|
||||
@@ -61,6 +47,7 @@ const playVideo = () => {
|
||||
:width="800"
|
||||
:playback-rates="[0.7, 1.0, 1.5, 2.0]"
|
||||
/>
|
||||
<!-- TODO @hw:删除掉? -->
|
||||
<!-- 事件,暫時沒用
|
||||
@mounted="handleMounted"-->
|
||||
<!-- @ready="handleEvent($event)"-->
|
||||
|
||||
Reference in New Issue
Block a user