1228 Commits

Author SHA1 Message Date
olly
5b51cb7284 Reference IMA language code bug
PiperOrigin-RevId: 343883034
2020-11-30 10:40:02 +00:00
olly
10bc77c15d Localize IMA based on device locale by default
PiperOrigin-RevId: 343871061
2020-11-30 10:39:44 +00:00
sungsoo
6edf52b2c5 Allow to remove all playlist items
PiperOrigin-RevId: 343437513
2020-11-23 09:58:49 +00:00
sungsoo
3f2eb9d732 Refactor ComponentListener of PlayerWrapper
PiperOrigin-RevId: 343432873
2020-11-23 09:58:49 +00:00
olly
1f49867746 Fix CronetDataSource handling of 200 response for range request
Issue: #8090
#minor-release
PiperOrigin-RevId: 342638922
2020-11-23 09:58:48 +00:00
bachinger
11b09dd58d Add dispatchPrepare(player) to ControlDispatcher
Issue: #7882
PiperOrigin-RevId: 341394254
2020-11-19 16:54:23 +00:00
andrewlewis
3f9488b7cd 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-19 16:52:22 +00:00
andrewlewis
2d022a21b3 Fix buildForAdsResponse
PiperOrigin-RevId: 340198099
2020-11-18 19:16:33 +00:00
andrewlewis
0c9e92136a 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-18 19:10:35 +00:00
andrewlewis
f1126ce514 Improve progress update logs
Add logging for ad progress and switch from deprecated getters to new
millisecond getters.

PiperOrigin-RevId: 339226534
2020-11-18 19:10:09 +00:00
andrewlewis
8759874924 Improve handling of VPAID ads
Issue: #7832
PiperOrigin-RevId: 339087555
2020-11-18 19:09:57 +00:00
andrewlewis
7cc129d7b7 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-18 19:08:38 +00:00
aquilescanta
9ad70246e6 Treat -1000 duration as unknown duration for live streams in Cast
Issue: #7983
#minor-release
PiperOrigin-RevId: 339016928
2020-11-18 19:07:13 +00:00
andrewlewis
c3643ec682 Allow enabling IMA ext debug mode programmatically
PiperOrigin-RevId: 337824945
2020-10-20 22:16:12 +01:00
aquilescanta
e446f02eb9 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-20 22:16:12 +01:00
andrewlewis
e0c9165270 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-20 22:16:12 +01:00
bachinger
2b6a9a346a Use Math.round(double) to avoid result being limited to Integer.MAX_INT
Issue: #8067
PiperOrigin-RevId: 337122011
2020-10-20 22:16:12 +01:00
ibaker
a635bdd4ba 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-20 22:16:12 +01:00
Oliver Woodman
6611ac48c5 Add a way to override ad media MIME types
Issue: #7961
PiperOrigin-RevId: 337069152
2020-10-20 22:16:12 +01:00
andrewlewis
5cc6dac77c 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-20 22:16:12 +01:00
andrewlewis
53c4a393f3 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-20 22:16:12 +01:00
bachinger
c8879392ab Make resetPosition reset the position if true
Issue: #8024
PiperOrigin-RevId: 335846035
2020-10-17 12:18:39 +01:00
andrewlewis
837cdc4f67 Fix miscellaneous nits/typos
PiperOrigin-RevId: 335642909
2020-10-17 12:18:13 +01:00
andrewlewis
88abe26ec3 Allow apps to add a VideoAdPlayerCallback
Issue: #7944
PiperOrigin-RevId: 335012643
2020-10-17 12:16:39 +01:00
andrewlewis
f3767b3185 Add ImaUtil for IMA extension utilities
PiperOrigin-RevId: 334567234
2020-10-17 11:53:34 +01:00
andrewlewis
358d205f0f Use Builder in ImaAdsLoader constructor
PiperOrigin-RevId: 334562209
2020-10-17 11:53:29 +01:00
andrewlewis
1bdccd4bfb 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-10-17 11:52:12 +01:00
olly
a15d01d36f More verbose instructions for consistency
PiperOrigin-RevId: 332015471
2020-09-16 17:03:35 +01:00
aquilescanta
d1ce5f5b24 Update the FFmpeg extension readme to use symlinking
PiperOrigin-RevId: 332012857
2020-09-16 17:03:24 +01:00
aquilescanta
fe2bc7ba71 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 17:03:19 +01:00
Oliver Woodman
4ab966dc96 Improve IMA readme 2020-09-12 22:19:02 +01:00
Oliver Woodman
3f6e5ce676 Update IMA readme 2020-09-12 21:28:58 +01:00
olly
a5bf3f4191 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:07:50 +01:00
olly
12b0537c2f Clean up some lint warnings
PiperOrigin-RevId: 331162350
2020-09-11 17:40:19 +01:00
bachinger
a8298fa746 MediaItemify the IMA extension README and the ads page in dev guide
PiperOrigin-RevId: 331155539
2020-09-11 17:39:40 +01:00
andrewlewis
b6842cf0f0 Fix handling of empty ad groups at non-integer cue points
Issue: #7889
PiperOrigin-RevId: 331149688
2020-09-11 17:39:12 +01:00
olly
9fb2902dad Exclude Guava transitive annotation dependencies
PiperOrigin-RevId: 331148067
2020-09-11 16:02:37 +01:00
andrewlewis
a67bebc1c9 Improve DEBUG VideoProgressUpdate logging
PiperOrigin-RevId: 330918689
2020-09-11 13:29:39 +01:00
andrewlewis
0266971406 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:28:51 +01:00
olly
49699d398d Make User-Agent optional
PiperOrigin-RevId: 330593247
2020-09-09 09:45:48 +01:00
olly
7dd4c736c3 Fix extension renderer test names
PiperOrigin-RevId: 330409635
2020-09-09 09:45:27 +01:00
Oliver Woodman
6c7884436a Remove unfinished FfmpegVideoRenderer from release 2020-09-07 20:48:28 +01:00
olly
6cce608f32 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:46:57 +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