Some readability fixes for PlayerMessage and the handling in
ExoPlayerImplInternal.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180544294
This adds options to ExoPlayer.sendMessages which allow to specify a window index
and position at which the message should be sent. Additionally, the options can be
configured to use a custom Handler for the messages and whether the message should
be repeated when playback reaches the same position again.
The internal player converts these window positions to period index and position
at the earliest possibility. The internal player also attempts to update these
when the source info is refreshed. A sorted list of pending posts is kept and the
player triggers these posts when the playback position moves over the specified
position.
Issue:#2189
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179683841
*** Original change description ***
Add possiblity to send messages at playback position.
This adds options to ExoPlayer.sendMessages which allow to specify a window index
and position at which the message should be sent. Additionally, the options can be
configured to use a custom Handler for the messages and whether the message should
be repeated when playback reaches the same position again.
The internal player converts these window positions to period index and position
at the earliest possibility. The internal player also at...
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179666357
This adds options to ExoPlayer.sendMessages which allow to specify a window index
and position at which the message should be sent. Additionally, the options can be
configured to use a custom Handler for the messages and whether the message should
be repeated when playback reaches the same position again.
The internal player converts these window positions to period index and position
at the earliest possibility. The internal player also attempts to update these
when the source info is refreshed. A sorted list of pending posts is kept and the
player triggers these posts when the playback position moves over the specified
position.
Issue:#2189
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179563355
Previously the ad/content progress updates were toggled based on whether the
player was playing ads or content. After this change, we switch based on
whether playAd/stopAd has been called instead.
This seems to resolve an issue where occasionally the player would get stuck at
the start of an ad, but as I don't have a root cause for that issue and it's
only sporadically reproducible I'm not certain this is a reliable fix.
Issue: #3525
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179169296
onEnded was being called also for content finishing, as in this case the playing
ad index changed (from INDEX_UNSET to 0). Fix this test so we only detect ads
finishing.
Also add logging for onEnded callbacks.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179167737
If the library is not available, no tracks can be selected and the
tests silently run through by immediately switching to ended state
without error.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178904347
Also fix propagation of ad errors that occur when no player
is attached.
Issue: #3548
Issue: #3556
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178767997
This fixes an issue where quickly detaching and reattaching the player might
cause ads to be requested multiple times with both responses handled.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177922167
This is a step towards harmonizing the MediaSource Builders and (potentially)
providing MediaSource factories.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177783157
Against all odds, samples can be reordered by using drag & drop.
Issue:#1706
Issue:#2283
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177145553
The ExoPlayerImpl implementation forwards the stop request with this optional
parameter. To ensure correct masking (e.g. when timeline updates arrive after
calling reset in ExoPlayerImpl but before resetInternal in
ExoPlayerImplInternal), we use the existing prepareAck counter and extend it
also count stop operations. For this to work, we also return the updated
empty timeline after finishing the reset.
The CastPlayer doesn't support the two reset options so far.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177132107
Currently onTimelineChanged doesn't allow to distinguish easily between the
different reasons why it's being called. Especially, finding
out whether a new media source has been prepared or the current source
refreshed dynamically was impossible without tightly coupling the player
operations with the listener.
The new reasons provide this disdinction by either indicating a newly
initialized media source, a dynamic update to an existing timeline
or manifest, or a reset of the player (which usually results in an
empty timeline).
The original onTimelineChanged method without reason is kept in the
DefaultEventListener as deprecated to prevent the need to update all
existing listeners in one go.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176478701
Remove an assertion that there was a call to pause content between two
content -> ad transitions.
Also, only use the player position for resuming an ad on reattaching if the
player is currently playing an ad, in case IMA pauses content before the player
actually transitions to an ad.
Issue: #3430
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176365842
Add Builder pattern to ExtractorMediaSource and mark existing constructors as
deprecated.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176088810
Also replaced the duplicated EMPTY track group array with the one already defined
in TrackGroupArray.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175670266
We need to make sure the original header is retained when we redirect.
I filed a request on Cronet to allow headers to be provided to the UrlRequest#followRedirect method:
https://bugs.chromium.org/p/chromium/issues/detail?id=779611
Until that API is changed, i.e., pulled into GMSCore, and most clients are using the version of GMSCore with the API change, we can stick with this approach.
FYI
Cronet generally uses the original headers on redirect:
http://[]
but modifies the headers for these special cases:
hhttp://[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174074572
As MediaSource listeners now return the MediaSource in on SourceInfoRefreshed,
we need to make sure that media sources wrapping another source don't just
forward the listener, but also provide a listener wrapper. This allows to
inject the wrapper source instance in the callback.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173653307
This time, we avoid using the problematic CookieManager and HttpCookie framework APIs by just forwarding the cookie request only when the client has enabled the feature and the server responds with a "Set-Cookie" response header.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173532023
*** Reason for rollback ***
CookieManager APIs are fundamentally broken (b/67951242)
*** Original change description ***
Cookie-based validation in CronetDataSource
Using cookie validation from streamer, streamer can enforce that only clients who have the cookie are able to stream the video.
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173396251
This is not really useful with the DefaultAudioSink, but could be used in a
custom AudioSink when mixing audio from sources that have different sample
rates.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172434482
Recently added Java 8 features in the cronet extension and the linked native libs
require to enable Java 8 desugaring in gradle. Moreover, junit.assertThrows is not
available in our version and its usage has been replaced by the manual check.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172077967
Using cookie validation from streamer, streamer can enforce that only clients who have the cookie are able to stream the video.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171999924
Controls are still hidden while playing ads, but if the app pauses the player,
controls will be shown. During ads, the player is not seekable.
When the player enters the background then returns to the foreground, the
content period may not be prepared, so also cache the content window duration.
This means that if the app reenters the foreground while an ad is paused the
time bar can be populated.
Issue: #3303
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171123428