7280 Commits

Author SHA1 Message Date
ibaker
795ddfee40 Preacquire DRM sessions from the loading side of SampleQueue
Issue: #4133
PiperOrigin-RevId: 362478801
2021-03-12 10:53:46 +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
93cc91641b Make DataSchemeDataSource consistent with other DataSource impls
PiperOrigin-RevId: 362388683
2021-03-12 10:44:29 +00:00
olly
1a68f3d3a4 Document DataSource edge-case behaviors
PiperOrigin-RevId: 362386100
2021-03-12 10:44:19 +00:00
tonihei
4665ac5490 Add tests to DataSourceContractTest asserting uri/response headers.
These values must be null/empty while the source isn't opened. And the
Uri must be non-null if the source is open.

PiperOrigin-RevId: 362329032
2021-03-12 10:44:09 +00:00
ibaker
962e686045 Deflake ClippedPlaybackTest
PiperOrigin-RevId: 362298115
2021-03-12 10:43:58 +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
krocard
a4ad351fb1 Enable offload tests
Add additional assertions to try to figure out why
the tests are flaky when run in the test harness.

Failure could not be reproduced locally even after 4000 run.

PiperOrigin-RevId: 362282251
2021-03-12 10:43:16 +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
tonihei
d9aee0f6a4 Add DataSource contract test for transfer listeners when opening fails.
TransferListener has the contract to have exactly one onTransferEnd per
onTransferStart, so the test can both assert that onTransferInitializing
is called, but not onTransferEnd (even after calling close).

PiperOrigin-RevId: 362262078
2021-03-12 10:42:55 +00:00
gyumin
27477a1980 Add MediaMetadata.EMPTY
PiperOrigin-RevId: 362186928
2021-03-12 10:42:44 +00:00
olly
e91b8465b8 Make CacheDataSourceContractTest use FakeDataSource for upstream
It's more flexible to use FakeDataSource, since it allows to testing
different upstream behaviors (e.g., upstream not being able to resolve
the content length).

PiperOrigin-RevId: 362072899
2021-03-12 10:42:23 +00:00
aquilescanta
a9d397a34e Make ProgressiveMediaExtractors public
So as for the user to be able to inject them.

PiperOrigin-RevId: 362056981
2021-03-12 10:42:13 +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
aquilescanta
383b6d42f1 Publish API for using MediaParser in DASH
PiperOrigin-RevId: 361828018
2021-03-12 10:41:41 +00:00
ibaker
bcb9eb4314 Switch SampleQueue to store Format in a span structure
PiperOrigin-RevId: 361813981
2021-03-12 10:41:30 +00:00
ibaker
ff8db9a4fe Pass the end position of a stream to TextRenderer when marking it final
In a period transition we pass the start time of the next period, for
the final period we pass the duration of the period or timeline, if
known.

This means sideloaded subtitles now respect the end point of
ClippingMediaSource and ensures that content subtitles aren't
incorrectly displayed over mid-roll ads.

When transitioning back into the subtitled content the subtitles still
appear slightly before the video transitions, meaning the first subtitle
of the content is shown with the last few frames of the ad. Resolving
this in a way that doesn't break anything else requires a deeper
investigation.

Issue: #5317
Issue: #8456
#minor-release
PiperOrigin-RevId: 361797118
2021-03-12 10:41:09 +00:00
Ian Baker
c3e3b19ad2 Merge pull request #8654 from abeljim:dev-v2-8435-bolditalic
PiperOrigin-RevId: 361767801
2021-03-12 10:40:58 +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
tonihei
bc9fb8615e Use correct period-window offset for initial prepare position.
MaskingMediaSource needs to resolve the prepare position set for a MaskingPeriod
while the source was still unprepared to the first actual prepare position.

It currently assumes that the period-window offset and the default position is
zero. This assumption is correct when a PlaceholderTimeline is used, but it
may not be true if the real timeline is already known (e.g. when re-preparing
a live stream after a playback error).

Fix this by using the known timeline at the time of the preparation.
Also:
 - Update a test that should have caught this to use lazy re-preparation.
 - Change the demo app code to use the recommended way to restart playback
   after a BehindLiveWindowException.

Issue: #8675
PiperOrigin-RevId: 361604191
2021-03-12 10:40:15 +00:00
tonihei
ea0f72e46c Update initial bandwidth estimates
PiperOrigin-RevId: 361569511
2021-03-12 10:40:04 +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
Ian Baker
83d7a3c1f4 Merge pull request #8662 from joakimzhang:dev-v2
PiperOrigin-RevId: 361029604
2021-03-12 10:38:36 +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
gyumin
7a02346d49 Recommend BasePlayer when implementing Player
PiperOrigin-RevId: 360902971
2021-03-12 10:38:14 +00:00
bachinger
8dc63dd2aa Reset playback speed when live speed control becomes unused
Issue: #8664
#minor-release
PiperOrigin-RevId: 360877086
2021-03-12 10:38:04 +00:00
gyumin
8fbb971dfa Implement Bundleable for AdGroup
PiperOrigin-RevId: 360851146
2021-03-12 10:37:53 +00:00
jaewan
7fad836b3a Implement Bundleable for PlaybackParameters
PiperOrigin-RevId: 360810865
2021-03-12 10:37:41 +00:00
olly
f5024131b8 Fix typos in Javadoc
PiperOrigin-RevId: 360440021
2021-03-12 10:37:19 +00:00
Ian Baker
d80d548503
Merge branch 'dev-v2' into dev-v2-8435-bolditalic 2021-03-04 09:41:39 +00:00
Abel Jimenez
8ac74a009e formatting 2021-03-03 02:51:26 -08:00
joakimzhang
dc814fc37d Detect external surround sound on Xiaomi devices
exoplayer can enable dolby passthrough on xiaomi device when get
EXTERNAL_SURROUND_SOUND_KEY

Signed-off-by: joakimzhang <zq15011526977@gmail.com>
2021-03-03 10:14:17 +08:00
Oliver Woodman
6be3a59354 Merge pull request #8546 from TadejZupancic:dev-v2
PiperOrigin-RevId: 360433358
2021-03-02 17:04:56 +00:00
olly
70f831a647 Simplify handling of playback speed in StyledPlayerControlView
PiperOrigin-RevId: 360404403
2021-03-02 17:04:44 +00:00
kimvde
67b18a958e Link to callback in Player getters' Javadoc
PiperOrigin-RevId: 360398175
2021-03-02 17:04:35 +00:00
andrewlewis
292700e93b Fall back from DTS HD to DTS
#minor-release

PiperOrigin-RevId: 360384540
2021-03-02 17:04:25 +00:00
olly
3f17f5d441 1) Adds new csi ticks:
exp (ExoPlayer prepare)
ffr (First Frame Rendered)
psr (Player State Ready).

2) Modifies aci/acc vci/vcc to report timing from ExoPlayer Playback thread.

3) Fix to report pvri and pari for every playback.

and other minor bug fixes.

PiperOrigin-RevId: 360228206
2021-03-02 17:04:15 +00:00
olly
b5d360c4cd Fix scrubber not reappearing correctly in some cases
Issue: #8646
#minor-release
PiperOrigin-RevId: 360184586
2021-03-02 17:04:04 +00:00
aquilescanta
ef1d797681 Introduce ChunkExtractor.Factory for dependency injection
PiperOrigin-RevId: 360175031
2021-03-02 17:03:55 +00:00
olly
560ed115df Add ResolvingDataSourceContractTest
PiperOrigin-RevId: 359783527
2021-03-02 17:03:35 +00:00