1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-06-26 15:13:00 +00:00

NavigationHelper: inline trivial getPlayerIntent use

This commit is contained in:
Profpatsch 2025-05-04 21:01:22 +02:00
parent 395cea5165
commit 007ff478f7
2 changed files with 5 additions and 13 deletions

View File

@ -1166,8 +1166,11 @@ public final class VideoDetailFragment
final PlayQueue queue = setupPlayQueueForIntent(false);
tryAddVideoPlayerView();
final Intent playerIntent = NavigationHelper.getPlayerIntent(requireContext(),
PlayerService.class, queue, true, autoPlayEnabled);
final Context context = requireContext();
final Intent playerIntent =
NavigationHelper.getPlayerIntent(context, PlayerService.class, queue)
.putExtra(Player.PLAY_WHEN_READY, autoPlayEnabled)
.putExtra(Player.RESUME_PLAYBACK, true);
ContextCompat.startForegroundService(activity, playerIntent);
}

View File

@ -99,17 +99,6 @@ public final class NavigationHelper {
return intent;
}
@NonNull
public static <T> Intent getPlayerIntent(@NonNull final Context context,
@NonNull final Class<T> targetClazz,
@Nullable final PlayQueue playQueue,
final boolean resumePlayback,
final boolean playWhenReady) {
return getPlayerIntent(context, targetClazz, playQueue)
.putExtra(Player.PLAY_WHEN_READY, playWhenReady)
.putExtra(Player.RESUME_PLAYBACK, resumePlayback);
}
@NonNull
public static <T> Intent getPlayerEnqueueNextIntent(@NonNull final Context context,
@NonNull final Class<T> targetClazz,