Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mould-vuecli3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lhfe
mould-vuecli3
Commits
492c6043
Commit
492c6043
authored
Aug 27, 2020
by
lilei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频播放监听
parent
97e31c7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
videoControl.vue
src/components/videoCutter/videoControl.vue
+1
-1
videoPlayer.vue
src/components/videoCutter/videoPlayer.vue
+3
-1
videoCutter.vue
src/views/videoCutter.vue
+7
-8
No files found.
src/components/videoCutter/videoControl.vue
View file @
492c6043
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"video-control"
>
<div
class=
"video-control"
>
<div
class=
"video-play-btn"
@
click=
"play()"
>
播放
</div>
<div
class=
"video-play-btn"
@
click=
"play()"
>
播放
</div>
<div
class=
"video-time-content"
>
<div
class=
"video-time-content"
>
<div
class=
"now-time"
>
{{
duration
|
formatTime
}}
</div>
<div
class=
"now-time"
>
{{
nowTime
|
formatTime
}}
</div>
<span>
/
</span>
<span>
/
</span>
<div
class=
"total-time"
>
{{
duration
|
formatTime
}}
</div>
<div
class=
"total-time"
>
{{
duration
|
formatTime
}}
</div>
</div>
</div>
...
...
src/components/videoCutter/videoPlayer.vue
View file @
492c6043
...
@@ -28,6 +28,9 @@ export default {
...
@@ -28,6 +28,9 @@ export default {
this
.
$refs
.
videoDom
.
addEventListener
(
'ended'
,
()
=>
{
this
.
$refs
.
videoDom
.
addEventListener
(
'ended'
,
()
=>
{
this
.
$emit
(
'ended'
)
this
.
$emit
(
'ended'
)
})
})
this
.
$refs
.
videoDom
.
addEventListener
(
'timeupdate'
,
()
=>
{
this
.
$emit
(
'timeupdate'
,
this
.
$refs
.
videoDom
.
currentTime
)
})
})
})
},
},
methods
:
{
methods
:
{
...
@@ -39,7 +42,6 @@ export default {
...
@@ -39,7 +42,6 @@ export default {
play
()
{
play
()
{
if
(
!
this
.
canPlay
)
return
if
(
!
this
.
canPlay
)
return
this
.
$refs
.
videoDom
.
play
()
this
.
$refs
.
videoDom
.
play
()
this
.
$emit
(
'currentTime'
,
this
.
$refs
.
videoDom
.
currentTime
)
},
},
pause
()
{
pause
()
{
if
(
!
this
.
canPlay
)
return
if
(
!
this
.
canPlay
)
return
...
...
src/views/videoCutter.vue
View file @
492c6043
<
template
>
<
template
>
<div
class=
"video-cutter"
>
<div
class=
"video-cutter"
>
<div
class=
"video-content"
>
<div
class=
"video-content"
>
<VideoPlayer
@
currentTime=
"changeTime"
@
end=
"playEnd"
/>
<VideoPlayer
@
currentTime=
"changeTime"
@
end=
"playEnd"
@
timeupdate=
"timeupdate"
/>
</div>
</div>
<div
class=
"video-btn"
>
<div
class=
"video-btn"
>
<videoChange
@
changeVideo=
"changeVideo"
/>
<videoChange
@
changeVideo=
"changeVideo"
/>
...
@@ -14,15 +14,11 @@
...
@@ -14,15 +14,11 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
VideoPlayer
from
'@/components/videoCutter/videoPlayer.vue'
import
VideoChange
from
'@/components/videoCutter/videoChange.vue'
import
VideoControl
from
'@/components/videoCutter/videoControl.vue'
export
default
{
export
default
{
components
:
{
components
:
{
VideoPlayer
,
VideoPlayer
:
()
=>
import
(
'@/components/videoCutter/videoPlayer.vue'
)
,
VideoChange
,
VideoChange
:
()
=>
import
(
'@/components/videoCutter/videoChange.vue'
)
,
VideoControl
VideoControl
:
()
=>
import
(
'@/components/videoCutter/videoControl.vue'
)
},
},
name
:
'videoCutter'
,
name
:
'videoCutter'
,
data
()
{
data
()
{
...
@@ -66,6 +62,9 @@ export default {
...
@@ -66,6 +62,9 @@ export default {
playEnd
()
{
playEnd
()
{
this
.
playing
=
false
this
.
playing
=
false
this
.
nowTime
=
this
.
duration
this
.
nowTime
=
this
.
duration
},
timeupdate
(
time
)
{
this
.
nowTime
=
time
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment