-
-
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 media segment skipping #6157
Conversation
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.
ESLint doesn't pass. Please fix all ESLint issues.
private debouncedOnTimeUpdate = throttle(this.handleSegmentActions, 500, { leading: true }); | ||
|
||
private async fetchMediaSegments(api: Api, itemId: string, includeSegmentTypes: MediaSegmentType[]) { | ||
// FIXME: Replace with SDK getMediaSegmentsApi function when available in stable |
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.
Unexpected 'fixme' comment: 'FIXME: Replace with SDK...'. no-warning-comments
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 dependent on the media segment api being available in the stable sdk release.
9a4420b
to
91de060
Compare
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.
ESLint doesn't pass. Please fix all ESLint issues.
Just some things I noted when testing:
|
From my initial testing, this reliably skips intros, but it has not skipped outros or previews. I'm going to create some test media so I can test the other segment types. |
It looks like all segments after the first will not be skipped because
|
91de060
to
54713f9
Compare
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.
ESLint doesn't pass. Please fix all ESLint issues.
The latest commit is skipping intro, outro, and preview segments reliably. I haven't gotten a chance to create test media with other segment types, but I don't see why those wouldn't also skip. |
I created some test media for recap and commercial segments, which were also skipped. |
54713f9
to
f4c1684
Compare
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.
ESLint doesn't pass. Please fix all ESLint issues.
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.
ESLint doesn't pass. Please fix all ESLint issues.
These are great points.
Good idea. I think this makes sense as an enhancement. We should align on the desired behavior with other client implementations (Android TV).
I can definitely see this on my unstable server where I have assigned very limited resources. I wonder if just a toast message when skipping starts would be good enough for now. 🤔 |
This is how I defined the behavior for the skip action in ATV, from https://github.com/jellyfin/jellyfin-androidtv/blob/master/app/src/main/java/org/jellyfin/androidtv/ui/playback/segment/MediaSegmentAction.kt#L15-L16
|
This comment was marked as outdated.
This comment was marked as outdated.
cb9e1e4
to
7c4962d
Compare
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.
ESLint doesn't pass. Please fix all ESLint issues.
I suggest adding a configurable buffer time (e.g., 2 seconds) at the start and end of segments to prevent accidental content skipping. |
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.
Haven't tested - just reviewed. 😅
Am I right, it will skip the "outro" even we seek to it?
Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>
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.
ESLint doesn't pass. Please fix all ESLint issues.
Quality Gate passedIssues Measures |
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.
ESLint doesn't pass. Please fix all ESLint issues.
Cloudflare Pages deployment
|
I just pushed a change that should bring the behavior inline with what Niels implemented for Android TV... I hope. 🤞 If you seek forward into a segment it will take the action as normal. If your previous player time is later than the start time of the segment no action is taken. I made this behavior specific to the skip action because I think for others (prompting) it might still make sense to invoke the action. 🤷♂️ |
Skipping seems to work mostly as I'd expect except for one issue that I encountered. When I choose to skip outros and manually seek into an outro segment, it will be skipped. My expectation would be that manually seeking into it will not trigger the skip. Otherwise it doesn't have some bugs that the current ATV implementation has, so that's great. (In ATV skipping to the end of the video will close the player instead of going to the next queue item :p) |
Yeah using the current time base approach we can only detect if we skip back into a segment not forward... I don't think we currently have any better way to detect when we have skipped unless we check if the difference between playtime updates is greater than some threshold. 🤷♂️ |
Perhaps we could only trigger the skip if the current time is close to |
We will probably perform bigger steps with increased playback rate, and difference will depend on that. The most reliable way is to add some extra flag to the |
I was thinking we could add an event on seeking in the playback manager and use that to ignore the segment if the next time update falls in one... My question is if the current implementation is "good enough" for the initial PR or if this should be added before merging. 🤷♂️ I'm hoping to get this in for the next unstable build. |
IMO current state is good enough to merge and we can improve upon it in 10.10.z releases. |
needs stable sdk update
I've installed the "Chapter Segments" plugin and succesfully ran the "media segment scan" . For example, it was succesful for the below series episode.
When using https://cdb680bb.jellyfin-web.pages.dev/ to play this episode, i see the intro is recognized in the timeline However, i don't get popup to skip the intro when the series progresses into that segment. How should this look like / behave? |
You need to select an action for the segment type in |
Ah got it, thanks. It works as expected. I also notice that the transcoding is apparently taking it into account, since i don't notice the usual delay (which i would notice when manually skipping through the media). Nice! |
Just a thought: perhaps introduce a global setting for skipping behaviour per segment type, which users can overwrite when they choose to. Reason: i don't see my non-techy family members enabling the skip behaviour. |
Upon further testing, intro skipping sometimes does cause a tempory freeze due to transcoding. For a future update, it would be nice if transcoding would skip the intro anyway if the user setting is set to skip. |
Changes
Needs cleanup + testing so marking as a draft for now
Issues
N/A