Currently only a single instance of ImaServerSideAdInsertionMediaSource is
supported at the same time in a playlist. This change makes sure that an
attempt to add multiple instances is prevented by throwing a an exception.
#minor-release
PiperOrigin-RevId: 428743140
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
This prevents a stack trace that is shown in the logs when the stream manager is
released after the activity was stopped. In this case the call to
`streamManager.destroy()` coming from `releaseSourceInternal()` of the media
source is too late and produces an error saying `Application attempted to call on
a destroyed WebView`. The error has no effect but it's nice to not have this
stack trace in the logs.
PiperOrigin-RevId: 428574231
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
The timeline used to map ad groups to periods needs to report the original content period duration without subtracting the serverside inserted ad duration. When marking played ads in onPositionDiscontinuity, the public timeline has been used which crashed the app when the ads media source is playing on a window index different to zero (in a playlist).
#minor-release
PiperOrigin-RevId: 428465833
On Samsung S21 with light theme the debug labels weren't showing up because the player view was visible (with a black background) while the transformation was in progress, matching the debug label text color. Hide the player view until the transformation is complete to fix this.
Also tweak the layout slightly to add space between the card border and the labels.
#mse-bug-week
PiperOrigin-RevId: 428455824
Define MediaNotification.Provider so that apps can customize
notification UX. Move MediaNotificationManager's functionality
around notifications on DefaultMediaNotificationProvider
PiperOrigin-RevId: 428024699
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
For when a track is both encrypted and has supplemental data, the sample size will be equal to `block sample size - encryption data size`.
PiperOrigin-RevId: 427807612
We have seen devices running on API21/23 fail transcoding because of setting
encoding profile/level.
Some devices (ale-123/nexus 7) on API21 returns ENOSYS (Function not
implemented) when being configured with a profile setting. (although API21
introduced the capability of setting encoding profile)
Some devices (nexus 5) on API23 fails configuration with a specific parameter
set, despite advertising support for it.
Not setting the baseline profile has no effect on encoding, because when not
set, the encoding will pick a suitable profile to use. Since baseline is
the lowest possible profile, the auto-picked value can't be worse than
baseline.
Ref: b/218696352
PiperOrigin-RevId: 427792124
On some Android devices, the return value of
```
MediaCodecInfo.getCapabilitiesForType(mimeType).profileLevels
```
contains one entry for each encoding profile, like <profile, maxSupportedLevel>
but on some other devices, there are multiple entries for the same profile,
like <HIGH_PROFILE, LEVEL1>, <HIGH_PROFILE, LEVEL2>, <HIGH_PROFILE, LEVEL3>,
where we need to iterate through all the entries and find the max.
PiperOrigin-RevId: 427727030
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
Right now, the option to build an IMA DAI URI programmatically is still
package-private. To simplify the process, we can remove the StreamRequest
wrapper and directly provide an URI builder.
The same class can provide some package-private helper methods to parse the
created URI.
#minor-release
PiperOrigin-RevId: 427445326
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
Allow opusV2JNI to be built-for & included-in non-Android build targets by ifdef'ing out the liblog dependency. Also removed libz and libandroid dependencies.
PiperOrigin-RevId: 427269838
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