747 Commits

Author SHA1 Message Date
tonihei
9725132e3c Update default min duration for playbacks with video to match max duration.
Experiments show this is beneficial for rebuffers with only minor impact
on battery usage.

Configurations which explicitly set a minimum buffer duration are unaffected.

Issue:#2083
PiperOrigin-RevId: 244823642
2019-04-26 18:28:32 +01:00
andrewlewis
b01075f325 Play out remaining data on reconfiguration
Before this change we'd release the audio track and create a new one as soon
as audio processors had drained when reconfiguring.

Fix this behavior by stop()ing the AudioTrack to play out all written data.

Issue: #2446
PiperOrigin-RevId: 244812402
2019-04-26 18:27:53 +01:00
aquilescanta
4ea2463856 Avoid selecting a forced text track that doesn't match the audio selection
Assuming there is no text language preference.

PiperOrigin-RevId: 244176667
2019-04-18 15:18:48 +01:00
andrewlewis
2347bd2c99 Prioritize decoders with format support
PiperOrigin-RevId: 244167456
2019-04-18 15:17:14 +01:00
olly
c9470296ab Fix playback of badly clipped MP3 streams
Issue: #5772
PiperOrigin-RevId: 243987497
2019-04-18 15:14:23 +01:00
olly
10f3b8db6e Update release notes for 2.10 branch cut
PiperOrigin-RevId: 243821394
2019-04-18 15:12:47 +01:00
borrelli
0be4bee25f Add "setCustomErrorMessage" override that allows including an extras bundle with a custom error.
PiperOrigin-RevId: 243807109
2019-04-16 16:41:49 +01:00
borrelli
9fc3ea79a1 Add ability to register/unregister custom CommandReceivers.
PiperOrigin-RevId: 243799572
2019-04-16 15:28:57 +01:00
aquilescanta
e9a7d47f62 Move the RELEASENOTES entry for PlayReady's LA_URL workaround from HLS to DRM
PiperOrigin-RevId: 243618907
2019-04-16 15:26:24 +01:00
olly
18dd3fdb46 Bump release to 2.10.0 and update release notes
PiperOrigin-RevId: 243592790
2019-04-16 15:25:47 +01:00
aquilescanta
936bc244b6 Add an HLS metadata entry sublcass to populate HLS track formats
Include information to facilitate adaptive track selection in HLS.

PiperOrigin-RevId: 243238232
2019-04-13 01:41:23 +01:00
andrewlewis
53934c13b2 Select non-primary tunneling decoder
Issue: #3100
Issue: #5547
PiperOrigin-RevId: 243181217
2019-04-13 01:40:43 +01:00
andrewlewis
401e20d9c8 Signal fallback via renderer constructor
Remove MediaCodecSelector.DEFAULT_WITH_FALLBACK, as codec selectors
will need to be able to return a list of decoder infos even when not
using fallback in a later change. Instead signal that fallback should
be used via a renderer constructor.

Fallback is always disabled for audio.

PiperOrigin-RevId: 242454172
2019-04-13 01:33:47 +01:00
bachinger
baf00406c0 Provide option to include next/prev button in lock screen/compact mode.
Issue: #5616
PiperOrigin-RevId: 242452686
2019-04-13 01:33:28 +01:00
tonihei
346c72c00e Move PriorityTaskManager from DefaultLoadControl to SimpleExoPlayer.
The priority task manager only needs to listen to loading state changes and
is independent of the rest of DefaultLoadControl. This also fixes problems
where the player stops loading without consultin the LoadControl.

PiperOrigin-RevId: 242098374
2019-04-05 21:14:09 +01:00
bachinger
b10f4023f0 handle meta atom as a full box when parsing mp4
Issues: #5698, #5694
PiperOrigin-RevId: 241762106
2019-04-05 21:12:16 +01:00
andrewlewis
9dc22c3086 Enable HDMV DTS stream detection if a flag is set
Issue: #5330
PiperOrigin-RevId: 241381723
2019-04-01 21:06:59 +01:00
bachinger
e612511afc take byte offset into account when unsynchronizing an id3 frame
Issue #5673

PiperOrigin-RevId: 241328598
2019-04-01 20:32:40 +01:00
tonihei
5fd4fddfac Use system Locale language to select audio track.
If no track matches the preferred language or no preferred language is provided,
use the system Locale language as the next decision criterion.

PiperOrigin-RevId: 241322703
2019-04-01 20:32:21 +01:00
aquilescanta
129a64c477 Use getItemIds to get the actual size of the Cast media queue
Issue:#4964
PiperOrigin-RevId: 241311763
2019-04-01 20:32:01 +01:00
olly
592b5eafee Support multiple CC channels in DASH
Issue: #5656
PiperOrigin-RevId: 241235377
2019-04-01 20:31:18 +01:00
tonihei
b0bb6ec8a5 Allow to set selection reason and data when specifying an override.
It's currently very difficult to actually set a reason for track selection
triggered by a SelectionOverride. It would require creating a new custom
TrackSelection.Factory where the reason gets injected somehow before the
override is specified on the player.

Simplify this whole procedure by allowing to set the reason directly and
forward this reason to all fixed selections created based on this override.

PiperOrigin-RevId: 240114942
2019-03-26 10:41:00 +00:00
Toni
5da4c67c8a Merge pull request #5303 from DolbyLaboratories:dev-v2-ac4
PiperOrigin-RevId: 239957730
2019-03-26 10:40:18 +00:00
olly
77d597de5f Parse CHARACTERISTICS attribute for EXT-X-MEDIA tags
PiperOrigin-RevId: 239844963
2019-03-22 19:57:01 +00:00
tonihei
e5aed73fba Switch format language tag to use full BCP 47 codes.
This allows to distinguish between regional variants and scripts.

We still need to normalize the language code itself to make track selection
independent of the whether 2 or 3 letter codes are used.

PiperOrigin-RevId: 239783115
2019-03-22 19:56:25 +00:00
tonihei
3543116da4 Prevent seeking when ICY metadata is present.
Any seek map with non-zero offsets breaks playback with ICY metadata as
the metadata is no longer read from the correct position.

Issue:#5658
PiperOrigin-RevId: 239605839
2019-03-22 19:56:06 +00:00
Oliver Woodman
a86a9137be Merge pull request #5578 from szaboa:dev-v2-5529
PiperOrigin-RevId: 239398940
2019-03-20 23:28:28 +00:00
aquilescanta
c81c14ae86 Work around lack of LA_URL attributes in PlayReady key requests init data
PiperOrigin-RevId: 239066912
2019-03-20 23:26:49 +00:00
olly
2959b5f9c2 Roll forward of 238625384.
PiperOrigin-RevId: 238666870
2019-03-20 23:26:49 +00:00
olly
a291d6221f Automated g4 rollback of changelist 238625384.
*** Original change description ***

Allow exoplayer/v2 mockito2

***

PiperOrigin-RevId: 238626401
2019-03-20 23:26:49 +00:00
olly
07702cecdd Allow exoplayer/v2/ mockito2
PiperOrigin-RevId: 238625384
2019-03-20 23:26:10 +00:00
andrewlewis
7acc0ee798 Fix ProgressiveMediaSource DefaultExtractorsFactory proguarding
PiperOrigin-RevId: 237900673
2019-03-15 04:52:19 +00:00
tonihei
d92973dbe2 Add release notes for time bar changes.
PiperOrigin-RevId: 237416206
2019-03-15 04:50:51 +00:00
tonihei
2ae07936ba Handle !resetPosition as initial seek position.
The flag in ExoPlayer.prepare is documented as keeping the current window
index and window position. We are currently using the current period UID and
period position instead. This causes problems when the media source is changed
but the position is not reset.

Using the initial seek position instead ensures we actually use the window
index and position.

Issue:#5520
PiperOrigin-RevId: 236101024
2019-03-06 17:29:18 +00:00
tonihei
377e550d0f Improve new error type documentation and prevent NPE in error listener.
Adding new error types may cause issues when listeners assume a fixed set of
error types and don't handle arbitrary defaults.

Fixing error handling in one case and improving documentation to make people
aware of the issue.

PiperOrigin-RevId: 236093265
2019-03-06 17:29:18 +00:00
bachinger
e8077fb3f4 honour shuffle order when publishing queue to media session
Issue #5360

PiperOrigin-RevId: 235196177
2019-03-06 16:54:26 +00:00
andrewlewis
8746d4a885 Automated g4 rollback of changelist 230206675.
*** Reason for rollback ***

Reverting as this may break playback on other Amlogic devices and/or playback of non-interlaced content.

*** Original change description ***

Add max video size workaround for Amlogic decoder.

The Amlogic awesome decoder reduces the video size of interlaced videos by half
if the internal configuration isn't force reset with new maximum input size
values. The product of these new values must exceed 1920x1088 to force the
reset.

Issue:#5003

***

PiperOrigin-RevId: 234967314
2019-02-21 11:56:10 +00:00
aquilescanta
0d24098c7d Remove lates HLS changes from 2.9.6 release notes
PiperOrigin-RevId: 234765847
2019-02-20 13:56:44 +00:00
aquilescanta
16f41dbaab Fix HlsSampleStream#read non-fatal lack of mapping
HlsSampleStream#read should return end of stream when
there is no mapping for the sample stream, instead of
nothing read. This allows the player to transition to
ended.

Issue:#5524
PiperOrigin-RevId: 234764027
2019-02-20 13:56:26 +00:00
andrewlewis
b68fda0322 Update release notes to include HLS init segment fix
PiperOrigin-RevId: 234600750
2019-02-19 15:56:54 +00:00
andrewlewis
8e7ae9201a Bump version for 2.9.6 release
PiperOrigin-RevId: 234578712
2019-02-19 13:23:19 +00:00
bachinger
44e23fabe6 let apps intercept/handle media button events by using a MediaButtonEventHandler
Issue #5179

PiperOrigin-RevId: 234571837
2019-02-19 13:23:19 +00:00
aquilescanta
0ceff589b3 HLS Bugfix: Avoid loading initialization segment when reusing extractor
This bug affects any playlist that uses initialization segments. In practice,
almost exclusively fragmented mp4 segmented playlists are affected.

The bottom line is that extractors are chosen for reuse after the
initialization segment connection is open. However, reused extractors
do not need re-parsing the init segment, so loading the initialization is
wasteful.

PiperOrigin-RevId: 234479467
2019-02-18 17:40:48 +00:00
aquilescanta
8982da4b75 Support encrypted initialization segment
Defined in RFC 8216 Section 4.3.2.5.

Issue:#5441
PiperOrigin-RevId: 234114119
2019-02-18 17:40:48 +00:00
andrewlewis
31911ca54a Drain audio processors on reconfiguration
Previously we would get a new AudioTrack and flush all audio processors if any
AudioProcessor needed to be flushed on reconfiguration. This was problematic for
the case of TrimmingAudioProcessor because it could become active or inactive
due to transitioning to a period with gapless metadata or without it (we don't
keep it active all the time because it is wasteful to populate its end buffer
for content that is not gapless).

This change handles the case where we don't need an AudioTrack but
AudioProcessors do need to be flushed. In this case we drain all the audio
processors when next handling data then switch to the new configuration.

This avoids truncation when period transitions change whether
TrimmingAudioProcessor is active but don't require a new AudioTrack, and is also
a step towards draining the AudioTrack when transitioning between periods if we
do need a new AudioTrack.

To do this, it needs to be possible to drain any pending output data from an
AudioProcessor after it's configured to a new format, so this change makes sure
AudioProcessors allow calling playToEndOfStream and getOutput after
reconfiguration and before flush.

PiperOrigin-RevId: 234033552
2019-02-18 17:40:48 +00:00
aquilescanta
73d9b2d21a Hide ExoCastPlayer components again
This CL is effectively a rollback of cr/233072247.

PiperOrigin-RevId: 233793032
2019-02-18 17:40:48 +00:00
olly
c66d26b601 Fix EventMessage timestamp issue
Stop encoding/decoding presentation time as part of the message.
What's actually in emsg boxes is a presentation time delta,
which is why it's only 32 bits, and hence why it doesn't handle
large absolute timestamps. We were using this field to hold
absolute timestamps only for the purpose of passing presentation
times from DashManifestParser.parseEvent back to the calling
method. After this change, we return Pair<Long, EventMessage>
instead.

Issue: #5490
PiperOrigin-RevId: 233561731
2019-02-18 15:58:47 +00:00
andrewlewis
56944caa21 Allow registration of control overlays for ad viewability
Switch from passing an ad UI ViewGroup to passing an object that can also
provide information about controls overlays.

Also switch to using a dedicated overlay for ads instead of the overlay frame
layout, which apps have easy access to.

PiperOrigin-RevId: 233393500
2019-02-18 15:58:06 +00:00
tonihei
abb53d7ce7 Support multiple overrides in TrackSelectionView and factor out Builder.
Supporting multiple overrides allows to select tracks from multiple groups, if
enabled. As more options are added, the creation of the dialog is moved to a
separate builder class.

PiperOrigin-RevId: 233366282
2019-02-18 15:57:44 +00:00
aquilescanta
6f1daff3f1 Remove copybara scrubbing of ExoCast components
PiperOrigin-RevId: 233072247
2019-02-18 15:57:19 +00:00