Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
glsk-data-view-scene
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 dddc63af
authored
Jul 13, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
空格播放
1 parent
28c5511c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
src/views/videoPage/index.vue
src/views/videoPage/index.vue
View file @
dddc63a
...
...
@@ -48,6 +48,7 @@ export default {
this
.
$refs
.
video
.
addEventListener
(
'pause'
,
()
=>
{
this
.
status
=
'play'
})
document
.
addEventListener
(
'keydown'
,
this
.
handleDown
)
document
.
addEventListener
(
'fullscreenchange'
,
function
(
e
)
{
let
isFull
if
(
document
.
fullscreenElement
)
{
...
...
@@ -58,6 +59,16 @@ export default {
this
.
isFull
=
true
})
},
handleDown
(
e
)
{
if
(
e
.
keyCode
===
32
)
{
// 执行相应的操作
if
(
this
.
status
==
'play'
)
{
this
.
$refs
.
video
.
play
()
}
else
{
this
.
$refs
.
video
.
pause
()
}
}
},
hanldPlay
(
status
)
{
if
(
status
==
'pause'
)
{
this
.
$refs
.
video
.
play
()
...
...
@@ -65,6 +76,9 @@ export default {
this
.
$refs
.
video
.
pause
()
}
}
},
beforeDestroy
()
{
document
.
removeEventListener
(
'keydown'
,
this
.
handleDown
)
}
}
</
script
>
...
...
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