Skip to content

Commit

Permalink
close #151
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidZhang73 committed Mar 15, 2022
1 parent f270dbd commit 6f28370
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/pages/annotation/KeyframePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
:min="0"
:max="annotationStore.video.frames - 1"
:step="1"
:readonly="showVideoPlayer"
:left-label-text-color="currentFocus === 'left' || currentFocus === 'range' ? 'blue-grey-1' : 'primary'"
:right-label-text-color="currentFocus === 'right' || currentFocus === 'range' ? 'blue-grey-1' : 'primary'"
:left-label-color="currentFocus === 'left' || currentFocus === 'range' ? 'primary' : 'blue-grey-1'"
Expand Down Expand Up @@ -118,6 +117,16 @@ const pause = () => {
const videoPlayer = document.getElementById('video-player')
videoPlayer.pause()
}
const stop = () =>{
const videoPlayer = document.getElementById('video-player')
videoPlayer.style.display = 'none'
videoPlayer.pause()
videoPlayer.currentTime = utils.index2time(lastLeftCurrentFrame)
showVideoPlayer.value = false
isPaused.value = true
clearTimeout(videoPlayTimeout)
clearInterval(videoPlayInterval)
}
const handlePlayPause = () => {
const videoPlayer = document.getElementById('video-player')
if (!showVideoPlayer.value) {
Expand All @@ -135,14 +144,7 @@ const handlePlayPause = () => {
}
}
const handleStop = () => {
const videoPlayer = document.getElementById('video-player')
videoPlayer.style.display = 'none'
videoPlayer.pause()
videoPlayer.currentTime = utils.index2time(lastLeftCurrentFrame)
showVideoPlayer.value = false
isPaused.value = true
clearTimeout(videoPlayTimeout)
clearInterval(videoPlayInterval)
stop()
annotationStore.leftCurrentFrame = lastLeftCurrentFrame
}
Expand Down Expand Up @@ -366,6 +368,9 @@ const currentFrameRange = computed({
}
},
set: (value) => {
if (showVideoPlayer.value) {
stop()
}
annotationStore.leftCurrentFrame = value.min
annotationStore.rightCurrentFrame = value.max
}
Expand Down

0 comments on commit 6f28370

Please sign in to comment.