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 {
...
@@ -38,7 +38,10 @@ export default {
return
{
return
{
// eslint-disable-next-line
// eslint-disable-next-line
_jessibuca
:
null
,
_jessibuca
:
null
,
// TODO: 播放状态应从播放器对象获取
playing
:
false
,
playing
:
false
,
isPlayed
:
false
,
playOriginUrl
:
''
,
player
:
{
player
:
{
height
:
0
,
height
:
0
,
...
@@ -47,15 +50,13 @@ export default {
...
@@ -47,15 +50,13 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
console
.
log
(
"this.playUrl"
,
this
.
playUrl
);
this
.
init
(
this
.
playUrl
);
this
.
init
();
},
},
unmounted
()
{
unmounted
()
{
this
.
destroy
();
this
.
destroy
();
},
},
methods
:{
methods
:{
init
(
params
=
{})
{
init
(
url
,
params
=
{})
{
console
.
log
(
"this.playUrl"
,
this
.
playUrl
);
const
options
=
Object
.
assign
({
const
options
=
Object
.
assign
({
container
:
this
.
$refs
.
container
,
container
:
this
.
$refs
.
container
,
decoder
:
'/jessibuca-pro/decoder-pro.js'
,
decoder
:
'/jessibuca-pro/decoder-pro.js'
,
...
@@ -104,10 +105,10 @@ export default {
...
@@ -104,10 +105,10 @@ export default {
this
.
_jessibuca
=
new
window
.
JessibucaPro
(
options
);
this
.
_jessibuca
=
new
window
.
JessibucaPro
(
options
);
this
.
registerEvent
(
this
.
_jessibuca
);
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
)
{
registerEvent
(
playerIns
)
{
...
@@ -136,7 +137,6 @@ export default {
...
@@ -136,7 +137,6 @@ export default {
});
});
},
},
getWatermarkBase64
()
{
getWatermarkBase64
()
{
const
data
=
getWatermarkCanvasImg
(
150
,
48
,
'文安智能'
);
const
data
=
getWatermarkCanvasImg
(
150
,
48
,
'文安智能'
);
console
.
log
(
'getWatermarkBase64'
,
data
);
console
.
log
(
'getWatermarkBase64'
,
data
);
},
},
...
@@ -144,7 +144,14 @@ export default {
...
@@ -144,7 +144,14 @@ export default {
// 暴露方法
// 暴露方法
play
(
url
)
{
play
(
url
)
{
if
(
url
)
{
if
(
url
)
{
// 播放地址不同,则先停止再播放。
if
(
this
.
playOriginUrl
&&
this
.
playOriginUrl
!==
url
)
{
this
.
stop
();
}
setTimeout
(()
=>
{
this
.
_jessibuca
.
play
(
url
);
this
.
_jessibuca
.
play
(
url
);
this
.
playOriginUrl
=
url
;
},
150
);
}
else
{
}
else
{
console
.
error
(
'The url is not valid'
);
console
.
error
(
'The url is not valid'
);
}
}
...
@@ -153,14 +160,18 @@ export default {
...
@@ -153,14 +160,18 @@ export default {
this
.
_jessibuca
.
pause
();
this
.
_jessibuca
.
pause
();
},
},
stop
()
{
stop
()
{
this
.
_jessibuca
.
pause
(
true
);
this
.
_jessibuca
.
close
(
);
},
},
destroy
()
{
destroy
()
{
if
(
this
.
_jessibuca
)
{
if
(
this
.
_jessibuca
)
{
this
.
_jessibuca
.
destroy
().
then
(()
=>
{
this
.
_jessibuca
.
destroy
().
then
(()
=>
{
this
.
_jessibuca
=
null
;
this
.
_jessibuca
=
null
;
this
.
playing
=
false
;
this
.
playing
=
false
;
}).
catch
(()
=>
{
Promise
.
reject
(
new
Error
(
'destruction failed'
));
});
});
}
else
{
Promise
.
resolve
(
true
);
}
}
},
},
screenshot
(
filename
=
''
,
format
=
'png'
,
quality
=
0.92
,
type
=
'base64'
)
{
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