- 02 Feb, 2023 10 commits
-
-
This change includes 3 things: - when the legacy media session is created, FLAG_HANDLES_QUEUE_COMMANDS is advertised if the player has the COMMAND_CHANGE_MEDIA_ITEMS available. - when the player changes its available commands, a new PlaybackStateCompat is sent to the remote media controller to advertise the updated PlyabackStateCompat actions. - when the player changes its available commands, the legacy media session flags are sent accoridingly: FLAG_HANDLES_QUEUE_COMMANDS is set only if the COMMAND_CHANGE_MEDIA_ITEMS is available. #minor-release PiperOrigin-RevId: 506605905 (cherry picked from commit ebe7ece1)
christosts committed -
PiperOrigin-RevId: 506261584 (cherry picked from commit c6569a36)
christosts committed -
I missed this when fixing `positionInMs` for Dackka in https://github.com/androidx/media/commit/aae6941981dfcfcdd46544f585335ff26d8f81e9 This time I manually verified that all the `@Override` methods have parameter names that match [the docs](https://developer.android.com/reference/androidx/leanback/media/PlayerAdapter). #minor-release PiperOrigin-RevId: 506017063 (cherry picked from commit d1a27bf2)
ibaker committed -
This change fixes an issue that can be reproduced when a controller `onConnect` creates a `QueueTimeline` out of the state of a legacy session and then `prepare` is called. `activeQueueItemId`, `metadata` and the `queue` of the legacy session are used when a `QueueTimeline` is created. The change adds unit tests to cover the different combinatoric cases these properties being set or unset. PiperOrigin-RevId: 505731288 (cherry picked from commit 4a9cf7d0)
bachinger committed -
When seeking in fMP4, we try to extract as little samples as possible by only starting at the preceding sync frame. This comparison should use <= to allow sync frames at exactly the seek position. Issue: google/ExoPlayer#10941 PiperOrigin-RevId: 505098172 (cherry picked from commit 00436a04)
tonihei committed -
MergingMediaPeriod creates its track groups with ids concatenating position in its periods array and the underlying child track group id. The ids can be used in selectTracks for matching to periods list. Issue: google/ExoPlayer#10930 PiperOrigin-RevId: 505074653 (cherry picked from commit 542a1ef0)
michaelkatz committed
-
- 26 Jan, 2023 7 commits
-
-
This was missed in https://github.com/androidx/media/commit/47349b8c4bd69415da8895061be71ef748c4a2d3 #minor-release PiperOrigin-RevId: 504548659 (cherry picked from commit 50beec56)
ibaker committed -
ImaUtil calls VideoProgressUpdate.equals() which is annotated as hidden, which causes lint errors with gradle. #minor-release PiperOrigin-RevId: 504306210 (cherry picked from commit 5f6e172c)
christosts committed -
Created unified MediaUtils method to handle various logic for calling Player.setMediaItems from MediaSessionStub and MediaSessionLegacyStub PiperOrigin-RevId: 504271877 (cherry picked from commit 7fbdbeb6)
michaelkatz committed -
PiperOrigin-RevId: 504013985 (cherry picked from commit 51470117)
christosts committed
- 25 Jan, 2023 23 commits
-
-
Added onSetMediaItems callback listener to allow the session to modify/set MediaItem list, starting index and position before call to Player.setMediaItem(s). Added conditional check in MediaSessionStub.setMediaItem methods to only call player.setMediaItem rather than setMediaItems if player does not support COMMAND_CHANGE_MEDIA_ITEMS PiperOrigin-RevId: 503427927 (cherry picked from commit bb11e028)
michaelkatz committed -
This makes it implicitly clear that if the value of a getter changes due to a change in command availability then the listener will be invoked, without needing to explicitly document every command on every listener method. #minor-release PiperOrigin-RevId: 503178383 (cherry picked from commit 280889bc)
ibaker committed -
We stop estimating new position when pausing until we receive a new position from the player. However, this means that we will continue to return a possible stale previous position. Updating the current position before pausing solves this issue. PiperOrigin-RevId: 503153982 (cherry picked from commit e961c1b5)
tonihei committed -
We currently only document it for the getCurrentMediaItem(), but the command was always meant to cover all information about the current media item and the position therein. To correctly hide information for controllers, we need to filter the Timeline when bundling the PlayerInfo class if only this command is available. PiperOrigin-RevId: 503098124 (cherry picked from commit f15b7525)
tonihei committed -
When bundling PlayerInfo, we remove data when the controller is not allowed to access this data via getters. We also remove data for performance reasons. In the toBundle() method, it's currently hard to make the connection between allowed commands and filtering, because the values are checked at a different place. This can be made more readable by forwarding the applicable Commands directly. The only functional fix is to filter the Timeline when sending the first PlayerInfo after a connecting a controller if the command to get the Timeline is not available. This also allows us to remove a path to filter MediaItems from Timelines as it isn't used. PiperOrigin-RevId: 502607391 (cherry picked from commit c90ca7ba)
tonihei committed -
PlayerWrapper advertises PlaybackStateCompat actions to the legacy MediaSession based on the player's available commands. PiperOrigin-RevId: 502559162 (cherry picked from commit 39f4a17a)
christosts committed -
PiperOrigin-RevId: 502407886 (cherry picked from commit 6ce3421c)
tianyifeng committed -
The method to dispatch actions in MediaControllerImplBase takes a Player.Command, but the value is only used to check if we are setting a surface and need to handle the special blocking call. This can be cleaned up by removing the parameter and calling a dedicated blocking method where needed. This also ensures we have to mention the relevant Player.Command only once in each method. PiperOrigin-RevId: 502341862 (cherry picked from commit 664ab72d)
tonihei committed -
This fix applies to Android 12 and above. In this fix, the `MediaSessionService` will try to start in the foreground before the session playback resumes, if ForegroundServiceStartNotAllowedException is thrown, then the app can handle the exception with their customized implementation of MediaSessionService.Listener.onForegroundServiceStartNotAllowedException. If no exception thrown, the a media notification corresponding to paused state will be sent as the consequence of successfully starting in the foreground. And when the player actually resumes, another media notification corresponding to playing state will be sent. PiperOrigin-RevId: 501803930 (cherry picked from commit 0d0cd786)
tianyifeng committed -
Starting with Android 13 (API 33) an app needs to request the permission to post notifications or notifications are suppressed. This change documents this in the class level JavaDoc of the `DownloadService`. Issue: google/ExoPlayer#10884 PiperOrigin-RevId: 501346908 (cherry picked from commit 20aa5bd9)
bachinger committed -
Starting with API 33 the POST_NOTIFICATION permission needs to be requested at runtime or the notification is not shown. Note that with an app with targetSdkVersion < 33 but on a device with API 33 the notification permission is automatically requested when the app starts for the first time. If the user does not grant the permission, requesting the permission at runtime result in an empty array of grant results. Issue: google/ExoPlayer#10884 PiperOrigin-RevId: 501320632 (cherry picked from commit 6484c14a)
bachinger committed
-