Skip to content
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 "ask to skip" media segment action #4068

Merged

Conversation

nielsvanvelzen
Copy link
Member

Addition to #4052. This one adds a new action "ask to skip". When enabled for a segment type, this action will show a message on-screen to suggest skipping the segment. This only shows when the segment is at least 3 seconds long and the message disappears 1 second before the segment ends or 8 seconds after it is shown. Opening/closing the playback overlay also resets that timer as the skipping functionality is not working when any other UI is open.

The implementation is a bit of a hack as the player UI is partially leanback, partially custom and now partially compose. When we rewrite the player UI with compose we can make it a bit more integrated with less hacks.

Changes

  • Add "ask to skip" media segment action

Screenshots
971000042c

Issues

@nielsvanvelzen nielsvanvelzen added the enhancement New feature or request label Oct 11, 2024
@nielsvanvelzen nielsvanvelzen added this to the v0.18.0 milestone Oct 11, 2024
@@ -86,7 +86,7 @@
import timber.log.Timber;

public class CustomPlaybackOverlayFragment extends Fragment implements LiveTvGuide, View.OnKeyListener {
private VlcPlayerInterfaceBinding binding;
protected VlcPlayerInterfaceBinding binding;

Check notice

Code scanning / Android Lint

Unknown nullness Note

Unknown nullability; explicitly declare as @Nullable or @NonNull to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations
@@ -84,6 +94,8 @@
val action = getDefaultSegmentTypeAction(segment.type)
// Skip the skip action if timespan is too short
if (action == MediaSegmentAction.SKIP && segment.duration < MediaSegmentRepository.SkipMinDuration) return MediaSegmentAction.NOTHING
// Skip the ask to skip action if timespan is too short
if (action == MediaSegmentAction.ASK_TO_SKIP && segment.duration < MediaSegmentRepository.AskToSkipMinDuration) return MediaSegmentAction.NOTHING

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Warning

Line detected, which is longer than the defined maximum line length in the code style.
@nielsvanvelzen nielsvanvelzen merged commit 0537a20 into jellyfin:master Oct 11, 2024
5 checks passed
@nielsvanvelzen nielsvanvelzen deleted the media-segments-ask-to-skip branch October 11, 2024 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants