7260 Commits

Author SHA1 Message Date
ibaker
ff8db9a4fe Pass the end position of a stream to TextRenderer when marking it final
In a period transition we pass the start time of the next period, for
the final period we pass the duration of the period or timeline, if
known.

This means sideloaded subtitles now respect the end point of
ClippingMediaSource and ensures that content subtitles aren't
incorrectly displayed over mid-roll ads.

When transitioning back into the subtitled content the subtitles still
appear slightly before the video transitions, meaning the first subtitle
of the content is shown with the last few frames of the ad. Resolving
this in a way that doesn't break anything else requires a deeper
investigation.

Issue: #5317
Issue: #8456
#minor-release
PiperOrigin-RevId: 361797118
2021-03-12 10:41:09 +00:00
Ian Baker
c3e3b19ad2 Merge pull request #8654 from abeljim:dev-v2-8435-bolditalic
PiperOrigin-RevId: 361767801
2021-03-12 10:40:58 +00:00
gyumin
a60ed20f1b Implement Bundleable for Timeline.Window
PiperOrigin-RevId: 361741354
2021-03-12 10:40:46 +00:00
gyumin
ae7c1091e6 Implement Bundleable for Timeline.Period
PiperOrigin-RevId: 361736476
2021-03-12 10:40:36 +00:00
gyumin
6f9dbfe0c1 Implement Bundleable for AdPlaybackState
PiperOrigin-RevId: 361731578
2021-03-12 10:40:25 +00:00
tonihei
bc9fb8615e Use correct period-window offset for initial prepare position.
MaskingMediaSource needs to resolve the prepare position set for a MaskingPeriod
while the source was still unprepared to the first actual prepare position.

It currently assumes that the period-window offset and the default position is
zero. This assumption is correct when a PlaceholderTimeline is used, but it
may not be true if the real timeline is already known (e.g. when re-preparing
a live stream after a playback error).

Fix this by using the known timeline at the time of the preparation.
Also:
 - Update a test that should have caught this to use lazy re-preparation.
 - Change the demo app code to use the recommended way to restart playback
   after a BehindLiveWindowException.

Issue: #8675
PiperOrigin-RevId: 361604191
2021-03-12 10:40:15 +00:00
tonihei
ea0f72e46c Update initial bandwidth estimates
PiperOrigin-RevId: 361569511
2021-03-12 10:40:04 +00:00
gyumin
ffb7c466ed Implement addMediaItems(List) and clearMediaItems() in BasePlayer
PiperOrigin-RevId: 361487730
2021-03-12 10:39:54 +00:00
gyumin
c1dba81ed2 Move TimelineTest to common module
PiperOrigin-RevId: 361125522
2021-03-12 10:39:43 +00:00
gyumin
51f6aea265 Merge AdPlaybackStateTests
PiperOrigin-RevId: 361125492
2021-03-12 10:39:33 +00:00
kimvde
0dcdbf0adf Add Player onAvailableCommandsChanged callback
PiperOrigin-RevId: 361122259
2021-03-12 10:39:22 +00:00
olly
3de81c6d31 HttpDataSources: Remove unused protected methods
PiperOrigin-RevId: 361109018
2021-03-12 10:39:11 +00:00
Ian Baker
83d7a3c1f4 Merge pull request #8662 from joakimzhang:dev-v2
PiperOrigin-RevId: 361029604
2021-03-12 10:38:36 +00:00
gyumin
4df7410272 Add javadoc for Bundleable CREATOR fields
It's to comply with style guide as they are public.

PiperOrigin-RevId: 360914363
2021-03-12 10:38:25 +00:00
gyumin
7a02346d49 Recommend BasePlayer when implementing Player
PiperOrigin-RevId: 360902971
2021-03-12 10:38:14 +00:00
bachinger
8dc63dd2aa Reset playback speed when live speed control becomes unused
Issue: #8664
#minor-release
PiperOrigin-RevId: 360877086
2021-03-12 10:38:04 +00:00
gyumin
8fbb971dfa Implement Bundleable for AdGroup
PiperOrigin-RevId: 360851146
2021-03-12 10:37:53 +00:00
jaewan
7fad836b3a Implement Bundleable for PlaybackParameters
PiperOrigin-RevId: 360810865
2021-03-12 10:37:41 +00:00
olly
f5024131b8 Fix typos in Javadoc
PiperOrigin-RevId: 360440021
2021-03-12 10:37:19 +00:00
Ian Baker
d80d548503
Merge branch 'dev-v2' into dev-v2-8435-bolditalic 2021-03-04 09:41:39 +00:00
Abel Jimenez
8ac74a009e formatting 2021-03-03 02:51:26 -08:00
joakimzhang
dc814fc37d Detect external surround sound on Xiaomi devices
exoplayer can enable dolby passthrough on xiaomi device when get
EXTERNAL_SURROUND_SOUND_KEY

Signed-off-by: joakimzhang <zq15011526977@gmail.com>
2021-03-03 10:14:17 +08:00
Oliver Woodman
6be3a59354 Merge pull request #8546 from TadejZupancic:dev-v2
PiperOrigin-RevId: 360433358
2021-03-02 17:04:56 +00:00
olly
70f831a647 Simplify handling of playback speed in StyledPlayerControlView
PiperOrigin-RevId: 360404403
2021-03-02 17:04:44 +00:00
kimvde
67b18a958e Link to callback in Player getters' Javadoc
PiperOrigin-RevId: 360398175
2021-03-02 17:04:35 +00:00
andrewlewis
292700e93b Fall back from DTS HD to DTS
#minor-release

PiperOrigin-RevId: 360384540
2021-03-02 17:04:25 +00:00
olly
3f17f5d441 1) Adds new csi ticks:
exp (ExoPlayer prepare)
ffr (First Frame Rendered)
psr (Player State Ready).

2) Modifies aci/acc vci/vcc to report timing from ExoPlayer Playback thread.

3) Fix to report pvri and pari for every playback.

and other minor bug fixes.

PiperOrigin-RevId: 360228206
2021-03-02 17:04:15 +00:00
olly
b5d360c4cd Fix scrubber not reappearing correctly in some cases
Issue: #8646
#minor-release
PiperOrigin-RevId: 360184586
2021-03-02 17:04:04 +00:00
aquilescanta
ef1d797681 Introduce ChunkExtractor.Factory for dependency injection
PiperOrigin-RevId: 360175031
2021-03-02 17:03:55 +00:00
olly
560ed115df Add ResolvingDataSourceContractTest
PiperOrigin-RevId: 359783527
2021-03-02 17:03:35 +00:00
olly
1e3337e4b7 Add RawResourceDataSource contract test
PiperOrigin-RevId: 359743165
2021-03-02 17:03:25 +00:00
olly
759b0431bb DataSource: Tighten contract to throw if opened beyond end-of-input
Includes fixes for the HTTP implementations, which previously
broke this contract specifically in the case when a server
responds to a range request with a HTTP 200 response. To fix
this case, skipping to the requested position is moved from
read() to open(). As a side effect, this nicely simplifies
CronetDataSource!

PiperOrigin-RevId: 359737301
2021-03-02 17:03:14 +00:00
krocard
72aec83a9e Add setPlaybackSpeed as a convenience method to change speed.
PiperOrigin-RevId: 359734928
2021-03-02 17:03:05 +00:00
olly
c319220354 Add BandaidHttpDataSourceContractTest
Also fix a bug where BandaidHttpDataSource would pass -1 to
TransferListener.onBytesTransferred!

PiperOrigin-RevId: 359722821
2021-03-02 17:02:45 +00:00
krocard
b050391467 Clarify that set/getVolume is in fact a linear gain.
The API is a lot more useful if apps can rely on the fact
that the gain is linear and applied to all channels.

This is already guaranty by AudioTrack and should be too
by any reasonable implementation.

PiperOrigin-RevId: 359706113
2021-03-02 17:02:35 +00:00
olly
27c8679ce4 Make updateCodecOperatingRate protected.
Use the api in YouTube code to update the operating rate.

PiperOrigin-RevId: 359572194
2021-03-02 17:02:26 +00:00
ibaker
34d76a793b Make SsaDecoder robust against absent Format items
Suggested in a comment on PR Issue: #8615

PiperOrigin-RevId: 359522217
2021-03-02 17:02:15 +00:00
olly
635544efe9 Add DataSourceContractTest for reading from the end with a set length
Given we're proposing to make reading from the end a non-error case,
it's important to check that we return the right thing from open(),
and that we read the right thing (i.e., nothing) once opened.

For now, this test allows quite a bit of permissiveness, in line
with other related tests. This will be tightened up in due course.

PiperOrigin-RevId: 359504075
2021-03-02 17:02:04 +00:00
Abel Jimenez
ec69977a1c ssa bold and italic 2021-03-01 15:55:34 -08:00
TadejZupancic
50a11886b6 The popup window now opens above or below the button which caused it to open. 2021-02-25 19:35:00 +01:00
bachinger
66d15cea09 Bump version to 2.13.2
PiperOrigin-RevId: 359486817
2021-02-25 11:41:26 +00:00
krocard
36e480d81c Allow low level control of gapless offload
Allow offload of gapless content even if gapless offload is not known to be supported by the device.

This is not exposed in the high level DefaultRendererFactory as most
users are expected to prefer fidelity to power savings.

PiperOrigin-RevId: 359336407
2021-02-25 09:18:49 +00:00
olly
15c3c44e64 Add group setting for the notification
PiperOrigin-RevId: 359298960
2021-02-25 09:18:40 +00:00
olly
a5424acede TestContentProvider: Noop change to use correct constant
The constant values are the same, so this is a no-op, but for
correctness, we should pass the defined constant that the API
documents itself to accept.

PiperOrigin-RevId: 359293471
2021-02-25 09:18:31 +00:00
ibaker
019819a94a Rename MediaPeriodHolder.allRenderersEnabled
The new name reflects that it also waits for previously-used renderers
to be disabled.

Also fix some broken javadoc. These methods changed signature in
ea347a464a

PiperOrigin-RevId: 359253177
2021-02-24 15:46:55 +00:00
marcbaechinger
4ed36e19cf Merge pull request #8615 from szaboa:dev-v2-8435-ssa-font-size
PiperOrigin-RevId: 359244236
2021-02-24 15:46:44 +00:00
krocard
589f50fb22 Move renderer from Player to ExoPlayer
The concept of Renderers is not needed in the
Player interface. Move it to ExoPlayer.

This should not break most users as they use SimpleExoPlayer.

PiperOrigin-RevId: 359220977
2021-02-24 15:46:35 +00:00
olly
19adc43bf1 Contract test for start-position-out-of-range case
Currently, this only asserts that *if* an exception is thrown, it
must be a position-out-of-range exception as determined by
DataSourceException.isCausedByPositionOutOfRange.

Issue: #7326
PiperOrigin-RevId: 359092124
2021-02-24 15:46:19 +00:00
kimvde
32e3f15e8f Fix conditions to enable UI actions
- Ensure consistency between (Styled)PlayerControlView,
  PlayerNotificationManager, TimelineQueueNavigator and
  DefaultControlDispatcher.
- Handle the case where a live stream has ended when enabling previous
  and next actions (window.isLive() is true and window.isDynamic is
  false in that case)

#minor-release

PiperOrigin-RevId: 359063793
2021-02-24 15:46:11 +00:00
olly
d8b5a1d7f4 Contract test for end-position-out-of-range case
Assert that an exception is not thrown from DataSource.open
if the DataSpec's start position is valid but its end position
extends beyond the end of the data.

HTTP based DataSource implementations have no good way of
knowing when this is the case, so it makes sense to make this
the required behaviour, rather than requiring an exception to
be thrown or allowing both.

There are also use cases where the caller may want to use the
end position as an upper bound, without knowing for sure how
long the content is. An example of this use case is wanting to
pre-cache the first N bytes of a stream. This implies that any
exception should be thrown after reading to the end of the
data, rather than preemptively in open.

Issue: #7326
PiperOrigin-RevId: 359063721
2021-02-24 15:46:02 +00:00