Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
saas-dml
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
saas-dml
Commits
ca84e36e
提交
ca84e36e
authored
11月 23, 2024
作者:
haodaking
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 视频增加加载中的状态
上级
ef73e700
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
54 行增加
和
6 行删除
+54
-6
LivePlayback.vue
src/modules/live/test/components/LivePlayback.vue
+43
-4
RecordDialog.vue
src/modules/live/test/components/RecordDialog.vue
+11
-2
没有找到文件。
src/modules/live/test/components/LivePlayback.vue
浏览文件 @
ca84e36e
...
...
@@ -14,9 +14,11 @@ const userName = computed(() => {
})
const
video
=
ref
(
null
)
const
playing
=
ref
(
false
)
const
duration
=
ref
(
0
)
const
loading
=
ref
(
true
)
// 新增的 loading 状态
const
hover
=
ref
(
false
)
onMounted
(()
=>
{
video
.
value
.
ondurationchange
=
(
e
)
=>
{
if
(
e
.
target
.
duration
===
Infinity
)
{
...
...
@@ -25,7 +27,6 @@ onMounted(() => {
video
.
value
.
currentTime
=
0
}
duration
.
value
=
e
.
target
.
duration
===
Infinity
?
parseFloat
(
record
.
value
.
live_duration
)
:
e
.
target
.
duration
console
.
log
(
'ondurationchange'
,
e
.
target
.
duration
)
}
video
.
value
.
ontimeupdate
=
()
=>
{
currentTime
.
value
=
video
.
value
.
currentTime
...
...
@@ -39,6 +40,12 @@ onMounted(() => {
video
.
value
.
onended
=
()
=>
{
playing
.
value
=
false
}
video
.
value
.
onwaiting
=
()
=>
{
loading
.
value
=
true
}
video
.
value
.
oncanplay
=
()
=>
{
loading
.
value
=
false
}
})
const
togglePlay
=
()
=>
{
...
...
@@ -48,8 +55,6 @@ const togglePlay = () => {
const
handleInput
=
(
value
)
=>
{
video
.
value
.
currentTime
=
value
}
const
hover
=
ref
(
false
)
</
script
>
<
template
>
...
...
@@ -58,6 +63,10 @@ const hover = ref(false)
<p>
主播:
{{
userName
}}
</p>
</div>
<div
class=
"live-bd"
>
<!-- 显示加载状态 -->
<div
class=
"loading-overlay"
v-if=
"loading"
>
<div
class=
"spinner"
></div>
</div>
<video
:src=
"record.live_video_addres"
preload=
"metadata"
ref=
"video"
></video>
<LiveCover
:messages=
"messages"
...
...
@@ -165,4 +174,34 @@ const hover = ref(false)
right
:
10px
;
z-index
:
100000
;
}
.loading-overlay
{
position
:
absolute
;
top
:
0
;
left
:
0
;
right
:
0
;
bottom
:
0
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
background-color
:
rgba
(
0
,
0
,
0
,
0
.6
);
z-index
:
10
;
.spinner
{
width
:
40px
;
height
:
40px
;
border
:
4px
solid
transparent
;
border-top-color
:
#fff
;
border-radius
:
50%
;
animation
:
spin
1s
linear
infinite
;
}
@keyframes
spin
{
0
%
{
transform
:
rotate
(
0deg
);
}
100
%
{
transform
:
rotate
(
360deg
);
}
}
}
</
style
>
src/modules/live/test/components/RecordDialog.vue
浏览文件 @
ca84e36e
...
...
@@ -46,13 +46,15 @@ const listOptions = {
return
row
.
live_video_addres
?
'已上传'
:
'未上传'
},
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
1
0
0
},
{
label
:
'操作'
,
slots
:
'table-x'
,
width
:
1
5
0
},
],
}
// 上传视频
const
uploading
=
ref
(
false
)
const
currentRow
=
ref
()
const
handleUpload
=
(
row
)
=>
{
currentRow
.
value
=
row
const
dialog
=
useFileDialog
()
dialog
.
open
({
accept
:
'video/*'
})
dialog
.
onChange
(
async
([
file
])
=>
{
...
...
@@ -87,7 +89,14 @@ const handleUpload = (row) => {
<router-link
:to=
"
{ path: 'test/view', query: { ...$route.query, id: data.id, record_id: row.id } }"
>查看
</router-link
>
<el-button
type=
"primary"
text
:disabled=
"uploading"
@
click=
"handleUpload(row)"
>
上传
</el-button>
<el-button
type=
"primary"
text
:loading=
"uploading && currentRow.id === row.id"
:disabled=
"uploading"
@
click=
"handleUpload(row)"
>
上传
</el-button
>
</el-button>
</
template
>
</AppList>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论