*** Original commit ***
Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()
An upcoming change will update build() to return Player.
***
PiperOrigin-RevId: 401453039
Usages of the (already deprecated) Subtitle constructors were not
migrated, as it would require migrating to the Builder which is a more
involved change.
PiperOrigin-RevId: 400153139
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
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
These fields can't be used if `drm_uuid` isn't set. Make that case throw
an exception, so it's obvious to a developer what's wrong.
Most of the fields 'obviously' need `drm_uuid` to be set, but it's not
obvious for `drm_session_for_clear_content` (because it might be
reasonable to assume it's possible to play clear content without
specifying a UUID). This tripped me up in
https://github.com/google/ExoPlayer/issues/8842#issuecomment-833659808.
PiperOrigin-RevId: 397328556
* Avoid ActivityManager log spam by only calling startForeground once,
and subsequently updating the notification via NotificationManager.
* Tweak demo app service to make it a tiny bit easier to swap the Scheduler.
PiperOrigin-RevId: 397179398
- Android 12 will not allow our download service to be
restarted from the background when conditions that
allow downloads to continue are met. As an interim
(and possibly permanent) solution, we'll keep the
service in the foreground if there are unfinished
downloads that would continue if conditions were met.
- Keeping the service in the foreground requires a
foreground notification. Hence we need to be able to
generate a meaningful notification for this state.
PiperOrigin-RevId: 391969986
Most of those objects needs to be sent to MediaControler.
`TrackSelectior.Parameters` could have stayed Parcelable,
but it needs to be `Bundleable` as it inherit from
`TrackSelectionParameters` that is and needs to be
serializable anyway for the demo app.
As a result it has also been migrated to bundleable.
PiperOrigin-RevId: 391353293
The prototype is built upon Transformer and took many references from
TransformerAudioRenderer.
Please take a look and we can discuss more details.
PiperOrigin-RevId: 390192487
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch.
Notable renamings that might be controversial:
- `onPlaybackStateChanged(int state)` to `onPlaybackStateChanged(int playbackState)` affected a lot of lines but seems more consistent with other '-Changed' methods.
- `handleMessage(int messageType, Object payload)` to `handleMessage(int messageType, Object message)`
- `ExtractorInput` and `DataSource` inherit `DataReader` which had `read(byte[] target, ...`, while data sources normally called the first parameter `buffer`. I have standardized these all to use `buffer` even though it looks out of place in the `ExtractorInput` interface (which has more `read` methods with `target`).
PiperOrigin-RevId: 387290360
This is mainly so that developers can try out RTSP with
the main demo app without having to change the build.gradle
file.
The change also aligns what media can be played across the
different demo apps.
#minor-release
PiperOrigin-RevId: 373591974
All `add*Listener` and `add*Output` methods are
deprecated in favor of `addListener`.
As for the class themselves `VideoListener` and
`AudioListener` are not used internaly by ExoPlayer,
`VideoRendererEventListener`
and `AudioRendererEventListener` are use in their
place.
As a result `VideoListener` and `AudioListener`
can be deprecated in favor `Listener`.
On the other hand `TextOutput` and `MedataOutput`
are used both in the player interface and internally in
renderers.
This means that those class can't be deprecated.
There usage in the public interface are indirectly
deprecated as their is no way to use them without
using the deprecated `add*Output`.
Thus it's not an issue that the class themselves are
not deprecated.
#minor-release
PiperOrigin-RevId: 371318268
Added the String title in the Intent so MediaMetadata.title can be populated correctly for single media items. This is useful to query PlayerActivity about what it is currently playing.
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
Starting with Android 12 all components of an app that have an intent filter need to have an explicit attribute android:export that is set to either true or false. If a component filters for the MAIN or a VIEW action it needs the attribute explicitly set to true. Prior to Android 12 these were exported implicitly.
See https://medium.com/androiddevelopers/lets-be-explicit-about-our-intent-filters-c5dbe2dbdce0
PiperOrigin-RevId: 358368785
1. Remove cookie manager logic from PlayerActivity, since it has
no effect when Cronet is used (which is now the default)
2. Add toggle in DemoUtil to use Cronet or the default network
stack. Configure the cookie manager only when using the default
network stack
PiperOrigin-RevId: 350922671
- Support setting the user-agent in CronetDataSource
- Support setting the default user-agent in CronetEngineWrapper
- Use the underlying network stack's default user-agent by
default. Many applications will configure the underlying
CronetEngine or OkHttpClient with a user-agent that they
expect to be used throughout their app, so always overriding
this with our own default, on reflection, is not the best
thing to do!
Issue: #8395
PiperOrigin-RevId: 350921963
The media specifies a URL that uses http rather than https, which the
demo app doesn't permit by default. The URL here is the same except it
uses https instead.
#minor-release
PiperOrigin-RevId: 348445571
- Retire YouTube streams. They're flaky (e.g., one of them has transformed into
an audio only stream!). There is also a desire for us to stop relying on special
non-expiring YouTube URLs.
- Reorganize the remaining streams.
PiperOrigin-RevId: 344421031
- Remove restriction on `AdsMediaSource`s in playlists in `ExoPlayerImpl`.
- Allow playing playlists of `AdsMediaSource`s in the demo app.
- Add a sample with ads in a playlist in the demo app.
Issue: #3750
PiperOrigin-RevId: 344018774