There are two very similar tests checking for release events,
one running with Robolectric and one instrumentation test.
The instrumentation test only adds the interaction with the player
to release it while the renderers are active. This same interaction
can be added to the Robolectric test as well.
This arguably improves the realism of the Robolectric test too
as we listen for real player events instead of simulating the same
events.
PiperOrigin-RevId: 399694869
This is more consistent with the other MediaItem inner classes which are
all Configurations.
The old class and fields are left deprecated for backwards
compatibility.
MediaItem.Builder#setClippingProperties is directly renamed (without
deprecation) because it only exists on the dev-v2 branch and hasn't
been included in a numbered ExoPlayer release.
PiperOrigin-RevId: 399471414
DashTestRunner.setWidevineInfo instantiates a Widevine MediaDrm to check
for L1 support, which fails on GMS devices that don't support Widevine.
The Widevine tests should be skipped on these devices, but the
setWidevineInfo call happens in @Before before the skipping logic
inside the test.
This change moves the skipping logic to the beginning of @Before, and
uses Assume to ensure the test isn't run.
This will also report the test as 'skipped due to unmet assumption'
which is more precise than 'passed'.
PiperOrigin-RevId: 399452734
Before releasing r2.15.0, we had a regression that crashed
PlaybackStatsListener. A change in the AnalyticsCollector made
it to send an additional AnalyticsListener.onEvents() callback after
calling Player.release() and AnalyticsListener.onEvents() appeared
to arrive with event times that were not monotonically increasing.
The AnalyticsListener.onEvents() callback that contained
AnalyticsListener.EVENT_PLAYER_RELEASED was called with a timestamp that
was smaller than event times of previously AnalyticsListener.onEvents()
calls.
A first fix changed the order of events being forwarded to
AnalyticsListener. Upon calling Player.release(), the AnalyticsCollector
would call AnalyticsListener.onPlayerReleased() and its associated
AnalyticsListener.onEvents() on the same stack call. This fix maintained
that event times are monotonically increasing, but made
AnalyticsListener.onPlayerReleased() be called earlier.
This change:
- Further changes AnalyticsCollector to ensure that
AnalyticsListener.onPlayerReleased() and its related
AnalyticsListener.onEvents() are the last callbacks to be called,
and the associated timestamp is bigger than previously reported
event times.
- Adds an instrumentation test to guard against the regression.
PiperOrigin-RevId: 399437724
The fix for Issue: #8776 was to release and null-out dummySurface if
it doesn't match the security level of the decoder. But it's possible
that this.surface is already set to this.dummySurface, in which case we
must also null out this.surface otherwise we will later try and re-use
the old, released DummySurface instance.
This logic already exists in MCVR#onReset, so I pulled it into a
releaseDummySurface() helper function.
Issue: #9476
#minor-release
PiperOrigin-RevId: 399420476
For Automotive devices, surround encodings can be supported via
the passthrough path. Therefore, include automotive in the allowed
device types in the isDirectPlaybackSupported checks. The automotive
system feature is checked, rather then UI_MODE_TYPE_CAR, because
the UI_MODE_TYPE_CAR can be force enabled via
android.app.UiModeManager.enableCarMode(), whereas FEATURE_AUTOMOTIVE
cannot be forced.
This aligns with other MediaItem.FooConfiguration class names and also
more clearly represents that this class encapsulates information used
for local playback that is lost when serializing MediaItem between
processes.
The old class and fields are kept (deprecated) for backwards
compatibility.
PiperOrigin-RevId: 398742708
- If DownloadService is configured to run as a foreground service,
it will remain started and in the foreground when downloads are
waiting for requirements to be met, with a suitable "waiting for
XYZ" message in the notification. This is necessary because new
foreground service restrictions in Android 12 prevent to service
from being restarted from the background.
- Cases where requirements are not supported by the Scheduler will
be handled in the same way, even on earlier versions of Android.
So will cases where a Scheduler is not provided.
- The Scheduler will still be used on earlier versions of Android
where possible.
Note: We could technically continue to use the old behavior on
Android 12 in cases where the containing application still has a
targetSdkVersion corresponding to Android 11 or earlier. However,
in practice, there seems to be little value in doing this.
PiperOrigin-RevId: 398720114
The MIME type is currently required to select a SubtitleDecoder
implementation in the TextRenderer. Future changes might remove this
requirement, so we pre-emptively mark the field as @Nullable.
The change in SingleSampleMediaSource ensures the track still maps to
the TextRenderer, otherwise it shows up as unmapped. Passing null MIME
type to MediaItem.Subtitle constructor now results in this from
EventLogger:
TextRenderer [
Group:0, adaptive_supported=N/A [
[ ] Track:0, id=null, mimeType=text/x-unknown, language=en, supported=NO_UNSUPPORTED_TYPE
]
]
PiperOrigin-RevId: 398010809
Both license and provisioning requests could be considered 'DRM
requests', and these headers are only sent on license requests, so
rename them to reflect that.
The old field remains deprecated for backwards compatibility.
PiperOrigin-RevId: 397980021
This change only calls setters if we need to override the existing value
(or more specifically, set a value that's absent).
PiperOrigin-RevId: 397979904
The type is already UUID so there's no need to duplicate that info in
the field name, and 'scheme' is a widely used term throughout both
ExoPlayer and android.os.MediaDrm documentation.
The old field remains deprecated for backwards compatibility.
The MediaItem.DrmConfiguration.Builder#setUuid method is renamed
directly (without deprecation) because it's not yet part of a released
ExoPlayer version.
PiperOrigin-RevId: 397961553
This takes advantage of the new MediaItem.LiveConfiguration.Builder
This change will always allocate a new LiveConfiguration.Builder and
LiveConfiguration, but preserves the behaviour of keeping the same
MediaItem instance if no values have changed.
PiperOrigin-RevId: 397961427