Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
b7a39957
Unverified
提交
b7a39957
authored
11月 16, 2021
作者:
王嘉豪
提交者:
GitHub
11月 16, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1213 from dataease/pr@dev@refactor_panel-video
refactor:优化视频拖拽效果
上级
29b8628c
fa2efef9
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
31 行增加
和
24 行删除
+31
-24
VideoLinks.vue
...nd/src/components/canvas/components/Editor/VideoLinks.vue
+14
-1
DeVideo.vue
frontend/src/components/canvas/custom-component/DeVideo.vue
+12
-23
component-list.js
.../src/components/canvas/custom-component/component-list.js
+5
-0
没有找到文件。
frontend/src/components/canvas/components/Editor/VideoLinks.vue
浏览文件 @
b7a39957
...
@@ -61,8 +61,18 @@ export default {
...
@@ -61,8 +61,18 @@ export default {
]
]
}
}
},
},
watch
:
{
linkInfo
:
{
handler
:
function
()
{
this
.
init
()
},
deep
:
true
}
},
created
()
{
this
.
init
()
},
mounted
()
{
mounted
()
{
this
.
linkInfoTemp
=
deepCopy
(
this
.
linkInfo
)
},
},
computed
:
{
computed
:
{
...
mapState
([
...
mapState
([
...
@@ -70,6 +80,9 @@ export default {
...
@@ -70,6 +80,9 @@ export default {
])
])
},
},
methods
:
{
methods
:
{
init
()
{
this
.
linkInfoTemp
=
deepCopy
(
this
.
linkInfo
)
},
onSubmit
()
{
onSubmit
()
{
this
.
curComponent
.
videoLinks
=
this
.
linkInfoTemp
this
.
curComponent
.
videoLinks
=
this
.
linkInfoTemp
this
.
$store
.
state
.
styleChangeTimes
++
this
.
$store
.
state
.
styleChangeTimes
++
...
...
frontend/src/components/canvas/custom-component/DeVideo.vue
浏览文件 @
b7a39957
<
template
>
<
template
>
<el-row
ref=
"mainPlayer"
>
<el-row
ref=
"mainPlayer"
>
<div
v-if=
"this.element.videoLinks[this.element.videoLinks.videoType].sources[0].src"
class=
"player"
>
<div
v-if=
"this.element.videoLinks[this.element.videoLinks.videoType].sources[0].src"
:class=
"
{'move-bg':moveFlag}"
class="player">
<video-player
<video-player
v-if=
"!moveFlag"
ref=
"videoPlayer"
ref=
"videoPlayer"
class=
"vjs-custom-skin"
class=
"vjs-custom-skin"
:options=
"playerOptions"
:options=
"playerOptions"
...
@@ -62,13 +63,16 @@ export default {
...
@@ -62,13 +63,16 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
moveFlag
()
{
return
(
this
.
element
.
optStatus
.
dragging
||
this
.
element
.
optStatus
.
resizing
)
},
player
()
{
player
()
{
return
this
.
$refs
.
videoPlayer
.
player
return
this
.
$refs
.
videoPlayer
.
player
},
},
playerOptions
()
{
playerOptions
()
{
const
videoPlayerOptions
=
this
.
element
.
videoLinks
[
this
.
element
.
videoLinks
.
videoType
]
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
===
'yes'
)
{
playHeight
=
this
.
h
-
(
this
.
componentGap
*
2
)
playHeight
=
this
.
h
-
(
this
.
componentGap
*
2
)
}
}
videoPlayerOptions
.
height
=
playHeight
videoPlayerOptions
.
height
=
playHeight
...
@@ -82,26 +86,6 @@ export default {
...
@@ -82,26 +86,6 @@ export default {
])
])
},
},
mounted
()
{
mounted
()
{
// console.log('this is current player instance object', this.player)
setTimeout
(()
=>
{
console
.
log
(
'dynamic change options'
,
this
.
player
)
// change src
// this.playerOptions.sources[0].src = 'https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm';
// change item
// this.$set(this.playerOptions.sources, 0, {
// type: "video/mp4",
// src: 'https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm',
// })
// change array
// this.playerOptions.sources = [{
// type: "video/mp4",
// src: 'https://cdn.theguardian.tv/webM/2015/07/20/150716YesMen_synd_768k_vp8.webm',
// }]
this
.
player
.
muted
(
false
)
},
5000
)
},
},
methods
:
{
methods
:
{
// listen event
// listen event
...
@@ -142,7 +126,7 @@ export default {
...
@@ -142,7 +126,7 @@ export default {
// player is ready
// player is ready
playerReadied
(
player
)
{
playerReadied
(
player
)
{
// seek to 10s
// seek to 10s
console
.
log
(
'example player 1 readied'
,
player
)
//
console.log('example player 1 readied', player)
// player.currentTime(10): the player is readied', player)
// player.currentTime(10): the player is readied', player)
}
}
}
}
...
@@ -160,5 +144,10 @@ export default {
...
@@ -160,5 +144,10 @@ export default {
font-size
:
12px
;
font-size
:
12px
;
color
:
#9ea6b2
;
color
:
#9ea6b2
;
}
}
.move-bg
{
height
:
100%
;
width
:
100%
;
background-color
:
#000000
;
}
</
style
>
</
style
>
frontend/src/components/canvas/custom-component/component-list.js
浏览文件 @
b7a39957
...
@@ -29,6 +29,11 @@ export const VIDEOLINKS = {
...
@@ -29,6 +29,11 @@ export const VIDEOLINKS = {
muted
:
true
,
muted
:
true
,
loop
:
true
,
loop
:
true
,
controlBar
:
{
controlBar
:
{
timeDivider
:
false
,
durationDisplay
:
false
,
remainingTimeDisplay
:
false
,
currentTimeDisplay
:
false
,
// 当前时间
volumeControl
:
false
,
// 声音控制键
fullscreenToggle
:
false
fullscreenToggle
:
false
},
},
sources
:
[{
sources
:
[{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论