1561 Commits

Author SHA1 Message Date
olly
5d7641c6f1 Fix some lint warnings
PiperOrigin-RevId: 424383900
2022-01-28 09:37:06 +00:00
ibaker
a89a08f99f Reformat some README files
PiperOrigin-RevId: 424366617
2022-01-28 09:26:25 +00:00
olly
cc144f5875 Fix 1 ErrorProneStyle finding:
* @CryptoType is a TYPE_USE annotation, so should appear after modifiers and directly before the type.
  (see go/java-style#s4.8.5-annotations)

This CL looks good? Just LGTM and Approve it!
This CL doesn’t look good? This is what you can do:
* Revert this CL, by replying "REVERT: <provide reason>"
* File a bug under go/error-prone-bug for category ErrorProneStyle if the change looks generally problematic.
* Revert this CL and not get a CL that cleans up these paths in the future by
replying "BLOCKLIST: <provide reason>". This is not reversible! We recommend to
opt out the respective paths in your CL Robot configuration instead:
go/clrobot-opt-out.

This CL was generated by CL Robot - a tool that cleans up code findings
(go/clrobot). The affected code paths have been enabled for CL Robot in //depot/google3/java/com/google/android/libraries/media/METADATA which is reachable following include_presubmits from //depot/google3/third_party/java_src/android_libs/media/METADATA.
Anything wrong with the signup? File a bug at go/clrobot-bug.

#codehealth

Tested:
    Local presubmit tests passed.

PiperOrigin-RevId: 423821355
2022-01-25 19:49:34 +00:00
bachinger
121592a41d Include audio metadata with DefaultMediaItemConverter for Cast
This change adds more standard metadata fields to Cast metadata including the artwork URL that makes the cast device show the artwork in the Cast route dialog (https://screenshot.googleplex.com/uj4n4Jqd7it9bob) and the Cast device.

This change also discriminates between media with an audio MIME type and others. For audio MIME type the Cast metadata is set to MEDIA_TYPE_MUSIC_TRACK which changes the layout and shows artwork and additional audio meta data to be displayed (https://screenshot.googleplex.com/ASy3KDcsTdJDM2T).

Issue: google/ExoPlayer#9663
PiperOrigin-RevId: 422589957
2022-01-25 18:37:25 +00:00
ibaker
ba58be2c41 Add an anchor tag for the IMA compat URL in ImaAdsLoader javadoc
The naked URL is not hyperlinked by the javadoc compiler, meaning a user
is forced to awkwardly copy it into the address bar of their browser:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.html

#minor-release

PiperOrigin-RevId: 422320571
2022-01-17 14:27:04 +00:00
ibaker
103b170a56 Rename some references from PlayerView to LegacyPlayerView
These were missed in 46ab94bd41

These references will be re-written to PlayerView when exporting to
exoplayer2, so this commit results in some small reformatting changes.

Also fix a reference to LegacyPlayerControlView that should be
StyledPlayerControlView.

PiperOrigin-RevId: 420707706
2022-01-10 12:53:59 +00:00
bachinger
a8e44294ab Include mediaId when marshalling a MediaItem to JSON
When sending a MediaItem to a MediaSession with a Media3 MediaController important information is removed for privacy reason. To look up the fully populated MediaItem the mediaId is used as a key. Hence having the mediaId marhalled to the JSON representation that is sent to a Cast device enables app developers to use the same look up facilities.

#minor-release

PiperOrigin-RevId: 420022868
2022-01-07 16:35:12 +00:00
olly
a9edb207a3 Fix 1 ErrorProneStyle finding:
* @CryptoType is a TYPE_USE annotation, so should appear after modifiers and directly before the type.

PiperOrigin-RevId: 418814902
2022-01-04 17:17:13 +00:00
bachinger
aa467f52e4 Make sure CastPlayer calls onIsPlaying if required
Before this change we checked whether the playback state and playWhenReady have changed when the state from the cast device arrived. If we detected such a change we called the listener callback `onIsPlayingChanged`. However, in the case when `setPlayWhenReady(boolean)` is called on 'CastPlayer', we mask the change in `playWhenReady`, then send the play/pause request to the cast device and when the state from the cast device arrives we never detect a change because we have already masked `playWhenReady`.

This change now moves the check for `isPlaying` to the same place where the state and playWhenReady is updated, so we call the `onIsPlayingChanged` callback in either case, when masking or when a changed state from the server arrives.

Issue: google/ExoPlayer#9792
PiperOrigin-RevId: 418483509
2022-01-04 14:00:44 +00:00
ibaker
5e8d1eb7f3 Add MediaSource.Factory and deprecate MediaSourceFactory
This more closely matches the pattern we have for all implementations
except DefaultMediaSourceFactory (e.g. ProgressiveMediaSource.Factory)
and other factory interfaces like (Http)DataSource.Factory.

PiperOrigin-RevId: 417826803
2022-01-04 12:51:47 +00:00
ibaker
4bf7ffd9a7 Move ImaAdsLoader Player.Listener implementation to internal class
PiperOrigin-RevId: 416613846
2021-12-16 10:17:18 +00:00
bachinger
9316b4f49b Add helper method to split the AdPlaybackState
PiperOrigin-RevId: 416543473
2021-12-16 10:13:45 +00:00
bachinger
a92e48e5f8 Support IMA DAI streams for HLS
PiperOrigin-RevId: 414804513
2021-12-10 16:21:51 +00:00
krocard
97206b9c72 Add a builder to DefaultAudioSink
`DefaultAudioSink` already has 3 telescoping
constructors and an other one would be have been
needed to add a buffer size tuning option.

PiperOrigin-RevId: 414703366
2021-12-08 10:01:38 +00:00
ibaker
5c2f618613 Migrate usages of Timeline#getPeriodPosition to getPeriodPositionUs
#minor-release

PiperOrigin-RevId: 414671861
2021-12-08 10:01:38 +00:00
bachinger
bbec6bcec2 Make mapping of STATE_IDLE configurable
PiperOrigin-RevId: 413922123
2021-12-06 12:51:04 +00:00
olly
b7296bc363 Upgrade Cast dependency for Android 12 compatibility
#minor-release
Issue: google/ExoPlayer#9528
PiperOrigin-RevId: 413887784
2021-12-06 12:47:33 +00:00
tonihei
d53d51d57c Add optional id to TrackGroup.
This allows to give TrackGroups an identifier. The underlying goal is
to provide a way to make otherwise identical TrackGroups
distinguishable.

Also set this id in all internal sources that may produce identical
TrackGroups in certain edge cases.

Issue: google/ExoPlayer#9718
PiperOrigin-RevId: 413430719
2021-12-02 15:21:33 +00:00
tonihei
92507e02f7 Remove ExoPlayerImpl inheritance from BasePlayer.
This inheritance is really confusing because ExoPlayerImpl is not
a full Player interface implementation. It also claims to be an
ExoPlayer implementation in the Javadoc which isn't true in its
current state.

Removing the inheritance also allows to clean up some unused methods.

PiperOrigin-RevId: 411756963
2021-11-26 15:33:01 +00:00
bachinger
ff9585f153 Provide an opt-out from clearing media items on stop
After removing the deprecated call to player.stop(/* reset= */ true) and instead using two calls to the player, overridding stop in a ForwardingPlayer does not help to avoid clearing the player. To remove the deprecation we need an option so that users who want not to clear the player have a way to do so.

PiperOrigin-RevId: 411518090
2021-11-26 15:00:59 +00:00
olly
67e1499956 Fixes for some minor misc issues
- Unnecessary deprecation suppressions
- Dead code
- Broken Javadoc

PiperOrigin-RevId: 409357884
2021-11-15 10:58:32 +00:00
olly
12c0aa2ec9 Update dependency versions
Note: Updating androidxTestTruthVersion is required tot
arget API level 31.
PiperOrigin-RevId: 409167744
2021-11-15 10:53:47 +00:00
olly
8fb0af83f5 Use stop(boolean) in MediaSessionConnector 2021-11-08 10:08:24 +00:00
ibaker
08d827f2ed Migrate usages of deprecated MediaItem symbols
#minor-release

PiperOrigin-RevId: 407847729
2021-11-08 09:48:45 +00:00
olly
a9f7b943c8 Prepare for adding ServerSideInsertedAdsMediaSource for IMA
PiperOrigin-RevId: 407274072
2021-11-03 15:16:58 +00:00
tonihei
1ed5861a72 Suppress lint warnings in leanback module.
These warnings are caused by the fact that this is a library and the
lint check doesn't see any app using the library in a TV context.

PiperOrigin-RevId: 407110725
2021-11-03 15:02:49 +00:00
ibaker
7de079493c Migrate usages of Window-based Player methods
Where this introduced an inconsistency (e.g. assigning to something
called `windowIndex`), I generally renamed the transitive closure of
identifiers to maintain consistency (meaning this change is quite
large). The exception is code that interacts with Timeline and Window
directly, where sometimes I kept the 'window' nomenclature.

#minor-release

PiperOrigin-RevId: 407040052
2021-11-02 12:08:18 +00:00
tonihei
8e03a0653a Suppress lint warning about wrong IntDef usage in media2 Utils
AudioAttributesCompat.AttributeUsage and C.AudioUsage use equivalent values and can be directly assigned.

PiperOrigin-RevId: 406815447
2021-11-01 16:48:41 +00:00
olly
8e2083a27b Remove dependency from common tests to exoplayer
PiperOrigin-RevId: 406354526
2021-11-01 09:54:23 +00:00
bachinger
7975182856 Make package in test manifest consistent
PiperOrigin-RevId: 406255369
2021-10-29 11:35:26 +01:00
ibaker
1c824561c6 Migrate callers of deprecated C.java methods to Util.java
#minor-release

PiperOrigin-RevId: 406166670
2021-10-29 11:31:50 +01:00
ibaker
ad39f38995 Update most Player parameter & doc references from Window to MediaItem
Only deprecated references remain.

Usages of the deprecated methods will be migrated in a follow-up change.

#minor-release

PiperOrigin-RevId: 405927141
2021-10-29 11:21:00 +01:00
ibaker
9c9671a0af Remove all references to @NonNull
Our package-info.java files are annotated with @NonNullApi which results
in everything being non-null by default, so this annotation is never
needed.

#minor-release

PiperOrigin-RevId: 405864737
2021-10-29 11:03:05 +01:00
andrewlewis
0ad1cdbfa1 Tidy READMEs
PiperOrigin-RevId: 405598530
2021-10-26 14:08:21 +01:00
olly
101b94f874 Remove dependency from opus module to extractor module
PiperOrigin-RevId: 405429757
2021-10-25 21:35:39 +01:00
olly
2dc7ac3851 Upgrade RTMP dependency and remove jcenter()
PiperOrigin-RevId: 405375352
2021-10-25 14:12:15 +01:00
olly
2ee72076e5 Add datasource module
PiperOrigin-RevId: 404897119
2021-10-25 13:49:14 +01:00
olly
37b5847681 Get decoder buffers into the right place
PiperOrigin-RevId: 404876228
2021-10-21 23:16:02 +01:00
olly
ce17f61899 Add decoder module
PiperOrigin-RevId: 404810682
2021-10-21 18:41:33 +01:00
olly
1f63aea585 Upgrade test to new version of cronet-embedded
PiperOrigin-RevId: 404236978
2021-10-19 14:40:05 +01:00
olly
b3a1dcfee9 Fix remaining releaseArtifactId renames
PiperOrigin-RevId: 404236349
2021-10-19 14:36:15 +01:00
olly
d601875452 Rename releaseArtifact to releaseArtifactId
PiperOrigin-RevId: 404059404
2021-10-18 22:45:47 +01:00
olly
18cf01cda6 Move DataSource utils into a DataSourceUtil class
PiperOrigin-RevId: 403910535
2021-10-18 15:25:43 +01:00
ibaker
707968f7e6 Migrate usages of PositionInfo#windowIndex to mediaItemIndex
PiperOrigin-RevId: 403376452
2021-10-18 15:13:20 +01:00
kimvde
5ef00f0e96 Remove deprecated ControlDispatcher
The possibilities to set a ControlDispatcher have been removed in
<unknown commit> so that the ControlDispatcher is always a
DefaultControlDispatcher.

PiperOrigin-RevId: 403327092
2021-10-15 12:45:39 +01:00
kimvde
746ad2e6aa Remove deprecated ControlDispatcher from API surface
PiperOrigin-RevId: 403101980
2021-10-14 17:03:23 +01:00
olly
8827ccb568 Upgrade to WorkManager release compatible with Android 12
Issue #9181
#minor-release

PiperOrigin-RevId: 403049218
2021-10-14 12:19:53 +01:00
ibaker
23fc1f4384 Migrate usages of SimpleExoPlayer to ExoPlayer
SimpleExoPlayer is being deprecated in favour of ExoPlayer.

PiperOrigin-RevId: 402869414
2021-10-14 12:07:21 +01:00
samrobinson
3c19850ed3 Migrate library usages of SimpleExoPlayer to ExoPlayer.
PiperOrigin-RevId: 402853522
2021-10-14 12:03:11 +01:00
krocard
98ee159df1 Use TracksInfo and selection override in users
Update the UI module, the demos and most other users
to make use of the new player TracksInfo and track
selection override APIs.

PiperOrigin-RevId: 402817857
2021-10-14 11:54:45 +01:00