From fc4978ec03c16c5af3a0bbe8f8b930b2be919c57 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Thu, 13 Jan 2022 04:52:14 +0000 Subject: [PATCH] Add support for displaying chapters (#694) --- src/components/Chapters.vue | 26 ++++++++++++++++++++++++++ src/components/Player.vue | 6 +++++- src/components/WatchVideo.vue | 6 ++++++ src/locales/en.json | 3 ++- 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/components/Chapters.vue diff --git a/src/components/Chapters.vue b/src/components/Chapters.vue new file mode 100644 index 00000000..5638c6b1 --- /dev/null +++ b/src/components/Chapters.vue @@ -0,0 +1,26 @@ + + + diff --git a/src/components/Player.vue b/src/components/Player.vue index f33a2e55..b13f7340 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -79,7 +79,6 @@ export default { "f,m,j,k,l,c,space,up,down,left,right,0,1,2,3,4,5,6,7,8,9,shift+,,shift+.", function (e, handler) { const videoEl = self.$refs.videoEl; - console.log(handler.key); switch (handler.key) { case "f": self.$ui.getControls().toggleFullScreen(); @@ -503,6 +502,11 @@ export default { } }; }, + seek(time) { + if (this.$refs.videoEl) { + this.$refs.videoEl.currentTime = time; + } + }, destroy() { if (this.$ui) { this.$ui.destroy(); diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 325408e7..e7a8e816 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -89,6 +89,7 @@ />

+

diff --git a/src/locales/en.json b/src/locales/en.json index 1978b6fa..163fa618 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -88,7 +88,8 @@ "views": "views", "watched": "Watched", "sponsor_segments": "Sponsors Segments", - "ratings_disabled": "Ratings Disabled" + "ratings_disabled": "Ratings Disabled", + "chapters": "Chapters" }, "search": { "did_you_mean": "Did you mean: "