1.3.0
This release includes the following changes since the 1.2.1 release:
- Common Library:
- Implement support for
android.resource://package/[type/]name
raw resource URIs wherepackage
is different to the package of the current application. This has always been documented to work, but wasn't correctly implemented until now. - Normalize MIME types set by app code or read from media to be fully lower-case.
- Define ads with a full
MediaItem
instead of a singleUri
inAdPlaybackState
. - Increase
minSdk
to 19 (Android KitKat). This is aligned with all other AndroidX libraries, and is required for us to upgrade to the latest versions of our AndroidX dependencies. - Populate both
artworkUri
andartworkData
inMediaMetadata.Builder.populate(MediaMetadata)
when at least one of them is non-null (#964).
- Implement support for
- ExoPlayer:
- Add
PreloadMediaSource
andPreloadMediaPeriod
that allows apps to preload a content media source at a specific start position before playback.PreloadMediaSource
takes care of preparing the content media source to receive theTimeline
, preparing and caching the period at the given start position, selecting tracks and loading media data for the period. Apps control the preload progress by implementingPreloadMediaSource.PreloadControl
and set the preloaded source to the player for playback. - Add
ExoPlayer.setImageOutput
that allows apps to setImageRenderer.ImageOutput
. DefaultRenderersFactory
now provides anImageRenderer
to the player by default with nullImageOutput
andImageDecoder.Factory.DEFAULT
.- Emit
Player.Listener.onPositionDiscontinuity
event when silence is skipped (#765). - Add experimental support for parsing subtitles during extraction. You can enable this using
MediaSource.Factory.experimentalParseSubtitlesDuringExtraction()
. - Support adaptive media sources with
PreloadMediaSource
. - Implement
HttpEngineDataSource
, anHttpDataSource
using the HttpEngine API. - Prevent subclassing
CompositeSequenceableLoader
. This component was previously made extensible but was never subclassed within the library. Customizations can be done by wrapping an instance using the decorator pattern and implementing a customCompositeSequenceableLoaderFactory
. - Fix issue where repeating the same time causes metadata from this item to be cleared (#1007).
- Rename
experimentalSetSubtitleParserFactory
methods onBundledChunkExtractor.Factory
andDefaultHlsExtractorFactory
tosetSubtitleParserFactory
and disallow passingnull
. Use the newexperimentalParseSubtitlesDuringExtraction(boolean)
methods to control parsing behaviour. - Add support for customising the
SubtitleParser.Factory
used during extraction. This can be achieved withMediaSource.Factory.setSubtitleParserFactory()
. - Add source prefix to all
Format.id
fields generated fromMergingMediaSource
. This helps to identify which source produced aFormat
(#883). - Fix the regex used for validating custom Common Media Client Data (CMCD) key names by modifying it to only check for hyphen (#1028).
- Stop double-encoding CMCD query parameters (#1075).
- Add
- Transformer:
- Add support for flattening H.265/HEVC SEF slow motion videos.
- Increase transmuxing speed, especially for 'remove video' edits.
- Add API to ensure that the output file starts on a video frame. This can make the output of trimming operations more compatible with player implementations that don't show the first video frame until its presentation timestamp (#829).
- Add support for optimizing single asset mp4 trim operations.
- Add support to ensure a video frame has the first timestamp in the output file. Fixes output files beginning with black frame on iOS based players (#829).
- Track Selection:
- Add
DefaultTrackSelector.selectImageTrack
to enable image track selection. - Add
TrackSelectionParameters.isPrioritizeImageOverVideoEnabled
to determine whether to select an image track if both an image track and a video track are available. The default value isfalse
which means selecting a video track is prioritized.
- Add
- Extractors:
- Add additional AV1C parsing to MP4 extractor to retrieve
ColorInfo.colorSpace
,ColorInfo.colorTransfer
, andColorInfo.colorRange
values (#692). - MP3: Use constant bitrate (CBR) seeking for files with an
Info
header (the CBR equivalent of theXing
header). Previously we used the seek table from theInfo
header, but this results in less precise seeking than if we ignore it and assume the file is CBR. - MPEG2-TS: Add DTS, DTS-LBR and DTS:X Profile2 support (#275).
- Extract audio types from TS descriptors and map them to role flags, allowing users to make better-informed audio track selections (#973).
- Add additional AV1C parsing to MP4 extractor to retrieve
- Audio:
- Video:
- Change the
MediaCodecVideoRenderer
constructor that takes aVideoFrameProcessor.Factory
argument and replace it with a constructor that takes aVideoSinkProvider
argument. Apps that want to inject a customVideoFrameProcessor.Factory
can instantiate aCompositingVideoSinkProvider
that uses the customVideoFrameProcessor.Factory
and pass the video sink provider toMediaCodecVideoRenderer
.
- Change the
- Text:
- Fix serialization of bitmap cues to resolve
Tried to marshall a Parcel that contained Binder objects
error when usingDefaultExtractorsFactory.setTextTrackTranscodingEnabled
(#836). - CEA-708: Ignore
rowLock
value. The CEA-708-E S-2023 spec states thatrowLock
andcolumnLock
should both be assumed to be true, regardless of the values present in the stream (columnLock
support is not implemented, so it's effectively assumed to always be false).
- Fix serialization of bitmap cues to resolve
- Image:
- Add support for DASH thumbnails. Grid images are cropped and individual thumbnails are provided to
ImageOutput
close to their presentation times.
- Add support for DASH thumbnails. Grid images are cropped and individual thumbnails are provided to
- DRM:
- Play 'clear lead' unencrypted samples in DRM content immediately by default, even if the keys for the later encrypted samples aren't ready yet. This may lead to mid-playback stalls if the keys still aren't ready when the playback position reaches the encrypted samples (but previously playback wouldn't have started at all by this point). This behavior can be disabled with
MediaItem.DrmConfiguration.Builder.setPlayClearContentWithoutKey
orDefaultDrmSessionManager.Builder.setPlayClearSamplesWithoutKeys
.
- Play 'clear lead' unencrypted samples in DRM content immediately by default, even if the keys for the later encrypted samples aren't ready yet. This may lead to mid-playback stalls if the keys still aren't ready when the playback position reaches the encrypted samples (but previously playback wouldn't have started at all by this point). This behavior can be disabled with
- IMA extension:
- Fix issue where DASH and HLS ads without the appropriate file extension can't be played.
- Session:
- Disable double-click detection for TV apps (#962).
- Fix issue where
MediaItem.RequestMetadata
with just non-null extras is not transmitted between media controllers and sessions. - Add constructor to
MediaLibrarySession.Builder
that only takes aContext
instead of aMediaLibraryService
.
- HLS Extension:
- Reduce
HlsMediaPeriod
to package-private visibility. This type shouldn't be directly depended on from outside the HLS package. - Resolve seeks to beginning of a segment more efficiently (#1031).
- Reduce
- Decoder Extensions (FFmpeg, VP9, AV1, MIDI, etc.):
- MIDI decoder: Ignore SysEx event messages (#710).
- Test Utilities:
- Don't pause playback in
TestPlayerRunHelper.playUntilPosition
. The test keeps the playback in a playing state, but suspends progress until the test is able to add assertions and further actions.
- Don't pause playback in
- Demo app:
- Add a shortform demo module to demo the usage of
PreloadMediaSource
with the short-form content use case.
- Add a shortform demo module to demo the usage of