14987 Commits

Author SHA1 Message Date
christosts
68ca3996aa Update javadoc for ExoPlayer 2.18.3
#minor-release

PiperOrigin-RevId: 509867431
(cherry picked from commit 482871fed4fc84009f6d11af3ad4650bc65cd4bc)
2023-02-16 10:30:06 +00:00
christosts
57bd86125c Update javadoc for ExoPlayer 2.18.3
#minor-release

PiperOrigin-RevId: 509864205
(cherry picked from commit 19d4a588295894fb5d5777e0d12a87cd2c9fc5d5)
2023-02-16 10:30:06 +00:00
christosts
f5d442fddb Update javadoc for ExoPlayer 2.18.3
#minor-release

PiperOrigin-RevId: 509789955
(cherry picked from commit 4759e0075c4a4ac2fe8892147fed1ac341b48c0d)
2023-02-15 12:55:55 +00:00
christosts
7dbc2d4bec Version bump for ExoPlayer 2.18.3 & media3-1.0.0-rc01
#minor-release

PiperOrigin-RevId: 509501665
(cherry picked from commit b18dccde2a1984562ee42e9b058d4a23451b607d)
2023-02-14 18:54:59 +00:00
christosts
f731a46a49 Update release notes for ExoPlayer 2.18.3
#minor-release

PiperOrigin-RevId: 509246479
(cherry picked from commit 8ff024e4c0e3d2085b2c690daddd64b53ca448ad)
2023-02-14 18:54:59 +00:00
bachinger
7269d2a4c2 Publish ConcatenatingMediaSource2
Can be used to combine multiple media items into a single timeline window.

Issue: androidx/media#247
Issue: google/ExoPlayer#4868
PiperOrigin-RevId: 506283307
(cherry picked from commit eb8fffba15810b8206653d8ffaff233d823fbfc9)
2023-02-02 16:47:22 +00:00
christosts
76e87406bb Merge pull request #10793 from fraunhoferfokus:dash-thumbnail-support
PiperOrigin-RevId: 506261584
(cherry picked from commit 107e0c6e42c6fd080b1be19e5305597cf880a9dd)
2023-02-02 16:47:22 +00:00
ibaker
4dfa7ca249 Fix (another) LeanbackPlayerAdapter param name mismatch
I missed this when fixing `positionInMs` for Dackka in d2a3d8f6fa

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 736f090cce540de78a968e62fd8c5aec413e8122)
2023-02-02 13:18:47 +00:00
tonihei
284bf97007 Fix timestamp comparison for seeks in fMP4
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

#minor-release

PiperOrigin-RevId: 505098172
(cherry picked from commit ac3017b5805cb98b4292e4bbe1f7181f47684b88)
2023-02-02 13:18:47 +00:00
michaelkatz
ace97facf2 Match MergingMediaPeriod track selection by period index in id
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 ee055ef004686ddb3844666f9506a95c6e16a59f)
2023-02-02 13:18:46 +00:00
tonihei
b9bb3235c2 Tweak UI behavior when commands are missing.
For most missing commands, we already disable the corresponding
controls. This change extends this to more UI elements that are
disabled in case the corresponding action is unavailable.

#minor-release

PiperOrigin-RevId: 505057751
(cherry picked from commit 641c3b1b22cc67133151b7af9905473485b0f51c)
2023-02-02 13:18:46 +00:00
tonihei
5350d0666e Add missing command checks in UI module
The commands are partly checked already before enabling
features or calling player methods, but the checks were
still missing in many places.

#minor-release

PiperOrigin-RevId: 504589888
(cherry picked from commit 2d7ddccebb959051ae4a284e9c9380cc3582c411)
2023-01-26 14:28:06 +00:00
ibaker
3bb3c602ae Document two limitations with subtitle sideloading
#minor-release

PiperOrigin-RevId: 504517946
(cherry picked from commit f083ff264db8af76a1c9bb14bd72913b2fbb8fe2)
2023-01-26 14:28:06 +00:00
christosts
26c8c552c0 Suppress warnings in ImaUtil
ImaUtil calls VideoProgressUpdate.equals() which is annotated as hidden,
which causes lint errors with gradle.

#minor-release

PiperOrigin-RevId: 504306210
(cherry picked from commit f86948f01c2397b9f53ef598e311e2de9055118e)
2023-01-26 14:28:06 +00:00
christosts
92686b3377 Minor fix in transforming-media.md
PiperOrigin-RevId: 504281747
(cherry picked from commit 4c1be4c7a1eed2eec714cfaf854683c21dbfec93)
2023-01-26 14:27:46 +00:00
kimvde
128fed81ca Undo unreleased changes from transforming-media.md
The "Transforming media" page has been updated with changes that won't
be part of the next release. Undo these changes so that this page is
consistent with the latest release.

PiperOrigin-RevId: 503917637
(cherry picked from commit fdf866617f39261f6b619dd69f56279505ae7466)
2023-01-25 18:29:36 +00:00
ibaker
197109eb69 Explicitly document most Player.Listener methods in terms of getters
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 aa23920e148191f36b4d9f9d1fd9924e13855762)
2023-01-25 18:29:36 +00:00
tonihei
b1693860fa Extend command GET_CURRENT_MEDIA_ITEM to more methods.
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 5e9c9ed2346d7fcb10bfa0ffa5f253d7fdc7acc8)
2023-01-25 18:29:36 +00:00
tonihei
ea1301a531 Correctly filter PlayerInfo by available getter commands.
When bundling PlayerInfo, we need to remove information if the
controller is not allowed to access it. This was only partially
done at the moment.

PiperOrigin-RevId: 502852798
(cherry picked from commit 50f066d63425f44f51108d654006f470d76fb042)
2023-01-25 18:29:36 +00:00
rohks
31aae7782e Fix javadoc references to writeSampleData
PiperOrigin-RevId: 502821506
(cherry picked from commit 8fcd6bbffc6d67cf007d09f0230256b3ed551fd8)
2023-01-25 18:29:36 +00:00
tonihei
7f20729117 Make availableCommands known when bundling PlayerInfo
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 5461d5cbf1cee5bf85bb3b7ae4f4f22c2c2538b8)
2023-01-25 18:29:36 +00:00
Googler
cebc0fa374 Disables play/pause button when there's nothing to play
PiperOrigin-RevId: 502571320
(cherry picked from commit 345f2345c74ccbbf3dd49f125b1b81938b0a9995)
2023-01-25 18:29:36 +00:00
bachinger
4b3c74fb37 Clarify what default settings are being used for SSAI AdsLoader
PiperOrigin-RevId: 502388865
(cherry picked from commit 26e1a28176d8520890802c0a50aec8bc710eb2c3)
2023-01-25 18:29:36 +00:00
bachinger
8f37ad6bf8 Add AdsLoader.focusSkipButton()
This method allows to call through to `StreamManager.focus()` of the currently playing SSAI stream.

PiperOrigin-RevId: 501399144
(cherry picked from commit 0ba0c0ed43fbcf4a57f6fc91829ba00d72e3672f)
2023-01-25 18:29:36 +00:00
bachinger
fc4415bab4 Document that DownloadService needs notification permissions
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 055ed77433944fc31d431d65e09514e8b3e250f1)
2023-01-25 18:29:36 +00:00
bachinger
b1b9c1207b Request notification permission in demo app for API 33+
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 6bacbaac548d612e85647b4d13c22dae0401447e)
2023-01-25 18:29:36 +00:00
bachinger
61eeb8b15e Add focusSkipButtonWhenAvailable to focus UI on ATV
For TV devices the skip button needs to have the focus to be accessible with
the remote control. This property makes this configurable while being set to
true by default.

PiperOrigin-RevId: 501077608
(cherry picked from commit d2898b70ead3b2ad1244a730c3b456146755c138)
2023-01-25 18:29:36 +00:00
tonihei
f4386071d7 Update bandwidth meter estimates
PiperOrigin-RevId: 501010994
(cherry picked from commit 09a15fb73103c406965856de4d120a5028bb37b5)
2023-01-25 18:29:36 +00:00
rohks
0b95e2ca01 Initialise fields used for bundling as String directly
Initialising the fields as Integer and then getting a String on compute
time is slow. Instead we directly initialise these fields as String.
Improves the time taken in bundling PlayerInfo further to less than
200ms from ~300ms.

Also modified a test to improve productive coverage.

PiperOrigin-RevId: 500003935
(cherry picked from commit d49437c6e112e60e9c85edeef73a73bce7de939a)
2023-01-25 18:29:35 +00:00
rohks
f9ae0a6298 Fix typo in DefaultTrackSelector.Parameters field
PiperOrigin-RevId: 499905136
(cherry picked from commit bdd6818c14f97ba305d008c963fd2c369fab312c)
2023-01-25 18:29:35 +00:00
Googler
25e6f628d3 Throw a ParserException instead of a NullPointerException if the sample table (stbl) is missing a required sample description (stsd).
As per the javadoc for AtomParsers.parseTrack, ParserException should be "thrown if the trak atom can't be parsed."

PiperOrigin-RevId: 499522748
(cherry picked from commit bbe78b10c125529d039fea9bf0117cc04d2a3532)
2023-01-25 18:29:35 +00:00
rohks
f3a1f2fa15 Optimise bundling for Timeline.Window and Timeline.Period
Improves the time taken to construct playerInfo from its bundle from ~400 ms to ~300 ms.

Also made `Timeline.Window.toBundle(boolean excludeMediaItem)` public as it was required to assert a condition in tests.

PiperOrigin-RevId: 499512353
(cherry picked from commit 2a77f1e2f96684c8c2e0b27e4118635af0724811)
2023-01-25 18:29:35 +00:00
rohks
fea5eea687 Check bundles in MediaItem to verify keys are skipped
Added another check in each of these tests to make sure we don't add keys to bundle for fields with default values.

Also fixed comments of similar changes in `AdPlaybackStateTest` and `MediaMetadataTest`.

PiperOrigin-RevId: 499463581
(cherry picked from commit 9d431a52ef7a39772f65b8de170a225848be5251)
2023-01-25 18:29:35 +00:00
bachinger
25c964d71d Remove player listener on the application thread of the player
PiperOrigin-RevId: 497183220
(cherry picked from commit 965606f7a7626b95087845191f9b6d4c33ced2e7)
2023-01-25 18:29:35 +00:00
ibaker
1e97da9472 Enable RTL support in the demo app
We might as well keep this enabled by default, rather than having to
manually toggle it on to investigate RTL issues like Issue: androidx/media#227.

PiperOrigin-RevId: 497159744
(cherry picked from commit 010c6b96e74979370f139f8126c176ea7b279313)
2023-01-25 18:29:35 +00:00
ibaker
ee72778a42 Fix order of playback controls in RTL layout
Issue: androidx/media#227

#minor-release

PiperOrigin-RevId: 497159283
(cherry picked from commit 8313af1677507fb0cc51d53e81bf930f1a954c87)
2023-01-25 18:29:35 +00:00
rohks
9b11686ef6 Optimise bundling for AdPlaybackState using AdPlaybackState.NONE
Did not do this optimisation for `AdPlaybackState.AdGroup` as its length is zero for `AdPlaybackState` with no ads.

No need to pass default values while fetching keys, which we always set in `AdPlaybackState.AdGroup.toBundle()`.

PiperOrigin-RevId: 496995048
(cherry picked from commit f2eac2df711cad579f3042568a24c1f51a119428)
2023-01-25 18:29:35 +00:00
rohks
e4fa94abe3 Check MediaMetadata bundle to verify keys are skipped
Added another check in test to make sure we don't add keys to bundle for fields with `null` values.

PiperOrigin-RevId: 496948705
(cherry picked from commit 890fd0a9fb135e938dc465d936b24065c65dbb98)
2023-01-25 18:29:35 +00:00
bachinger
0417dbae78 Bump IMA SDK version to 3.29.0
Issue: google/ExoPlayer#10845
PiperOrigin-RevId: 496947392
(cherry picked from commit 8ed515880a0b6c05b766e868e2ef931b886925cc)
2023-01-25 18:29:35 +00:00
bachinger
a212bc9bb1 Update migration script
Issue: google/ExoPlayer#10854
PiperOrigin-RevId: 496922055
(cherry picked from commit 8e9f83867b5c9536488cf74f06c4cf2535ef848f)
2023-01-25 18:29:35 +00:00
ibaker
3cb0195c18 Fix recursive loop when registering controller visibility listeners
There are two overloads of this method due to a type 'rename' from
`PlayerControlView.VisibilityListener` to
`PlayerView.ControllerVisibilityListener`. Currently when you call one
overload it passes `null` to the other one (to clear the other listener).
Unfortunately this results in it clearing itself, because it receives
a null call back!

This change tweaks the documentation to clarify that the 'other'
listener is only cleared if you pass a non-null listener in. This solves
the recursive problem, and allows the 'legacy' visibility listener to be
successfully registered.

Issue: androidx/media#229

#minor-release

PiperOrigin-RevId: 496876397
(cherry picked from commit 37fd65a8e51ddba92584109217114d9f2c2f009d)
2023-01-25 18:29:35 +00:00
tonihei
7afdc9edae Add error messages to correctness assertions in SimpleBasePlayer
Users of this class may run into these assertions when creating the
State and they need to check the source code to understand why
the State is invalid. Adding error messages to all our correctness
assertions helps to understand the root cause more easily.

PiperOrigin-RevId: 496875109
(cherry picked from commit b7e887a58dff7615926f8002ee3210b3071c5537)
2023-01-25 18:29:35 +00:00
ibaker
de203fe084 Document the relationship between Player methods and available commands
#minor-release

PiperOrigin-RevId: 496668378
(cherry picked from commit 54e79689e925a2a18bc02522d4f7f73dcfb35d83)
2023-01-25 18:29:35 +00:00
ibaker
730f3a3a64 Clarify some Player command and method javadoc
#minor-release

PiperOrigin-RevId: 496661152
(cherry picked from commit f47ad3c2d097a557bd2222a5b104e7867aef585d)
2023-01-25 18:29:35 +00:00
ibaker
beeb6e7eed Fix Dackka error due to param name mismatch
https://developer.android.com/reference/androidx/leanback/media/PlayerAdapter#seekTo(long)

#minor-release

PiperOrigin-RevId: 496378709
(cherry picked from commit d2a3d8f6fabb6d22ac28a76379725d0915344cba)
2023-01-25 18:29:35 +00:00
ibaker
65daec3596 Remove ellipsis from Player javadoc
PiperOrigin-RevId: 496377192
(cherry picked from commit 844428ea329754118b8c0a2d58373415f539d725)
2023-01-25 18:29:35 +00:00
tonihei
2c17c6ef04 Add playlist and seek operations to SimpleBasePlayer
These are the remaining setter operations. They all share the same
logic that handles playlist and/or position changes. The logic to
create the placeholder state is mostly copied from ExoPlayerImpl's
maskTimelineAndPosition and getPeriodPositonUsAfterTimelineChanged.

PiperOrigin-RevId: 496364712
(cherry picked from commit 09d37641d1ef3b8cf26dc39cfcd317ebe3ef5c79)
2023-01-25 18:29:35 +00:00
tonihei
0ab7c752d7 Check if codec still exists before handling tunneling events
The tunneling callbacks are sent via Handler messages and may be
handled after the codec/surface was changed or released.

We already guard against the codec/surface change condition by
creating a new listener and verifying that the current callback
happens for the correct listener instance, but we don't guard
against a released codec yet.

PiperOrigin-RevId: 495882353
(cherry picked from commit 5e23b8bfd5a9a9542c2ab8d23ae51c1689d8ff51)
2023-01-25 18:29:34 +00:00
tonihei
f1784862e0 Clarify behavior for out-of-bounds indices and align implementations
Some Player methods operate relative to existing indices in the
playlist (add,remove,move,seek). As these operations may be issued
from a place with a stale playlist (e.g. a controller that sends
a command while the playlist is changing), we have to handle out-
of-bounds indices gracefully. In most cases this is already
documented and implemented correctly. However, some cases are not
documented and the existing player implementations don't handle
these cases consistently (or in some cases not even correctly).

PiperOrigin-RevId: 495856295
(cherry picked from commit a1c0b10482baffc3721561446ee4bb788d8a1231)
2023-01-25 18:29:34 +00:00
rohks
4b7a005340 Rename EMPTY_MEDIA_ITEM to PLACEHOLDER_MEDIA_ITEM
The `MediaItem` instances in the following cases are not actually empty but acts as a placeholder. `EMPTY_MEDIA_ITEM` can also be confused with `MediaItem.EMPTY`.

PiperOrigin-RevId: 495843012
(cherry picked from commit 74559b4a188e476378f3f0df908598ce763d909a)
2023-01-25 18:29:34 +00:00