1478 Commits

Author SHA1 Message Date
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
andrewlewis
39277ebe95 Pass ad tags via AdsMediaSource
This is in preparation for supporting playlists of ads media sources using
ImaAdsLoader.

Existing ways of passing ad tags should still function but are deprecated (and
won't be supported with playlists).

Issue: #3750
PiperOrigin-RevId: 335618364
2020-10-06 14:31:50 +01:00
samrobinson
a552e35f6a Add getter and callbacks for static metadata retrieval.
Issue:#7266
PiperOrigin-RevId: 335416280
2020-10-06 14:31:32 +01:00
andrewlewis
41192ee046 Allow apps to add a VideoAdPlayerCallback
Issue: #7944
PiperOrigin-RevId: 335012643
2020-10-06 14:31:23 +01:00
andrewlewis
c35787a08f Add ImaUtil for IMA extension utilities
PiperOrigin-RevId: 334567234
2020-09-30 11:55:52 +01:00
andrewlewis
8728706c6e Use Builder in ImaAdsLoader constructor
PiperOrigin-RevId: 334562209
2020-09-30 11:55:44 +01:00
andrewlewis
151a3d3bf5 Fix position reporting with fetch errors
On receiving a fetch error for an ad that would otherwise play based on an
initial/seek position, the pending content position wasn't cleared which meant
that position reporting was broken after a fetch error. Fix this by always
clearing the pending position (if there was a pending position that will have
triggered the fetch error).

Also deduplicate the code for handling empty ad groups (fetch errors)
and ad group load errors.

Issue: #7956
PiperOrigin-RevId: 334113131
2020-09-30 11:55:09 +01:00
olly
744c57c87d More verbose instructions for consistency
PiperOrigin-RevId: 332015471
2020-09-16 17:00:52 +01:00
aquilescanta
a3cd36beb1 Update the FFmpeg extension readme to use symlinking
PiperOrigin-RevId: 332012857
2020-09-16 16:37:08 +01:00
aquilescanta
b866c5e424 Fix the FFmpeg extension build
Since gradle 4.0, CMake imported libraries are bundled in the APK, so
manually bundling them causes a duplication which breaks the build.

Issue: #7906
PiperOrigin-RevId: 332012375
2020-09-16 16:36:59 +01:00
olly
b999977c9d Dev guide: Copy editing
Also changed the links that describe configuring the
player for ad insertion to link to the ads page.

PiperOrigin-RevId: 331349846
2020-09-13 00:02:32 +01:00
olly
5a009ab476 Remove references to cross-protocol redirects for Cronet
There's no option to enable them. This is probably a copy/paste error
from DefaultHttpDataSourceFactory.

PiperOrigin-RevId: 331334263
2020-09-12 21:05:18 +01:00
olly
bff7ac0dbe Clean up some lint warnings
PiperOrigin-RevId: 331162350
2020-09-11 17:31:03 +01:00
bachinger
99cdf2ca4d MediaItemify the IMA extension README and the ads page in dev guide
PiperOrigin-RevId: 331155539
2020-09-11 17:30:54 +01:00
andrewlewis
156166f57c Fix handling of empty ad groups at non-integer cue points
Issue: #7889
PiperOrigin-RevId: 331149688
2020-09-11 17:30:43 +01:00
olly
cdcb30ed21 Exclude Guava transitive annotation dependencies
PiperOrigin-RevId: 331148067
2020-09-11 16:01:15 +01:00
andrewlewis
033232784a Improve DEBUG VideoProgressUpdate logging
PiperOrigin-RevId: 330918689
2020-09-11 13:24:22 +01:00
andrewlewis
06de13ecae Add a setter for ad error listeners
This is useful because ImaAdsLoader.getAdsLoader() can now return null
(before ads have been requested), and it avoids the app needing to get
an AdsManager to attach its listener.

PiperOrigin-RevId: 330907051
2020-09-11 13:23:54 +01:00
olly
b2b08ade99 Make User-Agent optional
PiperOrigin-RevId: 330593247
2020-09-09 09:41:51 +01:00
olly
3110587fbe Fix extension renderer test names + add FfmpegVideo case
PiperOrigin-RevId: 330409635
2020-09-09 09:41:32 +01:00
olly
04f67e4adc Simplify DefaultMediaSourceFactory ad configuration
- Use a setter, which is consistent with how other optional
  components are passed.
- Remove nesting where a provider provides another provider.
  Since AdSupportProvider then only provides one thing, it
  can be renamed to AdsLoaderProvider, which more clearly
  expresses what it provides.

PiperOrigin-RevId: 330396334
2020-09-07 20:43:41 +01:00
olly
8e5336c59e Dev guide: Start updating the download page
PiperOrigin-RevId: 329719402
2020-09-07 20:41:55 +01:00
olly
b79e2e069f SessionPlayerConnector: Use setter for ControlDispatcher
This brings SessionPlayerConnector in line with other
components that use a ControlDispatcher in the ExoPlayer
library, all of which have a setter.

PiperOrigin-RevId: 329665767
2020-09-07 20:41:00 +01:00
andrewlewis
47561f200f Fix handling of incompatible VPAID ads
Issue: #7832
PiperOrigin-RevId: 329497598
2020-09-07 20:40:13 +01:00
gyumin
d155416c54 Add Util.postOrRun
To avoid repetition, it adds Util.postOrRun and replaces existing
instances with the util method.

PiperOrigin-RevId: 329472769
2020-09-07 20:40:04 +01:00
andrewlewis
74c493f51e Add back support for setting audio pitch
To play slow motion streams where the audio has been recorded at
slower speeds, it is necessary to be able to resample (rather than
time-stretch) the audio. This change undeprecates back the previously
deprecated PlaybackParameters class to allow apps to set pitch.

PiperOrigin-RevId: 328703116
2020-08-27 12:06:41 +01:00
jaewan
25c26cdbb4 Return state masked Player values from SessionPlayerConnector
Before this CL, SessionPlayerConnector getters had returned
UNKNOWN_TIME in idle state. It was because
SessionPlayerConnector had followed AndroidX media2
MediaPlayer's behavior, which was the baseline code of the
SessionPlayerConnector.

With this CL, SessionPlayerConnector getters directly return
underlying Player's value, rather than considering calls
in IDLE state as an exception and fallbacks to the default
UNKNOWN_TIME.

PiperOrigin-RevId: 327420940
2020-08-21 12:50:56 +01:00
jaewan
e965ed92f8 Rename DefaultMediaItemProvider to MediaIdMediaItemProvider
PiperOrigin-RevId: 327307736
2020-08-21 12:50:29 +01:00