mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-06 03:50:22 +02:00
NavigationHelper: inline trivial getPlayerIntent use
This commit is contained in:
parent
b592403a66
commit
e14ec3a4f9
2 changed files with 5 additions and 13 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue