9793 Commits

Author SHA1 Message Date
tonihei
362d4f5b16 Add convenience constructor methods.
When passing in ExtractorFactory instances to SimpleExoPlayer.Builder or
DefaultMediaSourceFactory, we currently need to pass in one other
instance (RenderersFactory or DataSource.Factory), that developers will
often set to its default. To avoid specifying these defaults, these new
convience methods allow to just set the ExtractorsFactory if required.

PiperOrigin-RevId: 330908002
2020-09-11 13:24:04 +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
andrewlewis
abc39088d0 Remove testutil dependency on Robolectric shadows
Move shadow-related utils for end-to-end tests into core test.

PiperOrigin-RevId: 330902696
2020-09-11 13:23:45 +01:00
kimvde
6abe6a676e Support android.resource URI scheme
Issue: #7866
PiperOrigin-RevId: 330736774
2020-09-09 17:43:15 +01:00
olly
9e42b24e26 Fix Javadoc for DefaultDataSourceFactory constructors
PiperOrigin-RevId: 330736458
2020-09-09 17:43:06 +01:00
insun
222ba22b10 Fix not to show repeat button when its mode is NONE.
PiperOrigin-RevId: 330627047
2020-09-09 09:42:00 +01:00
olly
b2b08ade99 Make User-Agent optional
PiperOrigin-RevId: 330593247
2020-09-09 09:41:51 +01:00
tonihei
bfe17aee3e Support ExtractorFactory in DefaultMediaSourceFactory.
This allows to customize extractor flags more easily when setting up the player.

In addition, we need to provide a way to pass in the ExtractorFactory through
the constructor chain starting in SimpleExoPlayer so that removing the
DefaultExtractorsFactory is possible for R8.

PiperOrigin-RevId: 330472935
2020-09-09 09:41:42 +01:00
olly
3110587fbe Fix extension renderer test names + add FfmpegVideo case
PiperOrigin-RevId: 330409635
2020-09-09 09:41:32 +01:00
olly
312e260f71 Update release notes
- Remove SampleQueue changes (they're being picked up in 2.12, but
  are sufficiently minor to not warrant a release note)
- Update 2.12 estimated release date

PiperOrigin-RevId: 330409443
2020-09-09 09:41:22 +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
Oliver Woodman
442aa78196 Merge pull request #7814 from zubcoco:dev-v2
PiperOrigin-RevId: 330366909
2020-09-07 20:43:30 +01:00
samrobinson
99dbb76455 Allow Format change in GTS test for MediaFormat time check.
PiperOrigin-RevId: 330348510
2020-09-07 20:43:19 +01:00
insun
ea158dcdb0 Apply styled widget's bug fixes to legacy widget
- Prevent buffering when clicking ffwd button at the end of stream
- Set VR button disabled when listener is not registered

PiperOrigin-RevId: 330039336
2020-09-07 20:43:10 +01:00
olly
45dc66ef2f Clear CodecInfos on InputFormat if codec is null
In maybeInitCodecWithFallback, it caches availableCodecInfos with mediaCryptoRequiresSecureDecoder and inputFormat as inputs, and won't clear it if shouldInitCodec is false, resulting in a case where availableCodecInfos is not null and codec is null.
When we have a new format, it's reasonable to clear availableCodecInfos if codec is null. Otherwise we might not be able to properly initialize a new codec.

PiperOrigin-RevId: 329971796
2020-09-07 20:43:00 +01:00
samrobinson
d1631cf86f Disable MediaFormat time check GTS test temporarily.
PiperOrigin-RevId: 329956142
2020-09-07 20:42:51 +01:00
christosts
8dcab1d20a Remove fragile tests
PiperOrigin-RevId: 329894431
2020-09-07 20:42:42 +01:00
insun
f68faff30b Set VR button disabled when listener is not registered (styled view)
PiperOrigin-RevId: 329851964
2020-09-07 20:42:33 +01:00
olly
fd71e38db3 Fix DASH/SS/HLS module readme files
PiperOrigin-RevId: 329751934
2020-09-07 20:42:23 +01:00
olly
fe2fc8b73f Add useful DownloadRequest to MediaItem conversion method
PiperOrigin-RevId: 329722775
2020-09-07 20:42:14 +01:00
olly
b5a4dc8f36 Fix dispatch of play when in IDLE or ENDED
PiperOrigin-RevId: 329722282
2020-09-07 20:42:04 +01:00
olly
8e5336c59e Dev guide: Start updating the download page
PiperOrigin-RevId: 329719402
2020-09-07 20:41:55 +01:00
samrobinson
0f29b9e84d Change GTS test boolean to a final variable.
PiperOrigin-RevId: 329714283
2020-09-07 20:41:46 +01:00
christosts
29f2a31af7 Re-enable ignored unit tests
PiperOrigin-RevId: 329675833
2020-09-07 20:41:36 +01:00
insun
f31411b128 Revise Play/Pause button toggling logic
This CL fixes two bugs:
- Play/pause button toggling looked inconsistent when playback fails.
  When player state goes into idle, play button should dispatch
  playwhenready again.
- Clicking play button at the end of stream should restart playback.
  But previously it changed playwhenready state and so playback has
  been paused. This CL fix it.

PiperOrigin-RevId: 329675660
2020-09-07 20:41:27 +01:00
insun
be103ac553 Add padding to styled widget's settings items
PiperOrigin-RevId: 329671522
2020-09-07 20:41:18 +01:00
olly
5c24d1ccea Clean up unnecessary use of full package name
PiperOrigin-RevId: 329666401
2020-09-07 20:41:09 +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
56e622a2e5 Fix release notes link
PiperOrigin-RevId: 329665766
2020-09-07 20:40:51 +01:00
insun
3ab9bc8e7f Fix internal demo app crash
Internal demo app crashed when device does not support required DRM scheme.
This CL fixes it.

PiperOrigin-RevId: 329653841
2020-09-07 20:40:41 +01:00
insun
f68fc3e701 Prevent buffering when clicking ffwd button at the end of stream
PiperOrigin-RevId: 329634001
2020-09-07 20:40:32 +01:00
ibaker
5b80eb8ecc Enable multidex for the playback tests
PiperOrigin-RevId: 329527311
2020-09-07 20:40:23 +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
ibaker
91185500a1 Remove usage of assertThrows from ExoPlayer GTS tests
The environment these tests are executed in is only using JUnit 4.10,
which doesn't have assertThrows.

PiperOrigin-RevId: 329462985
2020-09-07 20:39:55 +01:00
olly
17b370d00c Allow upstream discards from the SampleQueue by time.
Add a SampleQueue method to discard from the write side of the queue by timestamp

PiperOrigin-RevId: 329303714
2020-09-07 20:39:46 +01:00
olly
440fd1cf62 Some minor tweaks
1. Add EventLogger right away in PlayerActivity, else it doesn't log
   playWhenReady being initially set to true.
2. Remove EventLogger logging for the audio position advancing. It's
   redundant with isPlaying logging unless you're very specifically
   interested in the timing difference.
3. Remove unnecessary comment in Player.
4. Fix Timeline Javadoc.

PiperOrigin-RevId: 328983944
2020-09-07 20:39:36 +01:00
olly
e163fe6949 Optimize AAC seeking except for xHE-AAC
In 2.11.2 to 2.11.5, we considered all AAC streams as consisting
only of sync samples. In 2.11.6+, we considered no AAC streams as
consisting of sync samples, because the property is not guaranteed
specifically for xHE-AAC. This will have caused a small regression
is seek speed for some types of media.

This change brings back the optimization for AAC, specifically
excluding only xHE-AAC (and cases where we don't know what type of
AAC we're dealing with).

PiperOrigin-RevId: 328950697
2020-09-07 20:39:27 +01:00
christosts
3dbb4c4da9 Migrate test repeatModeChanges() to TestExoPlayer
PiperOrigin-RevId: 328918314
2020-09-07 20:39:18 +01:00
bachinger
0045d20d2c Document how to set the priority on API level above 25
Issue: #7820
PiperOrigin-RevId: 328917063
2020-09-07 20:39:08 +01:00
bachinger
8a8a1517ec Handle KEYCODE_HEADSETHOOK as alias of KEYCODE_MEDIA_PLAY_PAUSE
ISSUE: #7813
PiperOrigin-RevId: 328910220
2020-09-07 20:38:59 +01:00
christosts
603dcf4978 Download offline DRM license from non-UI thread
PiperOrigin-RevId: 328904901
2020-09-07 20:38:48 +01:00
Corentin Zuber
7bfde6a5ea Fix comments 2020-09-03 10:19:55 +02:00
olly
e1c3da2a74 Set 2.12 release date & merge in some recent changes
PiperOrigin-RevId: 328747057
2020-08-27 22:30:28 +01:00
Corentin Zuber
50582417cb Authorize multiple preffered language and text 2020-08-27 16:50:28 +02:00
aquilescanta
91b3aad063 Make ExoPlayer.getPlaybackLooper never return null
Issue: #7807
PiperOrigin-RevId: 328726966
2020-08-27 14:41:42 +00:00
tonihei
237cb9df54 Merge pull request #7804 from yoobi:TrackSelectionDialogBuilderTheme
PiperOrigin-RevId: 328726246
2020-08-27 14:41:28 +00:00
Oliver Woodman
cfb429d131 Merge branch 'release-v2' into dev-v2 2020-08-27 12:09:17 +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
Oliver Woodman
8b3422ba54 Merge pull request #7800 from TakuSemba:apply-output-surface-workaround
PiperOrigin-RevId: 328696935
2020-08-27 12:06:30 +01:00