straw/app/src/main/java/org/schabi/newpipe
Stypox bfb658763c Try to bind to PlayerService when MainActivity starts
Fixes mini-player not appearing on app start if the player service is already playing something.

The PlayerService (and the player) may be started from an external intent that does not involve the MainActivity (e.g. RouterActivity or Android Auto's media browser interface).
This PR tries to bind to the PlayerService as soon as the MainActivity starts, but only does so in a passive way, i.e. if the service is not already running it is not started.
Once the connection between PlayerHolder and PlayerService is setup, the ACTION_PLAYER_STARTED broadcast is sent to MainActivity so that it can setup the bottom mini-player.
Another important thing this commit does is to check whether the player is open before actually adding the mini-player view, since the PlayerService could be bound even without a running player (e.g. Android Auto's media browser is being used). This is a consequence of commit "Drop some assumptions on how PlayerService is started and reused".
2025-02-18 17:49:38 +01:00
..
about Replaced `Icepick with Bridge and Android-State` 2024-10-23 21:28:07 +02:00
database Add StreamHistoryEntry.toStreamInfoItem() 2025-02-16 21:40:55 +01:00
download Replaced `Icepick with Bridge and Android-State` 2024-10-23 21:28:07 +02:00
error ErrorActivity: add Timestamp and Package/Service to markdown export 2025-01-21 16:25:54 +01:00
fragments Fix naming in VideoDetailFragment: video->stream, videoUrl->url 2025-01-27 14:52:35 +01:00
info_list Update app/src/main/java/org/schabi/newpipe/info_list/dialog/StreamDialogDefaultEntry.java 2024-10-27 09:41:45 +01:00
ktx Drop some assumptions on how PlayerService is started and reused 2025-02-15 17:48:19 +01:00
local Add getPlaylist(id) to RemotePlaylistManager 2025-02-16 21:40:36 +01:00
player Try to bind to PlayerService when MainActivity starts 2025-02-18 17:49:38 +01:00
settings Merge pull request #11738 from cillyvms/a13-player-notifs 2024-11-27 19:12:19 +01:00
streams Fix downloading/exporting when overwriting file would not truncate 2024-11-24 18:36:54 +01:00
util Drop some assumptions on how PlayerService is started and reused 2025-02-15 17:48:19 +01:00
views Replaced `Icepick with Bridge and Android-State` 2024-10-23 21:28:07 +02:00
App.java Connect poToken generation to extractor 2025-01-31 21:47:45 +01:00
BaseFragment.java Replaced `Icepick with Bridge and Android-State` 2024-10-23 21:28:07 +02:00
DownloaderImpl.java DownloaderImpl: Auto-close resources and simplify header setting 2025-01-31 12:36:27 +01:00
ExitActivity.java Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
MainActivity.java Try to bind to PlayerService when MainActivity starts 2025-02-18 17:49:38 +01:00
NewPipeDatabase.java Merge branch 'dev' into pr8221 2024-03-29 18:08:31 +01:00
NewVersionWorker.kt Convert isReleaseApk to lazy value 2024-03-20 14:00:13 +01:00
PanicResponderActivity.java Clean up pre-Lollipop checks 2022-07-13 19:02:24 +02:00
QueueItemMenuUtil.java Support obtaining multiple images from the extractor 2023-09-22 09:57:33 +02:00
RouterActivity.java Replaced `Icepick with Bridge and Android-State` 2024-10-23 21:28:07 +02:00