This allows to keep the state synced with ExoPlayerImpl after stopping the player,
but still releases the media source immediately as it needs to be reprepared.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177167980
We can acknoledge seeks before preparation finished immediately now,
because ExoPlayerImpl won't leave the masking state until the first prepare
operation is processed.
As a side effect, it also cleans up the responsibility of the callbacks.
Prepares are always acknowledged with a SOURCE_INFO_REFRESHED, while seeks
are always acknowledged with a SEEK_ACK.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177144089
The ExoPlayerImpl implementation forwards the stop request with this optional
parameter. To ensure correct masking (e.g. when timeline updates arrive after
calling reset in ExoPlayerImpl but before resetInternal in
ExoPlayerImplInternal), we use the existing prepareAck counter and extend it
also count stop operations. For this to work, we also return the updated
empty timeline after finishing the reset.
The CastPlayer doesn't support the two reset options so far.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177132107
Unconditionally waiting for the action schedule to finish in ExoPlayerTestRunner
doesn't work if the action schedule is not intended to be finished.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177024139
Also slightly improve language normalization/documentation.
For this CL, it is assumed that null and "und" languages are different
entities. Once we fully tackle language tag normalization, we can decide
whether to normalize the "undefined" language.
Issue:#2867
Issue:#2980
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177008509
Update the default AdaptiveTrackSelection and DefaultLoadControl to use playback
speed information.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176989168
currentTimeMillis is not guaranteed to be monotonic and elapsedRealtime is
recommend for interval timing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176853118
Fixed by explicitly waiting for the timeline update. This shouldn't be
necessary and will be removed as soon as the correct order of events
can be guaranteed (timeline change -> state change -> onSeekProcessed).
The waiting for the timeline update is implemented by introducing the
feature that the test runner also waits until the action schedule has
finished before stopping the test.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176848540
This is mostly useful for suppressing the initial position
discontinuity reported by ClippingMediaPeriod.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176758972
This brings ClippingMediaSource clip failures in line with
what MergingMediaSource does when it cannot merge.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176660123
It currently always reports 0, but it should report the position
passed through selectTracks. Reporting should also be disabled if
there's a seekToUs call.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176644228
Until recently, changing primary track formats were reported when the
corresponding media chunk was discarded which always happened immediately
after the sample has been read.
Now, media chunks may be discarded later on or in batches, leaving the
current reporting mechanism broken because changes may never be reported.
This fix separates the discarding from the reporting such that format changes
can be reported when the media chunk is first read from, while the discarding
operation only discards without reporting format changes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176519071
Currently EventMessage's presentationTimeMs is kept separately in
EventSampleStream. However, EventMessage's presentationTimeMs maybe used in
other places besides EventSampleStream, such as when handling `emsg' messages
targeting the player. This CL let EventMessage object to holds its
presentationTimeMs for such use cases.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176502938
We (eventually - albeit possibly infinitely far in the future)
expect a timeline update with a window of known duration. This
also stops live radio stream playbacks transitioning to ended
state when their tracks are disabled.
As part of this fix, I found an issue where getPeriodPosition
could return null even when defaultPositionProjectionUs is 0,
which is not as documented.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176492024
This allows implementations of those classes to take into account the playback
speed for adaptive track selection and controlling when to resume the player.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176484361
The ExoPlayerImplInternal.reset method now takes the same set of options
as the ExoPlayer.prepare method. This also allows to
- Remove some code duplication within ExoPlayerImplInternal
- Fix calls to prepare(sameSource, resetPosition=true, resetState=false)
with enabled shuffle mode where the position was not correctly reset to the
first period index.
- Keep the current timeline when calling stop (in line with ExoPlayerImpl).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176481878
Currently onTimelineChanged doesn't allow to distinguish easily between the
different reasons why it's being called. Especially, finding
out whether a new media source has been prepared or the current source
refreshed dynamically was impossible without tightly coupling the player
operations with the listener.
The new reasons provide this disdinction by either indicating a newly
initialized media source, a dynamic update to an existing timeline
or manifest, or a reset of the player (which usually results in an
empty timeline).
The original onTimelineChanged method without reason is kept in the
DefaultEventListener as deprecated to prevent the need to update all
existing listeners in one go.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176478701
This causes the player to report that it's started loading
when in the ended state.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176371892
- Properly report internal discontinuities
- Add DISCONTINUITY_REASON_SEEK_ADJUSTMENT to distinguish
seek adjustments from other internal discontinuity events
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176367365
Currently for a DASH ChunkSource that consists of multiple sub-streams, we
always use a CompositeSequenceableLoader, which only allows the furthest behind
loader or any loader that are behind current playback position to continue
loading.
This changes allow clients to have more flexibility when deciding the loading
strategy:
- They can construct a different kind of composite SequenceableLoader from
the sub-loaders, and use it by injecting a different CompositeSequeableLoaderFactory accordingly.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176363870
This class implements MediaClock itself and handles the switching between
renderer and standalone media clock.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176340615
Add Builder pattern to SingleSampleMediaSource and mark existing constructors as
deprecated.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176332964
- MediaSourceTestRunner aims to encapsulate some of the logic
currently used in DynamicConcatenatingMediaSourceTest, so it
can be re-used for testing other MediaSource implementations.
- The change also fixes DynamicConcatenatingMediaSourceTest to
execute calls on the correct threads, and to release handler
threads at the end of each test.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176117535
This test seems to obtain a timeline from a prepared
FakeMediaSource, but that's identical to the timeline
passed into that source to start with :).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176117133
This is helpful for tests which don't care about detailled timeline set-ups
besides the number of windows.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176097369