straw/app/src/main/java/org/schabi/newpipe/player
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
..
datasource Adapt YoutubeHttpDataSource to extractor changes and improve requests 2025-01-31 22:50:10 +01:00
event feat: add language selector to audio player 2023-03-19 01:15:36 +01:00
gesture Bump compileSdk to 34 2023-12-23 11:38:32 +01:00
helper Try to bind to PlayerService when MainActivity starts 2025-02-18 17:49:38 +01:00
mediabrowser Fix loading remote playlists in media browser 2025-02-16 21:44:50 +01:00
mediaitem Fix crash with disabled thumbnails when trying to play a stream 2023-12-10 15:12:38 +01:00
mediasession Instantiate media session and connector in PlayerService 2025-02-16 21:40:13 +01:00
mediasource Update to ExoPlayer 2.18.3 2023-02-23 12:46:05 +01:00
notification Migrate to non-transitive R classes 2024-03-29 00:17:13 +01:00
playback Apply code review suggestions. 2023-01-04 06:10:14 +05:30
playqueue Allow creating PlayQueue from ListInfo and index 2025-02-16 21:40:47 +01:00
resolver fix: audio stream cache key, code fmt 2023-05-01 00:04:04 +02:00
seekbarpreview Formatting changes (back to original) 2024-10-27 14:38:25 +01:00
ui Properly stop PlayerService 2025-02-16 21:44:49 +01:00
AudioServiceLeakFix.java Improve code style to be more consistent 2020-04-02 15:57:50 +02:00
Player.java Properly stop PlayerService 2025-02-16 21:44:49 +01:00
PlayerService.java Properly stop PlayerService 2025-02-16 21:44:49 +01:00
PlayerType.java Move PlayerType into its own class and add documentation 2022-07-13 23:33:18 +02:00
PlayQueueActivity.java Have PlayerService implement MediaBrowserServiceCompat 2025-02-16 21:36:59 +01:00