-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add chapter markings to video player slider #3745
Conversation
These labels show the start of each chapter when interacting with the slider the same way that activates the slider bubble. They follow the same color scheme as the slider (watched chapters turn blue). Inspired by https://features.jellyfin.org/posts/397/chapter-markers-in-timeline
Allows easier customisation of what icon should be displayed.
In order to use different icons depending on the chapter name, the name is provided as a class with the prefix scm-.
if (!bubbleTrackRect.width || !chapterMarkRect.width) { | ||
// width is not set, most probably because the OSD is currently hidden | ||
return; | ||
} | ||
|
||
let chapterMarkPos = (bubbleTrackRect.width * valueChapterMark / 100) - chapterMarkRect.width / 2; | ||
chapterMarkPos = Math.min(Math.max(chapterMarkPos, - chapterMarkRect.width / 2), bubbleTrackRect.width - chapterMarkRect.width / 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that's why you did showOsd
in getChapterFractions
.
What about resizing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the early return if the width is 0 was just meant to prevent recalculating the marker positions even if the OSD is hidden. This lead to noticeable jumps of the markers when the OSD is shown again and the width is correct again.
About the resizing: Could you elaborate?
Do you mean if the positioning can handle a resize during playback? If so, then yes, as long as updateValues
is continued to be called.
More generic name without the inclusion of "chapters" allows potential reuse in the future.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First off this is a really cool feature! 🎉
I did not finish reviewing the emby-slider.js
changes, because I'm not a fan of how the hiding works currently. I think the markers should just be lines that show up inline with the slider that are just visible anytime the slider is shown. The large icons make me think I should be able to click them, and they are kind intrusive and difficult to get to display.
That looks great! |
Now, the markers are displayed as ticks instead of icons above the slider
Alright, I added the changed CSS. Concerning the hiding / positioning, I am open to any suggestions to improve it |
The changes look great! I think I would just leave the markers visible when the OSD is shown instead of requiring hover. |
(Does not require hovering over the slider anymore.)
Good suggestion, saves a bit of code... and done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! I just had a couple naming suggestions.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
I really want this feature but I noticed it's not in any release since being merged to master over a year ago, certainly not available in the 10.8 version I'm currently using. I am not familiar with Jellyfin's process, so I hope it's not too much trouble to ask what the ETA for something like this is? |
Motivation
I wanted to be able to see when movie chapters start without moving the slider bubble through the whole timeline. Also inspired by this feature request.
Changes
What it looks like
(shown with the Jungle Book from the demo server)
Possible next steps
The customisation "per-chapter" could define some default CSS values to use different icons for common chapter "types", e.g.: