Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
蒋秀川
/
miniProject
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 2162ae08
authored
Sep 20, 2023
by
Tianqing Liu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: 支持录像
1 parent
17163706
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
h5/src/components/vionPlayer/index.vue
h5/src/components/vionPlayer/index.vue
View file @
2162ae0
...
...
@@ -38,7 +38,10 @@ export default {
return
{
// eslint-disable-next-line
_jessibuca
:
null
,
// TODO: 播放状态应从播放器对象获取
playing
:
false
,
isPlayed
:
false
,
playOriginUrl
:
''
,
player
:
{
height
:
0
,
...
...
@@ -47,15 +50,13 @@ export default {
}
},
mounted
()
{
console
.
log
(
"this.playUrl"
,
this
.
playUrl
);
this
.
init
();
this
.
init
(
this
.
playUrl
);
},
unmounted
()
{
this
.
destroy
();
},
methods
:{
init
(
params
=
{})
{
console
.
log
(
"this.playUrl"
,
this
.
playUrl
);
init
(
url
,
params
=
{})
{
const
options
=
Object
.
assign
({
container
:
this
.
$refs
.
container
,
decoder
:
'/jessibuca-pro/decoder-pro.js'
,
...
...
@@ -104,10 +105,10 @@ export default {
this
.
_jessibuca
=
new
window
.
JessibucaPro
(
options
);
this
.
registerEvent
(
this
.
_jessibuca
);
console
.
log
(
"this.playUrl"
,
this
.
playUrl
);
if
(
this
.
playU
rl
)
{
if
(
u
rl
)
{
// 示例上有延迟写法
setTimeout
(
this
.
play
(
this
.
playU
rl
),
150
);
setTimeout
(
this
.
play
(
u
rl
),
150
);
}
},
registerEvent
(
playerIns
)
{
...
...
@@ -136,7 +137,6 @@ export default {
});
},
getWatermarkBase64
()
{
const
data
=
getWatermarkCanvasImg
(
150
,
48
,
'文安智能'
);
console
.
log
(
'getWatermarkBase64'
,
data
);
},
...
...
@@ -144,7 +144,14 @@ export default {
// 暴露方法
play
(
url
)
{
if
(
url
)
{
// 播放地址不同,则先停止再播放。
if
(
this
.
playOriginUrl
&&
this
.
playOriginUrl
!==
url
)
{
this
.
stop
();
}
setTimeout
(()
=>
{
this
.
_jessibuca
.
play
(
url
);
this
.
playOriginUrl
=
url
;
},
150
);
}
else
{
console
.
error
(
'The url is not valid'
);
}
...
...
@@ -153,14 +160,18 @@ export default {
this
.
_jessibuca
.
pause
();
},
stop
()
{
this
.
_jessibuca
.
pause
(
true
);
this
.
_jessibuca
.
close
(
);
},
destroy
()
{
if
(
this
.
_jessibuca
)
{
this
.
_jessibuca
.
destroy
().
then
(()
=>
{
this
.
_jessibuca
=
null
;
this
.
playing
=
false
;
}).
catch
(()
=>
{
Promise
.
reject
(
new
Error
(
'destruction failed'
));
});
}
else
{
Promise
.
resolve
(
true
);
}
},
screenshot
(
filename
=
''
,
format
=
'png'
,
quality
=
0.92
,
type
=
'base64'
)
{
...
...
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