mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-06-27 07:32:54 +00:00
NavigationHelper: inline trivial getPlayerIntent use
This commit is contained in:
parent
395cea5165
commit
007ff478f7
@ -1166,8 +1166,11 @@ public final class VideoDetailFragment
|
|||||||
final PlayQueue queue = setupPlayQueueForIntent(false);
|
final PlayQueue queue = setupPlayQueueForIntent(false);
|
||||||
tryAddVideoPlayerView();
|
tryAddVideoPlayerView();
|
||||||
|
|
||||||
final Intent playerIntent = NavigationHelper.getPlayerIntent(requireContext(),
|
final Context context = requireContext();
|
||||||
PlayerService.class, queue, true, autoPlayEnabled);
|
final Intent playerIntent =
|
||||||
|
NavigationHelper.getPlayerIntent(context, PlayerService.class, queue)
|
||||||
|
.putExtra(Player.PLAY_WHEN_READY, autoPlayEnabled)
|
||||||
|
.putExtra(Player.RESUME_PLAYBACK, true);
|
||||||
ContextCompat.startForegroundService(activity, playerIntent);
|
ContextCompat.startForegroundService(activity, playerIntent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,17 +99,6 @@ public final class NavigationHelper {
|
|||||||
return intent;
|
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
|
@NonNull
|
||||||
public static <T> Intent getPlayerEnqueueNextIntent(@NonNull final Context context,
|
public static <T> Intent getPlayerEnqueueNextIntent(@NonNull final Context context,
|
||||||
@NonNull final Class<T> targetClazz,
|
@NonNull final Class<T> targetClazz,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user