1304 Commits

Author SHA1 Message Date
christosts
086d8f3a8e Contract test for TransferListener callbacks
PiperOrigin-RevId: 357190780
2021-02-12 16:40:40 +00:00
andrewlewis
41c94edcc2 Add a method to focus the 'skip ad' button, if shown
Issue: #8565

#minor-release

PiperOrigin-RevId: 356691251
2021-02-11 12:05:39 +00:00
olly
94a4b905c9 Make additional modules depend only on common
ControlDispatcher and DefaultControlDispatcher also need
to move to common for the UI module. As does PlaybackPreparer,
although that will be removed entirely in a future release.

PiperOrigin-RevId: 356467394
2021-02-09 13:59:41 +00:00
olly
c501908dad Remove deprecated extension-jobdispatcher module
PiperOrigin-RevId: 356456843
2021-02-09 13:59:32 +00:00
andrewlewis
846bb94ec4 Handle loading the same ad more than once
Also allow the player's prepared ad media period durations array to exceed the
length of the loaded ad URIs array, as it's possible for the player to buffer
an ad media period fully at the point where it's known that an ad is coming up
but its URI is still unknown.

#minor-release

PiperOrigin-RevId: 356249284
2021-02-09 13:59:24 +00:00
olly
e345e0a5bc Upgrade some dependency versions
PiperOrigin-RevId: 355508621
2021-02-04 09:57:27 +00:00
olly
2a22b347c4 Suppress SwitchIntDef warning where it makes sense
In both cases it's deliberate that all excluded constants should use
the default branch. Furthermore, there are quite a lot of excluded
constants missing, so it's probably better to suppress the warning
than to include them all.

#minor-release

PiperOrigin-RevId: 355426749
2021-02-04 00:24:04 +00:00
olly
e98f5f34ce Fix gradle conflict resolution for Cronet tests
This resolves the following constraint resolution issue when running our release script:

> Cannot find a version of 'org.chromium.net:cronet-api' that satisfies the version constraints:
    Dependency path 'com.google.android.exoplayer:extension-cronet:unspecified' --> 'com.google.android.gms:play-services-cronet:17.0.0' --> 'org.chromium.net:cronet-api:72.3626.96'
    Constraint path 'com.google.android.exoplayer:extension-cronet:unspecified' --> 'org.chromium.net:cronet-api:{strictly 72.3626.96}' because of the following reason: debugRuntimeClasspath uses version 72.3626.96
    Dependency path 'com.google.android.exoplayer:extension-cronet:unspecified' --> 'org.chromium.net:cronet-embedded:76.3809.111' --> 'org.chromium.net:cronet-common:76.3809.111' --> 'org.chromium.net:cronet-api:76.3809.111'

#minor-release

PiperOrigin-RevId: 355414968
2021-02-04 00:23:55 +00:00
olly
35b99d634f Make Cronet extension depend only on common
This also moves DefaultHttpDataSource to common, which seems
sensible, else non-player components that need a DataSource
don't have any useful concrete implementations. We should
think about moving some of the other concrete implementations
to common as well.

PiperOrigin-RevId: 354738925
2021-02-01 18:11:23 +00:00
olly
2b24e88726 Pass full locale code to IMA
IMA can now handle the full locale code properly.

PiperOrigin-RevId: 354528700
2021-02-01 18:10:46 +00:00
krocard
60f3d8168c CastPlayer only depends on common
Thanks to the move of the Player API to common,
the cast player no longer need to depend on core.

#player-to-common

PiperOrigin-RevId: 354257309
2021-02-01 18:10:14 +00:00
olly
3fcc14b3c2 OkHttp/Rtmp extensions: Remove dependency on core
They only require common. This allows their use for non-playback networking
without requiring the user to depend on the whole of core. I will also make
the same change for Cronet, although this needs a little more work.

PiperOrigin-RevId: 353649388
2021-01-25 17:38:36 +00:00
christosts
3b08a792bb Fix bug in CronetDataSource
This change fixes a bug in CronetDataSource when it makes a Range
request but the server does not support Range requests and returns the
entire resource. Before the fix, the CronetDataSource would read more
bytes than the intended range.

PiperOrigin-RevId: 353614477
2021-01-25 15:37:08 +00:00
olly
bfc736986e Migrate CronetDataSourceFactory to DefaultHttpDataSource.Factory
We normally wouldn't do this kind of thing, given CronetDataSourceFactory is
deprecated, but it's needed to change the cronet --> core dependency to a
cronet --> common dependency.

PiperOrigin-RevId: 353609198
2021-01-25 15:36:49 +00:00
christosts
0a3542e50e Add contract test for CronetDataSource
PiperOrigin-RevId: 353290124
2021-01-25 15:35:59 +00:00
olly
4791900848 Move Player.getTrackSelector to ExoPlayer
PiperOrigin-RevId: 353212567
2021-01-22 16:22:09 +00:00
tonihei
d1faf713af Use Clock to create Handler in ListenerSet.
This ensures the Handler is governed by this clock.

PiperOrigin-RevId: 353011555
2021-01-22 16:21:27 +00:00
andrewlewis
f2057156d1 Time out ad preloading for initial seek
The IMA SDK currently notifies `CONTENT_RESUME_REQUESTED` then
`CONTENT_PAUSE_REQUESTED` quickly afterwards when playing an ad for an initial
seek. This triggered the logic to skip VPAID ads added for Issue: #7832,
causing the ad to be skipped.

This change reverts the fix for that issue and extends the ad preload timeout
logic to cover the case of an initial seek as well. Incompatible VPAID ads will
still be skipped but only after the preload delay (this seems fine given that
they are documented not to be supported, and we are just making the failure
mode less bad on a best-effort basis!).

Issue: #8428
Issue: #7832
PiperOrigin-RevId: 353011270
2021-01-22 16:21:18 +00:00
christosts
c808751009 Add contract tests for OkHttpDataSource
PiperOrigin-RevId: 352554949
2021-01-19 19:23:31 +00:00
andrewlewis
d2950c2e97 Update opus repository location
The new URL is referenced from https://xiph.org/downloads/. The old
URL currently times out.

#minor-release

PiperOrigin-RevId: 351991077
2021-01-17 21:50:55 +00:00
andrewlewis
48dd20ce3a Follow symlinks in opus build
This is not necessary when following the README.md but it is required if
libopus is under a symlink (and won't do any harm if it's not symlinked).

PiperOrigin-RevId: 351985185
2021-01-17 21:50:46 +00:00
jaewan
77a559640b Remove workaround for media1 session's looper restriction
PiperOrigin-RevId: 351936232
2021-01-15 10:57:57 +00:00
Oliver Woodman
b8b9a6411d Merge pull request #8412 from h6ah4i:media2-move-playlist-item
PiperOrigin-RevId: 351305387
2021-01-12 08:46:25 +00:00
andrewlewis
e3620ed646 Upgrade IMA SDK dependency to 3.22.0
Issue: #7344
Issue: #8339
PiperOrigin-RevId: 351212047
2021-01-12 08:46:06 +00:00
olly
2a5f6d8f62 Improve user-agent configuration
- Support setting the user-agent in CronetDataSource
- Support setting the default user-agent in CronetEngineWrapper
- Use the underlying network stack's default user-agent by
  default. Many applications will configure the underlying
  CronetEngine or OkHttpClient with a user-agent that they
  expect to be used throughout their app, so always overriding
  this with our own default, on reflection, is not the best
  thing to do!

Issue: #8395
PiperOrigin-RevId: 350921963
2021-01-11 18:04:43 +00:00
Oliver Woodman
953e4e89e2 Merge pull request #8414 from tidoemanuele:tidoemanuele-improve-non-2xx-message
PiperOrigin-RevId: 350797551
2021-01-08 19:09:15 +00:00
Emanuele Tidó
6d4b364530
Update OkHttpDataSource.java 2021-01-06 00:19:06 +00:00
Emanuele Tidó
91a09ea320
Update OkHttpDataSource.java
set responseBody to Util.EMPTY_BYTE_ARRAY when an IOException occurs trying to get his value from inputStream
2021-01-06 00:12:55 +00:00
Emanuele Tidó
15a59d93ee
throw exception improved
if responseCode and responseMessage ara available always throws an InvalidResponseCodeException instead of HttpDataSourceException, so in onPlayerError method the http status code and message can be used to decide what will be the next step.
2020-12-30 16:57:50 +00:00
Haruki Hasegawa
d522dbaf44
Add SessionPlayer#movePlaylistItem(int, int) support 2020-12-30 17:22:39 +09:00
olly
cc6638d12e Disable flaky media2 test
PiperOrigin-RevId: 348784475
2020-12-23 22:53:33 +00:00
olly
d01093d711 Rollback of dd7b379dc0
*** Original commit ***

DataSource.open() throws if already opened.

Update DataSource implementations to throw an error if open() is called
when the DataSource is already open.

***

PiperOrigin-RevId: 348783425
2020-12-23 22:53:24 +00:00
christosts
dd7b379dc0 DataSource.open() throws if already opened.
Update DataSource implementations to throw an error if open() is called
when the DataSource is already open.

PiperOrigin-RevId: 348609860
2020-12-23 22:52:21 +00:00
bachinger
62720858ed Make CronetDataSourceFactory an inner class of CronetDataSource
#exofixit

PiperOrigin-RevId: 348444280
2020-12-23 22:51:38 +00:00
andrewlewis
e791e3ce54 Fix checking imaAdMediaInfo nullness
It's intended to log a warning in this case, rather than throw.

Issue: #8290

#minor-release

PiperOrigin-RevId: 347790527
2020-12-17 11:25:53 +00:00
andrewlewis
0633778c70 Fix handling of repeated ads identifiers
Previously the `AdTagLoader` only had one listener which meant that updates
that should affect all periods with matching identifiers in the timeline only
affected the last-attached one. Fix this by having `AdTagLoader` track all its
listeners.

Issue: #3750
PiperOrigin-RevId: 347571323
2020-12-17 11:25:53 +00:00
andrewlewis
4139ee5c52 Improve ad loader listening in ImaAdsLoaderTest
It is more realistic for each source to have its own listener and to share
`TimelineWindowDefinition`s between them.

Issue: #3750
PiperOrigin-RevId: 347398769
2020-12-17 11:25:53 +00:00
bachinger
6114c894df Make OkHttpDataSourceFactory an inner class of OkHttpDataSource
#exofixit

PiperOrigin-RevId: 347389531
2020-12-17 11:25:53 +00:00
bachinger
a335c96450 Deprecate HttpDataSource.Factory.getDefaultRequestProperties
#exofixit

PiperOrigin-RevId: 347375323
2020-12-17 11:25:52 +00:00
sungsoo
4907cf877a Make media2 extension depend on androidx media2 1.1.0
Issue: #8011
#minor-release
PiperOrigin-RevId: 347288689
2020-12-14 10:19:03 +00:00
bachinger
2ee40270e5 Support setPlaybackSpeed(float) with the MediaSessionConnector
Issue: #8229
#exofixit
PiperOrigin-RevId: 346968046
2020-12-14 10:17:53 +00:00
bachinger
05c928f96d Add live configuration to Timeline.Window
Issue: #5011
PiperOrigin-RevId: 346828103
2020-12-14 10:17:23 +00:00
andrewlewis
6796c4d01c Add a setting for enabling continuous playback
Issue: #3750
PiperOrigin-RevId: 346079830
2020-12-14 10:14:55 +00:00
andrewlewis
ebe54113a9 Fix SonicAudioProcessor end of stream behavior
The `AudioProcessor` interface requires that no more input is queued after
queueing end of stream, but `DefaultAudioSink` did queue more input and the
implementation of `SonicAudioProcessor` actually relied on this to drain output
at the end of the stream.

Fix this behavior by getting `Sonic` output in `getOutput` and having
`DefaultAudioSink` only queue input to processors that are not draining.

Also add TODOs to clean up audio processor implementations where the code
handles interaction that doesn't conform to the interface.

PiperOrigin-RevId: 345406478
2020-12-03 17:11:47 +00:00
olly
104ad64b76 Change CronetDataSource.buildRequestBuilder method to protected.
This allows overriding the implementation of building the UrlRequest
from dataSpec when necessary

PiperOrigin-RevId: 345149165
2020-12-03 17:10:35 +00:00
tonihei
de67030f24 Add back VpxOutputBuffer proguard config.
This is needed to support old binary builds that still rely on the
existance of this class.

PiperOrigin-RevId: 344799495
2020-11-30 16:11:36 +00:00
aquilescanta
054bff80fd Fix ffmpeg build script's strip tool for armeabi-v7a
Broken in bf21e3c690.

PiperOrigin-RevId: 344777455
2020-11-30 16:11:19 +00:00
krocard
538445572d Move FormatSupport in common
#player-to-common

PiperOrigin-RevId: 344558028
2020-11-30 09:33:11 +00:00
olly
50bbfb57c0 Mini phrasing tweak
PiperOrigin-RevId: 344535069
2020-11-30 09:33:00 +00:00
andrewlewis
99f48ccaa0 Fix typo
PiperOrigin-RevId: 344526343
2020-11-30 09:32:48 +00:00