446 Commits

Author SHA1 Message Date
olly
b4aee72a4a Re-strip StableApiCandidate
PiperOrigin-RevId: 366255289
2021-04-01 16:25:45 +01:00
samrobinson
3d3c90b89d Add getMediaMetadata to Player and SimpleExoPlayer.
PiperOrigin-RevId: 366240390
2021-04-01 16:06:43 +01:00
jaewan
ffb5b41a20 Fix typo in Player#setMediaItems() Javadoc
PiperOrigin-RevId: 366015326
2021-04-01 16:05:10 +01:00
Oliver Woodman
6603c6bbcf Merge pull request #8720 from dlafayet:tts-shear-block
PiperOrigin-RevId: 365998615
2021-04-01 16:05:00 +01:00
tonihei
76700e9d84 Log error for TrackGroups with multiple languages or role flags.
A TrackGroup must contain the same content in all Formats (except for
the quality, encoding etc). Verify that the language and role flags
are the same and log an error if don't match. Don't throw to avoid
breaking existing use cases that just happen to work by chance.

PiperOrigin-RevId: 365539240
2021-04-01 16:03:43 +01:00
ibaker
dd3597c2c1 Document that the order of cues passed to TextOutput is important
Fix WebViewSubtitleOutput to respect this (CanvasSubtitleOutput already
does).

Issue: #8704
PiperOrigin-RevId: 365534018
2021-04-01 16:03:35 +01:00
kimvde
9be84e4998 Document execution of unavailable command
PiperOrigin-RevId: 365044658
2021-04-01 16:03:26 +01:00
krocard
1526ca5e3c Move add/remove Player.Listener down of BasePlayer
The BasePlayer implementation of add/remove
Listener knows about Components.
As those are removed from the Player
interface, the implementation of those
methods needs to be moved down in Player
implementations.

This commit makes no functional change.

PiperOrigin-RevId: 364985291
2021-04-01 16:03:09 +01:00
bachinger
dc4148d576 Add positions and new reasons to onPositionDiscontinuity
PiperOrigin-RevId: 364861539
2021-03-24 19:56:25 +00:00
Denise LaFayette
4be774aaac Support tts:shear in TTML parser and WebView output 2021-03-24 12:39:44 -07:00
kimvde
f19ab4aa8b Add possibility to iterate over Commands
PiperOrigin-RevId: 364836973
2021-03-24 18:08:16 +00:00
kimvde
e1fec35ff3 Add command to seek to default position
PiperOrigin-RevId: 364821216
2021-03-24 18:07:56 +00:00
gyumin
bffb68b23b Add BundleUtil to remove androidx.core dependency
It's copied from BundleCompat in androidx.core.

PiperOrigin-RevId: 364682379
2021-03-24 18:07:15 +00:00
tonihei
b35c81124d Add 5G-NSA detection.
PiperOrigin-RevId: 364607555
2021-03-24 18:07:06 +00:00
kimvde
c202d406fb Improve commands Javadoc
PiperOrigin-RevId: 364600438
2021-03-24 18:06:56 +00:00
kimvde
b6290b1164 Add commands only available in SimpleExoPlayer
PiperOrigin-RevId: 364598601
2021-03-24 18:06:46 +00:00
samrobinson
75dd1b4355 Add buildUpon to MediaMetadata.
PiperOrigin-RevId: 364590789
2021-03-24 18:06:36 +00:00
samrobinson
a68bb38ac4 Change MediaMetadata private constructor to take the Builder.
PiperOrigin-RevId: 364580585
2021-03-24 18:06:26 +00:00
gyumin
3fbfc0ec0e Fix Timeline.toBundle for empty timeline
PiperOrigin-RevId: 364513299
2021-03-24 18:06:07 +00:00
krocard
bb1261da3c setPlaybackParameters no longer accepts null for DEFAULT
Null was an alias for DEFAULT. Remove this for nullness
safety in the API.

The ExoPlayer implementation still checks for null and
replaces it by DEFAULT, so this is ABI compatible.

PiperOrigin-RevId: 364370017
2021-03-24 18:05:57 +00:00
gyumin
7b4b5cbf5a Preserve window indices of Timeline when bundling
PiperOrigin-RevId: 364324490
2021-03-24 18:05:35 +00:00
tonihei
f8727b5e87 Move Util.getNetworkType into NetworkTypeObserver.
The main user of the Util method is the bandwidth meter to set the
initial network type. If this is the first call to the
NetworkTypeObserver, then we should also allow the first update to
a known network type even if no reset on network type is activated.

The other uses are analytics listeners that check the network type
at certain events. This can just use the lookup method of the
NetworkTypeObserver.

PiperOrigin-RevId: 363670771
2021-03-24 18:04:37 +00:00
olly
1affbf9357 DataSources: Enforce that opening at end-of-resource succeeds
- Update the three `HttpDataSource` implementations to use the
  Content-Range response header to determine when this is the
  case. The Content-Range header is included when the status
  code is 416. See [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416).
- Update `ByteArrayDataSource` to conform to the requirement.
- Update `DataSourceContractTest` to enforce the requirement.

PiperOrigin-RevId: 363642114
2021-03-24 18:04:27 +00:00
aquilescanta
c30a6e5119 Add deprecated javadoc to fix lint error
PiperOrigin-RevId: 363639146
2021-03-24 18:04:07 +00:00
krocard
b24d9f64a9 Implement deprecated getPlaybackError in PlayerBase
PiperOrigin-RevId: 363606255
2021-03-24 18:03:48 +00:00
olly
2d9177b7c2 SampleStream/SampleQueue: Introduce read flags
- SampleQueue.peek is replaced with SampleQueue.read with
  FLAG_PEEK. This also exposes peek functionality through
  SampleStream.
- Use of DecoderInputBuffer.isFlagsOnly is replaced with
  FLAG_OMIT_SAMPLE_DATA. This flag can be used with or
  without FLAG_PEEK, where-as previously the read position
  would never be advanced for an isFlagsOnly buffer.
- formatRequired is replaced with FLAG_FORMAT_REQUIRED.

PiperOrigin-RevId: 363460105
2021-03-24 18:03:28 +00:00
kimvde
adcaf4b027 Add available command to seek to any media item
PiperOrigin-RevId: 363144142
2021-03-24 18:02:38 +00:00
olly
675b81e5f7 DataSource: Tighten contract to return -1 on premature end-of-input
PiperOrigin-RevId: 363001266
2021-03-24 18:02:17 +00:00
kimvde
6c9f9f9def Add available command to seek in current item
PiperOrigin-RevId: 362972550
2021-03-15 19:15:19 +00:00
kimvde
46aab92206 Add permanently available commands
PiperOrigin-RevId: 362906290
2021-03-15 19:15:10 +00:00
olly
6f8a8fbc1c HLS: Allow audio variants to initialize the timestamp adjuster
This makes HLS playback less liable to become stuck if discontinuity
tags are inserted at different times across media playlists.

Issue: #8700
Issue: #8372
PiperOrigin-RevId: 362903428
2021-03-15 19:14:52 +00:00
gyumin
f8fb9dd606 Implement Bundleable for Timeline
PiperOrigin-RevId: 362474276
2021-03-12 10:53:41 +00:00
krocard
3f4f2f90b5 Move offload events to their own listener
Move offload events from Player.EventListener to
ExoPlayer.AudioOffloadListener.

PiperOrigin-RevId: 362472462
2021-03-12 10:44:50 +00:00
olly
b563b82787 Add HttpUtil for tasks common to HttpDataSource implementations
Part of aligning HttpDataSource behavior will require adding
logic that's common across the DataSource implementations. This
change establishes a util class to house it, and moves a bit of
existing logic that's related and can be easily shared into it.

There is one small behavior change in this CL, which is that our
handling of Content-Range response headers can now parse the body
length if the "document size" part of the Content-Range is unknown,
for example "bytes 5-9/*". Previously the pattern we were matching
to required the "size" part to be set, for example "bytes 5-9/100",
despite the fact we don't need or use it.

PiperOrigin-RevId: 362396976
2021-03-12 10:44:40 +00:00
olly
1a68f3d3a4 Document DataSource edge-case behaviors
PiperOrigin-RevId: 362386100
2021-03-12 10:44:19 +00:00
kimvde
9d2d334091 Add available commands to prepare/play/pause/stop/release.
PiperOrigin-RevId: 362292208
2021-03-12 10:43:48 +00:00
krocard
baf1516ae4 Flatten listener using existing listeners
Adds a new Listener that extends all other listener.
This is part of the component flattening goal.

After components have been flattened in Player,
and clients transitioned, existing listeners will be deprecated.

PiperOrigin-RevId: 362287507
2021-03-12 10:43:26 +00:00
kimvde
0c9b02bf44 Make commands to seek unavailable during ads
ExoPlayer does not support seeking during ads.

PiperOrigin-RevId: 362274785
2021-03-12 10:43:05 +00:00
gyumin
27477a1980 Add MediaMetadata.EMPTY
PiperOrigin-RevId: 362186928
2021-03-12 10:42:44 +00:00
kimvde
4a6859e5e2 Replace MutableFlags by immutable class
PiperOrigin-RevId: 362043183
2021-03-12 10:42:02 +00:00
kimvde
851c915e38 Add COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM to available commands
PiperOrigin-RevId: 362036291
2021-03-12 10:41:51 +00:00
gyumin
a60ed20f1b Implement Bundleable for Timeline.Window
PiperOrigin-RevId: 361741354
2021-03-12 10:40:46 +00:00
gyumin
ae7c1091e6 Implement Bundleable for Timeline.Period
PiperOrigin-RevId: 361736476
2021-03-12 10:40:36 +00:00
gyumin
6f9dbfe0c1 Implement Bundleable for AdPlaybackState
PiperOrigin-RevId: 361731578
2021-03-12 10:40:25 +00:00
gyumin
ffb7c466ed Implement addMediaItems(List) and clearMediaItems() in BasePlayer
PiperOrigin-RevId: 361487730
2021-03-12 10:39:54 +00:00
gyumin
c1dba81ed2 Move TimelineTest to common module
PiperOrigin-RevId: 361125522
2021-03-12 10:39:43 +00:00
gyumin
51f6aea265 Merge AdPlaybackStateTests
PiperOrigin-RevId: 361125492
2021-03-12 10:39:33 +00:00
kimvde
0dcdbf0adf Add Player onAvailableCommandsChanged callback
PiperOrigin-RevId: 361122259
2021-03-12 10:39:22 +00:00
olly
3de81c6d31 HttpDataSources: Remove unused protected methods
PiperOrigin-RevId: 361109018
2021-03-12 10:39:11 +00:00
gyumin
4df7410272 Add javadoc for Bundleable CREATOR fields
It's to comply with style guide as they are public.

PiperOrigin-RevId: 360914363
2021-03-12 10:38:25 +00:00