6658 Commits

Author SHA1 Message Date
bachinger
d8df5411b8 Fix flaky test
PiperOrigin-RevId: 334801561
2021-01-08 16:46:18 +00:00
ibaker
1cb346ee17 Bump version to 2.12.2
PiperOrigin-RevId: 344801462
2020-11-30 16:32:13 +00:00
olly
0e4d3162eb SonicAudioProcessor: Fix scaling to account for pending input bytes
PiperOrigin-RevId: 344420436
2020-11-30 10:51:19 +00:00
olly
26aa6f6dbf DefaultAudioSink: Fix transient position calculation errors
PiperOrigin-RevId: 344408351
2020-11-30 10:51:10 +00:00
olly
46396a93e9 Make special exception for cleartext-not-permitted
#exofixit

PiperOrigin-RevId: 344246408
2020-11-30 10:51:03 +00:00
olly
41d6c26904 Improve Player next/previous documentation
#exofixit
Issue: #5602
PiperOrigin-RevId: 344093622
2020-11-30 10:42:44 +00:00
olly
27d8bcf4cb Support enabling next/previous actions in PlayerNotificationManager
The ref'd issue was marked as a doucmentation candidate, but I think
the confusion likely arises from the lack of "next" and "previous" in
the method names. Our other UI components also support enabling each
button individually, so this also brings notifications in line with
those.

Issue: #6491
#exofixit
PiperOrigin-RevId: 344058969
2020-11-30 10:42:06 +00:00
kim-vde
d605b6c766 Merge pull request #8257 from xufuji456:dev-v2
PiperOrigin-RevId: 344057097
2020-11-30 10:41:52 +00:00
christosts
07a8b59a2e Set tag for every track in TrackSelectionView
#minor-release

PiperOrigin-RevId: 344051610
2020-11-30 10:40:03 +00:00
olly
d5829336eb Remove unused logic in SonicAudioProcessor
PiperOrigin-RevId: 343882631
2020-11-30 10:40:02 +00:00
ibaker
a04400cfb9 Tweak ParsableByteArray#readLine javadoc
Don't refer to the "system's default charset", just specify UTF-8
explicitly.

PiperOrigin-RevId: 343839878
2020-11-30 10:32:19 +00:00
olly
3a8524d044 Fix ProgressiveDownloader retry logic
RunnableFutureTask is not reusable. Trying to reuse it meant that a
failure in one doWork() call would cause subsequent download() calls
to (a) not block until the runnable has finished executing (does not
apply when using a direct executor), and (b) throw the same failure
as thrown from the first doWork() call.

This could cause #8078 if the initial failure occurred before the
content length was resolved. Retries are not blocked on their work
completing due to (a), and the download would be marked as failed due
to (b). The work itself could then resolve the content length, which
causes the stack trace in this issue.

Issue: #8078
PiperOrigin-RevId: 343498252
2020-11-23 11:08:09 +00:00
tonihei
10164d7491 Fix bug in SampleQueue.discardTo for duplicate timestamps.
When a stream has duplicate timestamps we currently discard to
the last sample with the specified discardTo timestamp, but
it should be the first one to adhere to the method doc and the
intended usage.

#minor-release

PiperOrigin-RevId: 343458870
2020-11-23 09:58:49 +00:00
olly
305ec3b449 Minimal fix for playback freezes when enabling tracks #8203
Background:

1. When the player has multiple audio renderers, by default they share a
   single AudioSink.
2. When any new renderer is enabled, all disabled renderers are reset
   prior to the new renderer being enabled. This is to give them a chance
   to free up resources in case the renderer being enabled needs them. These
   reset calls are expected to be no-ops for renderers that have never been
   enabled.

The issue:

The problematic case arises when there are two audio renderers and a third
renderer (e.g., text) is being enabled. In this case, the disabled audio
renderer's reset call ends up resetting the AudioSink that's shared with the
enabled audio renderer. The enabled audio renderer is then unable to make
progress, causing playback to freeze.

This is a minimal fix that directly prevents the mentioned issue. There are
multiple follow-ups that would probably make sense:

1. Having ExoPlayerImplInternal track which renderers need to be reset, and
   only resetting those renderers rather than all that are disabled. This
   seems like a good thing to do regardless, rather than relying on those
   calls being no-ops.
2. If we want to continue sharing AudioSink, we need to formalize this much
   better and make sure we have good test coverage. Messages like
   MSG_SET_VOLUME are also delivered to the AudioSink multiple times via
   each of the renderers, which works currently because DefaultAudioSink
   no-ops all but the first call in each case. This is pretty fragile though!

Issue: #8203
PiperOrigin-RevId: 343296081
2020-11-23 09:58:49 +00:00
olly
3509f50783 Fix fastforward and rewind color tinting and text alignment
Issue: #7898
PiperOrigin-RevId: 343251455
2020-11-23 09:58:48 +00:00
aquilescanta
78d65818c6 Fix HLS format derivation in traditional preparation
ExoPlayer's traditional HLS preparation works by loading a chunk from each track
group, and then tries to use the sample information plus the master playlist
information to generate the preparation's resulting TrackGroups.

There are 3 possible scenarios:
- Supported case: Each variant has a single codec string per track type. We can
  assign each track the codec string which matches the loaded sample's type.
- Supported case: Each variant has more than one codec string, but each track
  group has a single track. This is the case when different languages use
  different codecs. In this case, we can assign whichever codec matches the
  loaded sample's mime type.
- Unsupported case: Each variant has more than one codec string, and track
  groups contain more than one track. We are not able to safely map tracks to
  codec strings because that would require loading a chunk from each track
  (which would considerably delay preparation).

Broken in:
4783c329cc

PiperOrigin-RevId: 343072201
2020-11-23 09:58:48 +00:00
olly
bb8a2de37d Update Styled Player settings dialogs to respect RTL.
PiperOrigin-RevId: 342672124
2020-11-23 09:58:48 +00:00
tonihei
5698eadc08 Discard buffer synchronously after seek before cancelling a load.
This ensures the buffer is not full when the `DefaultLoadControl` determines
whether we should continue loading and thus prevents a false warning about
not having enough memory left.

PiperOrigin-RevId: 342616623
2020-11-23 09:58:48 +00:00
insun
82969c823c Increase touch target height of timebar in StyledPlayerControlView
This change also introduces gravity attribute to DefaultTimeBar.

PiperOrigin-RevId: 342573167
2020-11-23 09:58:43 +00:00
olly
0520c7d337 Remove C.StreamType constant that's not a real stream type
#minor-release

PiperOrigin-RevId: 341833274
2020-11-19 16:55:42 +00:00
olly
12e428ec87 Fix incorrect IntDef usage
#minor-release

PiperOrigin-RevId: 341668326
2020-11-19 16:55:34 +00:00
kimvde
8e638ec753 Work around AudioManager#getStreamVolume crashes
Issue:#8191
PiperOrigin-RevId: 341632732
2020-11-19 16:55:21 +00:00
bachinger
11b09dd58d Add dispatchPrepare(player) to ControlDispatcher
Issue: #7882
PiperOrigin-RevId: 341394254
2020-11-19 16:54:23 +00:00
ibaker
81d68317ac Fix or suppress nullness warnings introduced by checkerframework 3.7.0
PiperOrigin-RevId: 340826532
2020-11-19 16:52:32 +00:00
olly
c9683195c0 Matroska: Support additional PCM codec modes
- Support 32-bit A_PCM/FLOAT/IEEE PCM
- Support 8-bit and 16-bit A_PCM/INT/BIG PCM

Issue: #8142
PiperOrigin-RevId: 340264679
2020-11-19 16:44:18 +00:00
Oliver Woodman
ac1ffa4fc2 Merge pull request #8133 from xufuji456:dev-v2
PiperOrigin-RevId: 340254878
2020-11-19 16:40:03 +00:00
ibaker
07455da2f5 Migrate Tx3gDecoderTest to Guava and SpannedSubject
#minor-release

PiperOrigin-RevId: 340249019
2020-11-19 16:39:53 +00:00
olly
379cd8a04f Make defaultLicenseUrl optional
Some content types always provide the license URL in the media.
The PlayReady example in the demo app doesn't provide a default
license URL for this reason, as an example.

#minor-release

PiperOrigin-RevId: 340125784
2020-11-18 19:10:50 +00:00
ibaker
44c2ddb076 Suppress ProGuard warnings related to Guava's compile-only deps
Without these lines, ProGuard fails on the demo app (R8 works).

Also include some more `-dontwarn` lines from
https://github.com/google/guava/wiki/UsingProGuardWithGuava

Issue: #8103
PiperOrigin-RevId: 339050634
2020-11-18 19:09:41 +00:00
andrewlewis
1264dbcd36 Handle stream volume register/unregister errors
Issue: #8106
Issue: #8087
PiperOrigin-RevId: 338664455
2020-11-18 19:07:04 +00:00
aquilescanta
da663aa081 Avoid chunkless preparation if the codec mapping is ambiguous
Issue: #7877
PiperOrigin-RevId: 338659937
2020-11-18 18:54:37 +00:00
aquilescanta
806681dd16 Map HLS sample formats to the correct codec string
This change fixes format creation for traditional preparation of streams
where the master playlist contains more than one codec string per track
type.

Issue: #7877
PiperOrigin-RevId: 338538693
2020-11-18 18:50:35 +00:00
aquilescanta
3d8c9b0bf8 Allow multiple codecs with same type in DefaultHlsExtractorFactory
When disabling a TsExtractor track type because of a missing codec
in the master playlist, look through the entire codecs string
instead of checking the first codec with matching type.

Issue: #7877
PiperOrigin-RevId: 338530046
2020-11-18 18:48:46 +00:00
olly
d7e8238b88 Bump version to 2.12.1
PiperOrigin-RevId: 338261975
2020-10-21 22:36:32 +01:00
insun
de2b58e7e1 Fix bottom area to have even paddings and make seekbar slimmer.
Also removed unused thumb resources.

PiperOrigin-RevId: 338184661
2020-10-21 10:27:24 +01:00
Oliver Woodman
452f68fb6c Merge pull request #7867 from GeneticGenesis:pc/update-expected-http-statuses-for-failover
PiperOrigin-RevId: 338051017
2020-10-20 22:16:12 +01:00
Oliver Woodman
d2fb9dda82 Merge pull request #8088 from xufuji456:dev-v2
PiperOrigin-RevId: 338024866
2020-10-20 22:16:12 +01:00
krocard
e72082710c AudioSink: Remove comment about unconfirmed crash
Consensus is that the NoClassDefFoundError does not
causes a crash but only a warning.

PiperOrigin-RevId: 338022354
2020-10-20 22:16:12 +01:00
Oliver Woodman
7303005873 Merge pull request #8030 from yqritc:add-output-surface-workaround
PiperOrigin-RevId: 338016707
2020-10-20 22:16:12 +01:00
andrewlewis
fac3515016 Move DataSource reading methods into Util
This will be used to read ads responses out of data: URLs in a subsequent
change.

PiperOrigin-RevId: 334778780
2020-10-20 22:16:12 +01:00
krocard
0de938c4aa Do not inherit directly from AudioTrack.StreamEventCallback
This was causing issues old devices where the class
inheriting StreamEventCallback was loaded even though
it was not used.

Instead use an anonymous class that seem to be loaded
more lazily.

PiperOrigin-RevId: 337252687
2020-10-20 22:16:12 +01:00
krocard
ec96e0c495 Add MiTV devices requiring the output surface workaround
Issue: #8014
PiperOrigin-RevId: 337142176
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
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
kimvde
947b637441 Small fix in IndexSeekMap
This change was meant to be in 2e5f2f12ad but
was not added my mistake.

PiperOrigin-RevId: 337041686
2020-10-20 22:16:12 +01:00
bachinger
36c2fe1053 Add missing properties of MediaItem.Subtitle
Issue: #8044
PiperOrigin-RevId: 336955479
2020-10-20 22:16:12 +01:00
kim-vde
8f04968fb1 Merge pull request #7378 from shenwill:dev-v2
PiperOrigin-RevId: 336875300
2020-10-20 22:16:12 +01:00
olly
3149dd0ffc Fix a couple of StyledPlayerControlView bugs
1. The first time the player controls are are made visible,
   there is no animation.
2. The first time the player controls are made visible, the
   "select tracks" button isn't displayed. When tapping to
   subsequently hide the player controls, the button briefly
   becomes visible and then is hidden again. This bug is due
   to state in StyledPlayerControlViewLayoutManager being
   out of sync, resulting in StyledPlayerControlView's
   onVisibilityChange not being called properly.

After this change both of these issues should be resolved.

PiperOrigin-RevId: 336704031
2020-10-20 22:16:10 +01:00
andrewlewis
8dc6b7e8c5 Update translations for UI module
This should fix gradle errors like: "warn: removing resource
com.google.android.exoplayer2.demo:string/exo_controls_fastforward_by_amount_description
without required default value."

PiperOrigin-RevId: 336670827
2020-10-20 22:11:34 +01:00
ibaker
907d10705a Use MP4VTT MIME type in DashManifestParser (again)
We stopped using using this MIME type in
74a9d8f680

This broke subtitle decoding in some cases (Issue: #7985), which I
fixed in
7b8895d655.

After some discussion we've decided SubtitleDecoderFactory shouldn't
depend on Format.containerMimeType (since the samples have already been
extracted by this point, so the container shouldn't matter). So this
change fixes DashManifestParser to use MimeTypes.APPLICATION_MP4VTT (and
reverts the no-longer-needed SubtitleDecoderFactory change).

PiperOrigin-RevId: 336668450
2020-10-20 22:11:34 +01:00