diff --git a/assets/js/player.js b/assets/js/player.js index 71c5e7da..db426b42 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -17,6 +17,7 @@ var options = { 'remainingTimeDisplay', 'Spacer', 'captionsButton', + 'ChaptersButton', 'audioTrackButton', 'qualitySelector', 'playbackRateMenuButton', diff --git a/src/invidious/routes/embed.cr b/src/invidious/routes/embed.cr index 266f7ba4..46e31a98 100644 --- a/src/invidious/routes/embed.cr +++ b/src/invidious/routes/embed.cr @@ -191,6 +191,8 @@ module Invidious::Routes::Embed thumbnail = "/vi/#{video.id}/maxres.jpg" + chapters = video.chapters + if params.raw url = fmt_stream[0]["url"].as_s diff --git a/src/invidious/routes/watch.cr b/src/invidious/routes/watch.cr index aabe8dfc..144f24e0 100644 --- a/src/invidious/routes/watch.cr +++ b/src/invidious/routes/watch.cr @@ -158,6 +158,8 @@ module Invidious::Routes::Watch thumbnail = "/vi/#{video.id}/maxres.jpg" + chapters = video.chapters + if params.raw if params.listen url = audio_streams[0]["url"].as_s diff --git a/src/invidious/views/components/player.ecr b/src/invidious/views/components/player.ecr index c3c02df0..f3c5a17a 100644 --- a/src/invidious/views/components/player.ecr +++ b/src/invidious/views/components/player.ecr @@ -63,6 +63,10 @@ <% captions.each do |caption| %> <% end %> + + <% if !chapters.empty? %> + + <% end %> <% end %>