494 Commits

Author SHA1 Message Date
olly
4828f275c7 Make play button behave differently in IDLE and ENDED states
- In IDLE, the button will now call a preparer. This allows
  removal of the separate retry button from the demo app.
- In ENDED, the button will seek back to the default position
  and play.
- Behavior is made consistent with LeanbackPlayerAdapter.

Issue: #3689

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182506855
2018-01-23 19:07:52 +00:00
olly
c577d9d351 Let SimpleExoPlayerView/LeanbackPlayerAdapter bind with any Player
Also sanitize naming (PlayerView/PlayerControlView).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182364487
2018-01-23 19:00:20 +00:00
eguven
965bc4f677 Add JobDispatcherScheduler
This is a Scheduler implementation which uses Firebase JobDispatcher.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182051350
2018-01-23 18:44:17 +00:00
andrewlewis
6bed2ffc04 Remove ndk-build from [] flac build rules
Android NDK r9 in [] is deprecated (see []

Update the ExoPlayer flac extensions to use android_jni_library.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182017669
2018-01-23 18:41:05 +00:00
Oliver Woodman
141f3aa836 Simplify PGS captions + sync with internal tree 2018-01-15 14:13:30 +00:00
ojw28
96b7daa93a
Merge pull request #3667 from alexcohn/ndk-r16-support
minimal fix to support NDK r16
2018-01-15 13:47:05 +00:00
andrewlewis
13fbe7b2f2 Fix cronet extension package name
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181331715
2018-01-15 11:40:29 +00:00
andrewlewis
96e490d7fe Make it possible to subclass LibvpxVideoRenderer
Make LibvpxVideoRenderer non-final and add protected methods to match
MediaCodecVideoRenderer.

Reorganize methods to separate BaseRenderer, protected and internal methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181320714
2018-01-15 11:36:09 +00:00
tonihei
4ee971052b Improve Extractor partial read tests.
Partial reads were performed once using a partial size of 1 byte.
This was not enough to detect problems which only occur in combination
with IOExceptions. Partial reads are now only applied when no exception
is thrown.

Moreover, the tests didn't check whether the total number of sampled bytes
is what it is supposed to be. Added a field to the data dumps checking
the total number of bytes in the sampled data.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=181296545
2018-01-15 11:33:23 +00:00
andrewlewis
682953c411 Fix typos
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180778084
2018-01-04 15:54:01 +00:00
tonihei
183870d9d3 Update Cronet extension readme on how to enable Java 8 features.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180660349
2018-01-04 15:45:26 +00:00
olly
7b9f71b44d Don't kill the process if SimpleDecoder.decode throws.
Issue: #3645

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180659855
2018-01-04 15:44:00 +00:00
Alex Cohn
2cc044ded1 minimal fix to support NDK r16 2018-01-04 13:22:13 +02:00
tonihei
22f8ee37d4 Clean-up of player message handling.
Some readability fixes for PlayerMessage and the handling in
ExoPlayerImplInternal.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=180544294
2018-01-03 13:34:36 +00:00
tonihei
ec71c05e8b 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 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
2018-01-03 13:34:36 +00:00
tiffanywong
3b633f81b2 Automated g4 rollback of changelist 179563355.
*** 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
2018-01-03 13:34:36 +00:00
tonihei
6c2d1e1966 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 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
2018-01-02 21:36:07 +00:00
andrewlewis
8e35bffcc3 Use playAd/stopAd to control position updates switching
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
2017-12-15 12:15:20 +00:00
andrewlewis
e913ede77e Fix condition for detecting that an ad has ended
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
2017-12-15 12:12:32 +00:00
andrewlewis
65360760c2 Pass -1 not C.TIME_UNSET when duration is unknown
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=179165479
2017-12-15 12:11:07 +00:00
jschlag
f5d7b67eea try turning off vp9 loop filter on android
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178970007
2017-12-15 12:03:01 +00:00
tonihei
106e69b3fc Check if native libraries are available in tests.
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
2017-12-15 11:57:27 +00:00
bachinger
f3dc075cab Propagate extras from queue item to metadata item.
norelnotes=true

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178785377
2017-12-13 12:50:40 +00:00
andrewlewis
e2bba1567e Add Builder for ImaAdsLoader and allow early requestAds
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
2017-12-12 19:19:27 +00:00
andrewlewis
8c7fe8a258 Make ExtractorMediaSource.Builder a factory for ExtractorMediaSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178605481
2017-12-12 19:15:14 +00:00
andrewlewis
44a8245a1a Fix ad loading when there is no preroll
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178234009
2017-12-12 19:00:11 +00:00
andrewlewis
8b4b01c7f6 Skip ads before the initial player position
Issue: #3527

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=178218391
2017-12-12 18:56:01 +00:00
andrewlewis
59f6b059b0 Make one ad request in ImaAdsLoader
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
2017-12-12 18:33:15 +00:00
olly
fbfa43f5a3 Enhance SeekMaps to return SeekPoints
Issue: #2882

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177814974
2017-12-04 17:39:43 +00:00
andrewlewis
7792f667d4 Fix setting supported ad MIME types without preloading
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177810991
2017-12-04 17:39:43 +00:00
andrewlewis
fbccdf594a Use AdaptiveMediaSourceEventListener for ExtractorMediaSource
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
2017-12-04 17:38:11 +00:00
andrewlewis
a367ae0d2b Add a notice that NDK <= version 15c is required for VP9
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177430827
2017-12-04 17:38:11 +00:00
andrewlewis
2282527821 Allow setting supported formats on AdsLoaders
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177175377
2017-12-04 17:38:11 +00:00
aquilescanta
20567633a0 Add queue manipulation to the Cast demo
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
2017-12-04 17:38:11 +00:00
tonihei
f46cb907b7 Add stop with position reset to Player interface.
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
2017-12-04 17:38:11 +00:00
olly
c49ae53699 Remove unnecessary dependency
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176487991
2017-11-21 13:15:00 +00:00
tonihei
aac53cac56 Add reason to onTimelineChanged.
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
2017-11-21 13:07:46 +00:00
olly
c06fe73b66 Bump target API level to 27
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176366693
2017-11-21 13:03:28 +00:00
andrewlewis
2a685da4eb Improve robustness of ImaAdsLoader
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
2017-11-21 13:00:36 +00:00
tonihei
3f6b4d18a9 Move MockitoUtils to testutils and use it for all Mockito set-ups.
In particular this allows to have the workaround for
https://code.google.com/p/dexmaker/issues/detail?id=2 in one place only.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176340526
2017-11-20 13:40:28 +00:00
olly
82d0a27fd9 Fix some lint issues.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176337058
2017-11-20 13:39:03 +00:00
hoangtc
e349905039 Add Builder to ExtractorMediaSource.
Add Builder pattern to ExtractorMediaSource and mark existing constructors as
deprecated.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176088810
2017-11-17 18:56:25 +00:00
andrewlewis
b8aedfbf4f Add support for float output for FfmpegAudioRenderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175940553
2017-11-17 18:53:26 +00:00
tonihei
b30b786350 Avoid track group array error-prone reference quality check in CastPlayer.
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
2017-11-17 18:32:38 +00:00
olly
4787ffac93 Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=175542973
2017-11-13 19:58:25 +00:00
falhassen
46172ffd0f Preserve original on redirect with the set-cookie flow.
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
2017-11-01 14:15:12 +00:00
tonihei
4cf90e3223 Fix listener in ImaAdsMediaSource.
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
2017-10-27 16:30:00 +01:00
hdmoon
30f95cdcac Remove shuffleMode(boolean) usages in ExoPlayer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=173645536
2017-10-27 16:27:05 +01:00
falhassen
46bf254033 Add option for handling "Set-Cookie" requests in CronetDataSource.
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
2017-10-27 16:22:40 +01:00
falhassen
69e43b6abc Automated g4 rollback of changelist 171999924.
*** 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
2017-10-27 16:18:35 +01:00