提交 0c9c0dec authored 作者: wangjiahao's avatar wangjiahao

refactor:国际化等

上级 c6aa9af3
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
"tinymce": "^5.8.2", "tinymce": "^5.8.2",
"umy-ui": "^1.1.6", "umy-ui": "^1.1.6",
"vcolorpicker": "^1.1.0", "vcolorpicker": "^1.1.0",
"videojs-flash": "^2.2.1",
"vue": "2.6.10", "vue": "2.6.10",
"vue-axios": "3.2.4", "vue-axios": "3.2.4",
"vue-clipboard2": "0.3.1", "vue-clipboard2": "0.3.1",
......
...@@ -2,25 +2,32 @@ ...@@ -2,25 +2,32 @@
<el-popover <el-popover
ref="popover" ref="popover"
width="340" width="400"
trigger="click" trigger="click"
> >
<el-row> <el-row>
<el-form ref="form" size="mini" label-width="70px"> <el-form ref="form" size="mini" label-width="70px">
<el-form-item :label="'自动播放'"> <!-- <el-form-item :label="$t('panel.video_type')">-->
<el-switch v-model="linkInfoTemp.autoplay" size="mini" /> <!-- <el-radio-group v-model="linkInfoTemp.videoType">-->
<span v-show="linkInfoTemp.autoplay" style="color: #909399; font-size: 8px;margin-left: 3px"> <!-- <el-radio :label="'web'">{{$t('panel.online_video')}}</el-radio>-->
<!-- Tips:{{ $t('panel.link_open_tips') }}--> <!--&lt;!&ndash; <el-radio :label="'hls'">HLS 直播</el-radio>&ndash;&gt;-->
<!-- <el-radio :label="'rtmp'">{{$t('panel.streaming_media')}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item :label="$t('panel.auto_play')">
<el-switch v-model="linkInfoTemp[linkInfoTemp.videoType].autoplay" size="mini" />
<span style="color: #909399; font-size: 8px;margin-left: 3px">
Tips:{{ $t('panel.video_tips') }}
</span> </span>
</el-form-item> </el-form-item>
<el-form-item :label="$t('panel.open_mode')"> <el-form-item v-if="linkInfoTemp.videoType==='web'" :label="$t('panel.play_frequency')">
<el-radio-group v-model="linkInfoTemp.loop"> <el-radio-group v-model="linkInfoTemp[linkInfoTemp.videoType].loop">
<el-radio :label="false">播放一次</el-radio> <el-radio :label="false">{{ $t('panel.play_once') }}</el-radio>
<el-radio :label="true">循环播放</el-radio> <el-radio :label="true">{{ $t('panel.play_circle') }}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('panel.hyperLinks')"> <el-form-item :label="$t('panel.video_links')">
<el-input v-model="linkInfoTemp.sources[0].src" /> <el-input v-model="linkInfoTemp[linkInfoTemp.videoType].sources[0].src" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit">{{ $t('panel.confirm') }}</el-button> <el-button type="primary" @click="onSubmit">{{ $t('panel.confirm') }}</el-button>
......
<template> <template>
<el-row ref="mainPlayer"> <el-row ref="mainPlayer">
<div v-if="this.element.videoLinks.sources[0].src" class="player"> <div v-if="this.element.videoLinks[this.element.videoLinks.videoType].sources[0].src" class="player">
<video-player <video-player
ref="videoPlayer" ref="videoPlayer"
class="vjs-custom-skin" class="vjs-custom-skin"
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
/> />
</div> </div>
<div v-else class="info-class"> <div v-else class="info-class">
请点击添加配置视频信息... {{ $t('panel.video_add_tips') }}
</div> </div>
</el-row> </el-row>
</template> </template>
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
// custom skin css // custom skin css
import '@/custom-theme.css' import '@/custom-theme.css'
import { mapState } from 'vuex' import { mapState } from 'vuex'
// import SWF_URL from 'videojs-swf/dist/video-js.swf'
export default { export default {
props: { props: {
...@@ -65,13 +66,15 @@ export default { ...@@ -65,13 +66,15 @@ export default {
return this.$refs.videoPlayer.player return this.$refs.videoPlayer.player
}, },
playerOptions() { playerOptions() {
const videoLinks = this.element.videoLinks const videoPlayerOptions = this.element.videoLinks[this.element.videoLinks.videoType]
let playHeight = this.h let playHeight = this.h
if (this.canvasStyleData.panel.gap) { if (this.canvasStyleData.panel.gap) {
playHeight = this.h - (this.componentGap * 2) playHeight = this.h - (this.componentGap * 2)
} }
videoLinks.height = playHeight videoPlayerOptions.height = playHeight
return videoLinks
console.log('videoPlayerOptions:' + JSON.stringify(videoPlayerOptions))
return videoPlayerOptions
}, },
...mapState([ ...mapState([
'componentGap', 'componentGap',
......
...@@ -23,15 +23,31 @@ export const HYPERLINKS = { ...@@ -23,15 +23,31 @@ export const HYPERLINKS = {
// 视频信息配置 // 视频信息配置
export const VIDEOLINKS = { export const VIDEOLINKS = {
autoplay: true, videoType: 'web',
muted: true, web: {
loop: true, autoplay: true,
language: 'zh', muted: true,
controlBar: { loop: true,
fullscreenToggle: false controlBar: {
fullscreenToggle: false
},
sources: [{
}]
}, },
sources: [{ rtmp: {
}] sources: [{
type: 'rtmp/mp4'
}],
techOrder: ['flash'],
autoplay: false,
controls: true,
flash: {
hls: {
withCredentials: false
}
}
}
} }
export const assistList = [ export const assistList = [
......
...@@ -1385,7 +1385,17 @@ export default { ...@@ -1385,7 +1385,17 @@ export default {
add_jump_field: 'Add Jump Field', add_jump_field: 'Add Jump Field',
input_jump_link: 'Input Jump Link', input_jump_link: 'Input Jump Link',
select_dimension: 'Select Dimension...', 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: { plugin: {
local_install: 'Local installation', local_install: 'Local installation',
......
...@@ -1388,7 +1388,17 @@ export default { ...@@ -1388,7 +1388,17 @@ export default {
add_jump_field: '追加跳转联动依赖字段', add_jump_field: '追加跳转联动依赖字段',
input_jump_link: '请输入跳转连接', input_jump_link: '请输入跳转连接',
select_dimension: '请选择维度...', 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: { plugin: {
local_install: '本地安裝', local_install: '本地安裝',
......
...@@ -1398,7 +1398,16 @@ export default { ...@@ -1398,7 +1398,16 @@ export default {
add_jump_field: '追加跳转联动依赖字段', add_jump_field: '追加跳转联动依赖字段',
input_jump_link: '请输入跳转连接', input_jump_link: '请输入跳转连接',
select_dimension: '请选择维度...', 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: { plugin: {
local_install: '本地安装', local_install: '本地安装',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论