Use events and emits for finding currentTime.

This commit is contained in:
Kavin
2022-07-19 21:59:03 +05:30
parent f96a7fa86a
commit 25d82169b6
3 changed files with 23 additions and 18 deletions

View File

@@ -25,11 +25,13 @@
:index="index"
:selected-auto-play="selectedAutoPlay"
:selected-auto-loop="selectedAutoLoop"
@timeupdate="onTimeUpdate"
/>
<ChaptersBar
:mobileLayout="isMobile"
v-if="video?.chapters?.length > 0"
:chapters="video.chapters"
:player-position="currentTime"
@seek="navigate"
/>
</div>
@@ -242,6 +244,7 @@ export default {
smallView: smallViewQuery.matches,
showModal: false,
isMobile: true,
currentTime: 0,
};
},
computed: {
@@ -465,6 +468,9 @@ export default {
navigate(time) {
this.$refs.videoPlayer.seek(time);
},
onTimeUpdate(time) {
this.currentTime = time;
},
},
};
</script>