1405 Commits

Author SHA1 Message Date
andrewlewis
99f48ccaa0 Fix typo
PiperOrigin-RevId: 344526343
2020-11-30 09:32:48 +00:00
aquilescanta
e4adf99ac0 Use symlinking for dependency on libvpx
As opposed to in-source git-clone.

PiperOrigin-RevId: 344525899
2020-11-30 09:32:37 +00:00
andrewlewis
4446e2637d Fix unexpected multiline comments
#exofixit

PiperOrigin-RevId: 344517105
2020-11-30 09:32:25 +00:00
tonihei
87cd644d00 Add remaining proguard config tests.
This ensures we have full test coverage for proguard configs now.
The only configs not covered by tests are:
 - IMA and OkHttp which copy recommended configs from the respective
   library. I couldn't reproduce failures by removing them (and thus
   couldn't write a test that ensures they are correct).
 - Some dontwarn lines that just suppress warnings.

In addition, this change fixes a couple of related issues:
 - Moved AV1 proguard config to correct module.
 - Removed mentioning of deprecated ExtractorMediaSource from README
 - Suppressed warning from IMA code that prevent proguarding under
   strict rules
 - Fixed wrong proguard exclusion in VP9 module.
 - Moved FLAC exclusion (DefaultExtractorsFactory) to correct module.
 - Added AlertDialog suppression for de-jetified code.
 - Removed unusued dependency from UI module that causes large APK
   size increase.

#exofixit
#minor-release

PiperOrigin-RevId: 344427532
2020-11-27 11:08:34 +00:00
aquilescanta
1cdf5e79e3 Rename the FFMPEG extension binary to ffmpegJNI
Instead of ffmpeg_jni for consistency with other extensions.

PiperOrigin-RevId: 344411014
2020-11-27 11:07:55 +00:00
aquilescanta
bf21e3c690 Make libffmpeg_jni link statically against ffmpeg
Also make compilation automatically determine the number of
threads to use during compilation.

PiperOrigin-RevId: 344264761
2020-11-27 11:07:15 +00:00
olly
2fbad2105e Make special exception for cleartext-not-permitted
#exofixit

PiperOrigin-RevId: 344246408
2020-11-27 11:07:07 +00:00
andrewlewis
ee36e648e3 Fix ad progress updates after rebuffering an ad
Issue: #8239

#exofixit
#minor-release

PiperOrigin-RevId: 344211877
2020-11-27 11:06:35 +00:00
bachinger
58e01671e1 Use onEvents in MediaSessionConnector to avoid multiple updates.
#exofixit

PiperOrigin-RevId: 344065556
2020-11-27 11:06:02 +00:00
andrewlewis
809b8a0679 Removed unneeded activity from media2 extension tests
These tests appear not to need an activity, and removing it means we don't need
to switch away from the deprecated `ActivityTestRule`.

#exofixit

PiperOrigin-RevId: 344037927
2020-11-24 16:03:21 +00:00
andrewlewis
1b1a1a6414 Mark pending TODOs for media2 1.1.0 consistently
#exofixit

PiperOrigin-RevId: 344031062
2020-11-24 16:03:12 +00:00
olly
2ddb5b8d94 Update nullness issue in SilkCastApiImpl.java,SessionCallback.java
Null check warning was reported by //java/com/google/android/apps/gsa/staticplugins/silk/silkcast:silkcast_nullness_checker

//third_party/java_src/android_libs/exoplayer/v2/extensions/media2/src/main:library_nullness_test

PiperOrigin-RevId: 343939763
2020-11-24 16:02:55 +00:00
tonihei
d4e1904604 Rollback of 483a350e84
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

LSC: go/checker-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:342788973:BASE:342817196:1605636478036:6c558c0c

***

PiperOrigin-RevId: 343895651
2020-11-24 16:02:45 +00:00
olly
64d11a98ec Reference IMA language code bug
PiperOrigin-RevId: 343883034
2020-11-24 16:02:37 +00:00
andrewlewis
05f6d24821 Add support for ad playlists with ImaAdsLoader
Issue: #3750
PiperOrigin-RevId: 343878310
2020-11-24 16:02:17 +00:00
olly
689e89e5f3 Localize IMA based on device locale by default
#exofixit

PiperOrigin-RevId: 343871061
2020-11-24 16:02:07 +00:00
tonihei
bd631a6ce2 Add onEvents callback.
This callback allows listeners to know when all simultanous changes
have been handled and the values reported through callbacks are
again completely consistent with value obtained from Player
getter calls.

PiperOrigin-RevId: 343476639
2020-11-20 17:10:05 +00:00
sungsoo
2f1c0a5d0d Allow to remove all playlist items
PiperOrigin-RevId: 343437513
2020-11-20 11:11:08 +00:00
sungsoo
d67b70340e Refactor ComponentListener of PlayerWrapper
PiperOrigin-RevId: 343432873
2020-11-20 11:10:58 +00:00
tonihei
f13ffb4390 Rollback of 5d9c2d7b6a
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

***

PiperOrigin-RevId: 343086403
2020-11-18 18:40:30 +00:00
olly
3c91ba14b3 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 343003559
2020-11-18 18:40:17 +00:00
olly
483a350e84 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 342999390
2020-11-18 18:40:06 +00:00
olly
4ff7eb4905 Fix CronetDataSource handling of 200 response for range request
Issue: #8090
#minor-release
PiperOrigin-RevId: 342638922
2020-11-16 16:50:58 +00:00
olly
c47e62209d Report reasons for not being able to reuse decoders
PiperOrigin-RevId: 342344090
2020-11-16 16:49:48 +00:00
bachinger
b03df4e8b5 Add dispatchPrepare(player) to ControlDispatcher
Issue: #7882
PiperOrigin-RevId: 341394254
2020-11-11 09:49:32 +00:00
andrewlewis
ae4cf9f1da Clean up AdTagLoader and ImaAdsLoader
In preparation for adding support for ads in playlists:
- Make releasing a no-op if the instance was already released
- Remove null checks on non-null `adDisplayContainer` and `adsLoader`
- Move initializing the ads manager into a private method as it will need to be
  called from two places soon.
- Misc other cleanup.

Issue: #3750
PiperOrigin-RevId: 341021493
2020-11-06 16:35:14 +00:00
andrewlewis
764e5e8141 Expose the ads identifier in the Timeline period
Issue: #3750
PiperOrigin-RevId: 341021084
2020-11-06 16:35:06 +00:00
andrewlewis
0c301fefa8 Pass AdsMediaSource to other AdsLoader methods
Issue: #3750
PiperOrigin-RevId: 341020676
2020-11-06 16:34:57 +00:00
andrewlewis
5fd1601f91 Signal an ads identifier to the AdsLoader
In a later change, the AdPlaybackState will include the playing adsId (set by
the AdsLoader) and the ads loader will use this to determine what ad
information is associated with the playing/next periods, to allow loading ads
in playlists.

Apps can continue to pass just a URI for an ad tag with their MediaItem, in
which case the associated playlist will request that ad tag just and the same
state will be used for all occurrences of the ad tag.

This change has breaking changes to the AdsLoader interface and removes
deprecated ways of passing the ad tag, as it's very likely to go into a major
release anyway and not needing to handle the deprecated cases simplifies
ImaAdsLoader.

Issue: #3750
PiperOrigin-RevId: 340438580
2020-11-06 16:32:31 +00:00
andrewlewis
57c53c5ac4 Fix ImaPlaybackTest
This test is not run in presubmit as it was too flaky, and is currently broken
due to assets moving.

Also migrate off ImaPlaybackTest off deprecated APIs.

#minor-release

PiperOrigin-RevId: 340405666
2020-11-06 16:32:11 +00:00
andrewlewis
4289112947 Fix buildForAdsResponse
PiperOrigin-RevId: 340198099
2020-11-02 23:01:07 +00:00
andrewlewis
32b710712e Split AdTagLoader out of ImaAdsLoader
In a later change ImaAdsLoader will use multiple AdTagLoaders.

This change shouldn't have any substantial changes in behavior (it's almost
entirely moving code around). An exception is that ImaSdkSettings is configured
when making a request rather than at construction time.

Issue: #3750
PiperOrigin-RevId: 339891712
2020-11-02 23:00:48 +00:00
andrewlewis
27707e9c65 Clean up deprecated ad tag handling
PiperOrigin-RevId: 339890695
2020-11-02 23:00:39 +00:00
andrewlewis
df19725d58 Move more IMA extension utils into ImaUtil
These symbols will be referenced from AdTagLoader too in a later change.

PiperOrigin-RevId: 339889990
2020-11-02 23:00:29 +00:00
andrewlewis
de729ecf3a Fix skipping behavior in ad pods
ImaAdsLoader notified onEnded whenever an ad finished playing, but when an ad
is skipped in an ad pod we'd receive a playAd call before the player
discontinuity for skipping to the next ad. Fix this behavior by checking that
IMA's playing ad matches the player's playing ad before notifying onEnded.

#minor-release

PiperOrigin-RevId: 339424910
2020-11-02 22:58:06 +00:00
andrewlewis
1c4653f7ee Improve progress update logs
Add logging for ad progress and switch from deprecated getters to new
millisecond getters.

PiperOrigin-RevId: 339226534
2020-11-02 22:57:37 +00:00
andrewlewis
78940445fe Improve handling of VPAID ads
Issue: #7832
PiperOrigin-RevId: 339087555
2020-11-02 22:56:39 +00:00
andrewlewis
16c60ecf4b Upgrade IMA SDK dependency to 3.21.0
Call the new method AdsLoader.release() to allow the IMA SDK to dispose of its
WebView.

Issue: #7344
PiperOrigin-RevId: 339022162
2020-11-02 22:56:02 +00:00
aquilescanta
270e274ef3 Treat -1000 duration as unknown duration for live streams in Cast
Issue: #7983
#minor-release
PiperOrigin-RevId: 339016928
2020-11-02 22:55:52 +00:00
olly
9bde5d0351 [nullness] The nullness checking fixes of the media related files
We rolled back the previous <unknown commit> because some of the nullness checking fixes broke the exoplayer2 tests. We submit this CL into the TAP Global Presubmit train (https://test.corp.google.com/OCL:337620582:BASE:338201100:1603283151742:36afd5a5) and make sure that this CL wouldn't break any other tests on google3.

PiperOrigin-RevId: 338267548
2020-10-21 22:26:48 +01:00
andrewlewis
2ada01c1e7 Allow enabling IMA ext debug mode programmatically
PiperOrigin-RevId: 337824945
2020-10-20 14:50:59 +01:00
tonihei
68cbf6ddf3 Move listener handling to common util class.
ExoPlayerImpl and CastPlayer repeat the same logic. Moving the listener
and event handling to a common util class allows to reuse the same code
and add unit tests for this logic.

The change is a functional no-op.

PiperOrigin-RevId: 337812358
2020-10-20 14:50:30 +01:00
aquilescanta
a3a5760757 Remove references to the default Cast receiver
The ExoPlayer receiver app id is a thin wrapper around the default receiver, so
there are no reasons for users not to depend on it. By having ExoPlayer users
refer to the ExoPlayer app id we can collect usage metrics.

PiperOrigin-RevId: 337516767
2020-10-17 01:35:29 +01:00
andrewlewis
35f7e7f609 Upgrade IMA SDK dependency to 3.20.1
This brings in a fix for companion ads rendering when targeting API 29.

Issue: #6432
PiperOrigin-RevId: 337279054
2020-10-17 01:34:52 +01:00
bachinger
75513e581f Use Math.round(double) to avoid result being limited to Integer.MAX_INT
Issue: #8067
PiperOrigin-RevId: 337122011
2020-10-17 01:34:24 +01:00
ibaker
2371b024dd Switch to an 'api' dependency on Guava
The 'implementation' dependency causes problems when resolving
ListenableFuture in contexts that also include the
com.google.guava:listenablefuture:1.0 dependency.

Issue: #7905
Issue: #7997
Issue: #7993
PiperOrigin-RevId: 337093024
2020-10-17 01:34:15 +01:00
andrewlewis
eccc00bca8 Add a way to override ad media MIME types
Issue: #7961
PiperOrigin-RevId: 337069152
2020-10-17 01:34:06 +01:00
andrewlewis
cfe267a568 Encapsulate ImaAdsLoader configuration in a class
This will reduce the amount of boilerplate required to pass the configuration
values around (especially in a planned future change when logic is factored out
of ImaAdsLoader).

PiperOrigin-RevId: 337058355
2020-10-17 01:33:56 +01:00
bachinger
0a9b11d3dd Make resetPosition reset the position if true
Issue: #8024
PiperOrigin-RevId: 335846035
2020-10-13 16:26:41 +01:00
andrewlewis
ac782235ca Fix miscellaneous nits/typos
PiperOrigin-RevId: 335642909
2020-10-06 16:57:31 +00:00