From 0c9c0dec48e56c342877ad9f74eb8407025f21a7 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 9 Nov 2021 16:23:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=E5=9B=BD=E9=99=85=E5=8C=96=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 1 + .../canvas/components/Editor/VideoLinks.vue | 29 ++++++++++------- .../canvas/custom-component/DeVideo.vue | 13 +++++--- .../canvas/custom-component/component-list.js | 32 ++++++++++++++----- frontend/src/lang/en.js | 12 ++++++- frontend/src/lang/tw.js | 12 ++++++- frontend/src/lang/zh.js | 11 ++++++- 7 files changed, 83 insertions(+), 27 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 0d9599f1d4..c40395ad4f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -42,6 +42,7 @@ "tinymce": "^5.8.2", "umy-ui": "^1.1.6", "vcolorpicker": "^1.1.0", + "videojs-flash": "^2.2.1", "vue": "2.6.10", "vue-axios": "3.2.4", "vue-clipboard2": "0.3.1", diff --git a/frontend/src/components/canvas/components/Editor/VideoLinks.vue b/frontend/src/components/canvas/components/Editor/VideoLinks.vue index 5de4189786..1be5b099ee 100644 --- a/frontend/src/components/canvas/components/Editor/VideoLinks.vue +++ b/frontend/src/components/canvas/components/Editor/VideoLinks.vue @@ -2,25 +2,32 @@ - - - - + + + + + + + + + + + Tips:{{ $t('panel.video_tips') }} - - - 播放一次 - 循环播放 + + + {{ $t('panel.play_once') }} + {{ $t('panel.play_circle') }} - - + + {{ $t('panel.confirm') }} diff --git a/frontend/src/components/canvas/custom-component/DeVideo.vue b/frontend/src/components/canvas/custom-component/DeVideo.vue index 52b8333869..252fc79897 100644 --- a/frontend/src/components/canvas/custom-component/DeVideo.vue +++ b/frontend/src/components/canvas/custom-component/DeVideo.vue @@ -1,6 +1,6 @@ @@ -29,6 +29,7 @@ // custom skin css import '@/custom-theme.css' import { mapState } from 'vuex' +// import SWF_URL from 'videojs-swf/dist/video-js.swf' export default { props: { @@ -65,13 +66,15 @@ export default { return this.$refs.videoPlayer.player }, playerOptions() { - const videoLinks = this.element.videoLinks + const videoPlayerOptions = this.element.videoLinks[this.element.videoLinks.videoType] let playHeight = this.h if (this.canvasStyleData.panel.gap) { playHeight = this.h - (this.componentGap * 2) } - videoLinks.height = playHeight - return videoLinks + videoPlayerOptions.height = playHeight + + console.log('videoPlayerOptions:' + JSON.stringify(videoPlayerOptions)) + return videoPlayerOptions }, ...mapState([ 'componentGap', diff --git a/frontend/src/components/canvas/custom-component/component-list.js b/frontend/src/components/canvas/custom-component/component-list.js index 5f08f9cd9c..5e7842a141 100644 --- a/frontend/src/components/canvas/custom-component/component-list.js +++ b/frontend/src/components/canvas/custom-component/component-list.js @@ -23,15 +23,31 @@ export const HYPERLINKS = { // 视频信息配置 export const VIDEOLINKS = { - autoplay: true, - muted: true, - loop: true, - language: 'zh', - controlBar: { - fullscreenToggle: false + videoType: 'web', + web: { + autoplay: true, + muted: true, + loop: true, + controlBar: { + fullscreenToggle: false + }, + sources: [{ + }] }, - sources: [{ - }] + rtmp: { + sources: [{ + type: 'rtmp/mp4' + }], + techOrder: ['flash'], + autoplay: false, + controls: true, + flash: { + hls: { + withCredentials: false + } + } + } + } export const assistList = [ diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index b2bda6876f..4e3cf529ba 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1385,7 +1385,17 @@ export default { add_jump_field: 'Add Jump Field', input_jump_link: 'Input Jump Link', select_dimension: 'Select Dimension...', - please_select: 'Please Select' + please_select: 'Please Select', + video_type: 'Video Type', + online_video: 'Online Video', + streaming_media: 'Streaming Media', + auto_play: 'Auto Play', + video_tips: 'Video Tips', + play_frequency: 'Play Frequency', + play_once: 'Once', + play_circle: 'Circle', + video_links: 'Video Links', + video_add_tips: 'Please Add Video Info...' }, plugin: { local_install: 'Local installation', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index b09d94b92f..c0257d78c5 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1388,7 +1388,17 @@ export default { add_jump_field: '追加跳转联动依赖字段', input_jump_link: '请输入跳转连接', select_dimension: '请选择维度...', - please_select: '请选择' + please_select: '请选择', + video_type: '视频类型', + online_video: '在线视频', + streaming_media: '流媒体', + auto_play: '自动播放', + video_tips: '非HTTPS链接,可能导致无法播放', + play_frequency: '播放频率', + play_once: '播放一次', + play_circle: '循环播放', + video_links: '视频链接', + video_add_tips: '请点击添加配置视频信息...' }, plugin: { local_install: '本地安裝', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 684515a3b6..ac724bdb73 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1398,7 +1398,16 @@ export default { add_jump_field: '追加跳转联动依赖字段', input_jump_link: '请输入跳转连接', select_dimension: '请选择维度...', - please_select: '请选择' + video_type: '视频类型', + online_video: '在线视频', + streaming_media: '流媒体', + auto_play: '自动播放', + video_tips: '非HTTPS链接,可能导致无法播放', + play_frequency: '播放频率', + play_once: '播放一次', + play_circle: '循环播放', + video_links: '视频链接', + video_add_tips: '请点击添加配置视频信息...' }, plugin: { local_install: '本地安装',