From 644882e04faaf153b0420a4f3b00499cea395100 Mon Sep 17 00:00:00 2001 From: jmt-gh Date: Sat, 18 Jun 2022 23:55:34 -0700 Subject: [PATCH 1/2] add support for swapping progress bar between current chapter duration and book duration --- client/components/player/PlayerUi.vue | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/client/components/player/PlayerUi.vue b/client/components/player/PlayerUi.vue index 3cf2a49e..0b673f25 100644 --- a/client/components/player/PlayerUi.vue +++ b/client/components/player/PlayerUi.vue @@ -21,6 +21,10 @@
format_list_bulleted
+ +
+ timelapse +
@@ -66,7 +70,8 @@ export default { seekLoading: false, showChaptersModal: false, currentTime: 0, - duration: 0 + duration: 0, + useChapterTrack: false } }, computed: { @@ -86,6 +91,10 @@ export default { return this.$store.getters['user/getToken'] }, timeRemaining() { + if (this.useChapterTrack && this.currentChapter) { + var currChapTime = this.currentTime - this.currentChapter.start + return (this.currentChapterDuration - currChapTime) / this.playbackRate + } return (this.duration - this.currentTime) / this.playbackRate }, timeRemainingPretty() { @@ -104,6 +113,9 @@ export default { currentChapterName() { return this.currentChapter ? this.currentChapter.title : '' }, + currentChapterDuration() { + return (this.currentChapter.end - this.currentChapter.start) + }, isFullscreen() { return this.$store.state.playerIsFullscreen }, @@ -192,6 +204,15 @@ export default { this.seek(chapter.start) this.showChaptersModal = false }, + setUseChapterTrack() { + var useChapterTrack = !this.useChapterTrack + this.useChapterTrack = useChapterTrack + + this.$emit('useChapterTrack', useChapterTrack) + this.$store.dispatch('user/updateUserSettings', { useChapterTrack }).catch((err) => { + console.error('Failed to update settings', err) + }) + }, seek(time) { this.$emit('seek', time) }, @@ -242,7 +263,6 @@ export default { var currTimeClean = this.$secondsToTimestamp(this.currentTime) ts.innerText = currTimeClean }, - setBufferTime(bufferTime) { if (this.$refs.trackbar) this.$refs.trackbar.setBufferTime(bufferTime) }, @@ -252,7 +272,9 @@ export default { }, init() { this.playbackRate = this.$store.getters['user/getUserSetting']('playbackRate') || 1 + this.useChapterTrack = this.$store.getters['user/getUserSetting']('useChapterTrack') || false this.$emit('setPlaybackRate', this.playbackRate) + this.$emit('useChapterTrack', this.useChapterTrack) }, settingsUpdated(settings) { if (settings.playbackRate && this.playbackRate !== settings.playbackRate) { From ccc82520a9db0e328e89abdc735d87c413fa0ec3 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 19 Jun 2022 10:04:15 -0500 Subject: [PATCH 2/2] Update chapter track progress bar, timestamps, hide chapter ticks. Update mobile responsiveness for player --- client/components/app/StreamContainer.vue | 16 ++--- .../controls/PlaybackSpeedControl.vue | 28 +++++++-- client/components/controls/VolumeControl.vue | 4 +- .../player/PlayerPlaybackControls.vue | 21 +++++-- client/components/player/PlayerTrackBar.vue | 40 ++++++++++--- client/components/player/PlayerUi.vue | 58 ++++++++++++------- client/components/ui/Tooltip.vue | 2 +- client/tailwind.config.js | 3 +- 8 files changed, 118 insertions(+), 54 deletions(-) diff --git a/client/components/app/StreamContainer.vue b/client/components/app/StreamContainer.vue index 45fc2734..5775cf27 100644 --- a/client/components/app/StreamContainer.vue +++ b/client/components/app/StreamContainer.vue @@ -1,30 +1,30 @@