This constructor always does the wrong thing for non-adaptive groups
containing more than 1 track, because it'll incorrectly generate an
adaptive selection. Replace it with a constructor for specifying a
single track within the group instead.
PiperOrigin-RevId: 431673458
As evidenced by the somewhat awkward logic in PlayerControlView, the
previous design wasn't very friendly to expected usage. There will be
more usage when the track selection dialog components are migrated,
which would be similarly awkward without this change.
PiperOrigin-RevId: 431407675
*** Original commit ***
Rollback of caf62842c4
*** Original commit ***
Rollback of c2cb22a056
*** Original commit ***
Rollback of 1521e50307
*** Original commit ***
PiperOrigin-RevId: 430905772
The AsyncronousMediaCodecAdapter should call MediaCodec.start()
on the same thread it calls MediaCodec.flush(), i.e. the playback
thread. This change removes the experimental flag that allowed
calling MediaCodec.start() from the callback thread.
The flag was flipped to true already.
PiperOrigin-RevId: 430689665
getCurrentTrackGroups and getCurrentTrackSelections are
retained for now, but moved from Player to ExoPlayer, to
ease the transition for some application code that currently
uses these methods.
PiperOrigin-RevId: 430036355
*** Original commit ***
Rollback of c2cb22a056
*** Original commit ***
Rollback of 1521e50307
*** Original commit ***
Wire up MediaMetricsListener and add configuration to...
***
PiperOrigin-RevId: 429585773
The track type is derived solely from the content. It does
not depend on any runtime properties such as the player's
capabilities of user track selection. Hence it belongs in
TrackGroup rather than TrackGroupInfo.
Note that this avoids TrackSelectionOverride from having to
re-derive the track type internally.
PiperOrigin-RevId: 429303312
We need TracksInfo.hasTracksOfType to determine which tabs to
display in TrackSelectionDialog.
We need TrackGroupInfo.isAdaptiveSupported to determine whether
to allow multiple selection (check boxes) or not (radio buttons).
PiperOrigin-RevId: 428793739
This change makes sure played server side ads are skipped in a single period
timeline. It avoids creating an ad-MediaPeriodInfo for played postrolls and
creates a content info instead. It also sets the end position for content infos
that terminate the stream before the stream is actually finished. This prevents
the player from continue playing the remaining media delivered by the
MediaPeriod.
We also make sure that the discontinuity of played ads are not reported because
there is actually no discontinuity.
#minor-release
PiperOrigin-RevId: 428734387
The last used shared media period is reused after all media periods have been
released. In case the sample streams are already filled up, they need to be
reset or they download samples from the current position up to the seek
position. This causes long buffering states or load stuck exceptions.
A seek when reusing the shared period takes care for reseting the period or
internally seeks to the current position in the already available samples.
#minor-release
PiperOrigin-RevId: 428484187
We have two ways to choose the minDurationForQualityIncreaseMs value in
AdaptiveTrackSelection: use the configured value for non-live or when
enough buffered data is available, or use a fraction of the available
duration to allow switching when playing close to the live edge.
The decision point when to use which value isn't quite consistent because
we compare against availableDurationUs before making the adjustments. This
means there is range of values where no up-switching is possible despite
perfect buffering. Fix this by choosing the minimum of both values.
Issue: google/ExoPlayer#9784
#minor-release
PiperOrigin-RevId: 428474332
Ignorable ad periods are skipped to resolve the media period id with the
ad playback state of the resulting period. In case of a change in the period
position un-played ad periods are rolled forward to be played.
PiperOrigin-RevId: 428011116
This adds some missing calls to verifyApplicationThread to
ExoPlayerImpl.
Now all public methods start with this call, except listener
registrations because registration after construction on a background
thread is allowed and supported.
PiperOrigin-RevId: 428009498
All the functionality of SimpleExoPlayer has moved to ExoPlayerImpl.
Hence, ExoPlayerImpl can fulfil its own name and become an ExoPlayer
implementation. As a result, ExoPlayer.Builder can return ExoPlayerImpl
directly without using SimpleExoPlayer at all.
#minor-release
PiperOrigin-RevId: 427947028
And also add a test that all Player.Listener events are forwarded
to AnalyticsListener.
The AnalyticsCollector also needlessly implemented
Video/AudioRendererEventListener, which is not needed because all of
the equivalent methods are called directly and never through the
interface.
#minor-release
PiperOrigin-RevId: 427478000
There are two sets of listeners in ExoPlayerImpl at the moment,
which can be merged together to use a single ListenerSet. This has
the added advantage that the events that were previously sent
through the ArraySet get additional guarantees provided by ListenerSet
(e.g. correct event ordering and onEvents triggered).
Also add missing constants for onEvents to ensure all Player.Listener
methods have an corresponding constant.
#minor-release
PiperOrigin-RevId: 427415349
This brings listener invocations closer together and removes
unnecessary methods.
Also fixes a bug where a change in track selection parameters only
queued a callback but never flushed it to actually inform the
listeners.
#minor-release
PiperOrigin-RevId: 427201691
In some cases (whose where we previously used EventListener),
AnalyticsCollector is registered as a listener to receive updates,
in other cases it is called directly.
Avoid this inconsistent handling by registering it as normal listener
and removing all callbacks that are handled by the normal listener flow.
The remaining direct usages of AnalyticsCollector calls are those
callbacks that have no equivalent in Player.Listener.
#minor-release
PiperOrigin-RevId: 427201525
With this change, MediaCodecAudioRenderer always configures MediaCodec
with max output channels set to 99 on API 32+.
#minor-release
PiperOrigin-RevId: 427192801
SimpleExoPlayer used to register a listener on ExoPlayerImpl for
the old EventListener callbacks. Now both classes are merged, this is
no longer needed and should be removed in favor of calling methods
directly.
#minor-release
PiperOrigin-RevId: 427187875
We have logic to not immediately interrupt playback when an ad group
fails to load and instead let the current content play and transition
at the point where the ad group should have been.
This logic was broken by dcbdbe5341 because of one of the conditions
used MediaPeriodId.adGroupIndex, which is always -1 for content ids.
It still worked for the last ad group because the next ad group index
was C.INDEX_UNSET.
Fix the issue and amend the test that was meant to catch this to test
the ad failures for the last ad and previous ads.
Also fix the PositionInfo reported in such a case, which was also wrong.
Issue: google/ExoPlayer#9929
#minor-release
PiperOrigin-RevId: 427143223
*** Original commit ***
Rollback of 1521e50307
*** Original commit ***
Wire up MediaMetricsListener and add configuration to disable it.
The listener will automatically forward diagnostics info to the
Android platform. ExoPlayer.Builder gets a new setter that allows
to disable this feature if required.
#...
***
PiperOrigin-RevId: 427131438
*** Original commit ***
Rollback of d93b0093ae
*** Original commit ***
Move SimpleExoPlayer logic into ExoPlayerImpl
This makes SimpleExoPlayer a simple forwarding wrapper which can be
removed in the future.
The changes are all purely mechanical with none of the potential further
simplifications made yet...
***
PiperOrigin-RevId: 427131338
*** Original commit ***
Move SimpleExoPlayer logic into ExoPlayerImpl
This makes SimpleExoPlayer a simple forwarding wrapper which can be
removed in the future.
The changes are all purely mechanical with none of the potential further
simplifications made yet. The only exceptions are name clashes where
either EPI or SEP was calling a method in one of the classes and both
classes had different implementations for the same method name. In these
cases we needed to disambiguate between the two different
implementations (e
***
PiperOrigin-RevId: 426997821
*** Original commit ***
Wire up MediaMetricsListener and add configuration to disable it.
The listener will automatically forward diagnostics info to the
Android platform. ExoPlayer.Builder gets a new setter that allows
to disable this feature if required.
#minor-release
***
PiperOrigin-RevId: 426997342