Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f331602b
authored
Dec 08, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
录播循环播放
1 parent
d87133d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
src/components/LiveBox.vue
src/components/LiveBox.vue
View file @
f331602
...
@@ -65,7 +65,7 @@ const IMAGES = Object.freeze({
...
@@ -65,7 +65,7 @@ const IMAGES = Object.freeze({
})
})
const
TCPlayerConfig
=
Object
.
freeze
({
const
TCPlayerConfig
=
Object
.
freeze
({
autoplay
:
true
,
// 自动播放
autoplay
:
true
,
// 自动播放
loop
:
tru
e
,
// 循环播放
// loop: fals
e, // 循环播放
muted
:
true
,
// 是否静音
muted
:
true
,
// 是否静音
controlBar
:
{
// 控制条配置
controlBar
:
{
// 控制条配置
fullscreenToggle
:
false
// 隐藏全屏按钮
fullscreenToggle
:
false
// 隐藏全屏按钮
...
@@ -91,7 +91,8 @@ export default {
...
@@ -91,7 +91,8 @@ export default {
videoStyle
:
''
,
videoStyle
:
''
,
isSmallBox
:
false
,
//是否显示小容器直播
isSmallBox
:
false
,
//是否显示小容器直播
LiveProps
,
LiveProps
,
IMAGES
IMAGES
,
fileIdx
:
0
}
}
},
},
computed
:
{
computed
:
{
...
@@ -138,14 +139,23 @@ export default {
...
@@ -138,14 +139,23 @@ export default {
// console.log('====', { result });
// console.log('====', { result });
this
.
player
.
ready
(()
=>
{
// 设置播放器初始化完成后的回调
this
.
player
.
ready
(()
=>
{
// 设置播放器初始化完成后的回调
this
.
fixHls
()
this
.
fixHls
()
const
src
=
this
.
LiveProps
[
this
.
liveDetail
.
status
].
isLive
?
this
.
liveDetail
.
pullWebRtcUrl
:
(
this
.
liveDetail
.
liveBroadcastRecordingFileList
||
[])[
0
]?.
videoUrl
const
_this
=
this
const
src
=
this
.
LiveProps
[
this
.
liveDetail
.
status
].
isLive
?
this
.
liveDetail
.
pullWebRtcUrl
:
(
this
.
liveDetail
.
liveBroadcastRecordingFileList
||
[])[
this
.
fileIdx
]?.
videoUrl
this
.
player
.
src
(
src
)
this
.
player
.
src
(
src
)
this
.
player
.
poster
()
this
.
player
.
poster
()
this
.
player
.
play
()
// 播放视频
this
.
player
.
play
()
// 播放视频
// this.player.on('error', function (event) {
// 录播,视频播放ended
// // 从回调参数 event 中获取事件状态码及相关数据
this
.
player
.
on
(
'ended'
,
function
(
event
)
{
// console.log(event, 'error-----------')
let
fileList
=
_this
.
liveDetail
.
liveBroadcastRecordingFileList
// })
if
(
fileList
.
length
==
1
)
{
_this
.
player
.
play
()
return
true
}
// 从回调参数 event 中获取事件状态码及相关数据
_this
.
fileIdx
=
_this
.
fileIdx
==
(
fileList
.
length
-
1
)
?
0
:
_this
.
fileIdx
+
1
_this
.
player
.
src
(
fileList
[
_this
.
fileIdx
]?.
videoUrl
)
_this
.
player
.
play
()
})
this
.
draggable
(
document
.
getElementById
(
'live-box'
),
this
.
openFullscreen
,
'icon-live-close'
)
this
.
draggable
(
document
.
getElementById
(
'live-box'
),
this
.
openFullscreen
,
'icon-live-close'
)
})
})
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment