2024-01-15
·
105 commits
to main
since this release
Media3: v1.3.0-alpha01
January 15, 2024
- Common Library:
- Implement support for
android.resource://package/[type/]nameraw resource URIs wherepackageis 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
MediaIteminstead of a singleUriinAdPlaybackState. - Increase
minSdkto 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.
- Implement support for
- ExoPlayer:
- Add
PreloadMediaSourceandPreloadMediaPeriodthat allows apps to preload a content media source at a specific start position before playback.PreloadMediaSourcetakes 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.PreloadControland set the preloaded source to the player for playback. - Add
ExoPlayer.setImageOutputthat allows apps to setImageRenderer.ImageOutput. DefaultRenderersFactorynow provides anImageRendererto the player by default with nullImageOutputandImageDecoder.Factory.DEFAULT.- Emit
Player.Listener.onPositionDiscontinuityevent 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, anHttpDataSourceusing the HttpEngine API.
- 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).
- Track Selection:
- Add
DefaultTrackSelector.selectImageTrackto enable image track selection. - Add
TrackSelectionParameters.isPrioritizeImageOverVideoEnabledto determine whether to select an image track if both an image track and a video track are available. The default value isfalsewhich means selecting a video track is prioritized.
- Add
- Extractors:
- Add additional AV1C parsing to MP4 extractor to retrieve
ColorInfo.colorSpace,ColorInfo.colorTransfer, andColorInfo.colorRangevalues (#692).
- Add additional AV1C parsing to MP4 extractor to retrieve
- Video:
- Change the
MediaCodecVideoRendererconstructor that takes aVideoFrameProcessor.Factoryargument and replace it with a constructor that takes aVideoSinkProviderargument. Apps that want to inject a customVideoFrameProcessor.Factorycan instantiate aCompositingVideoSinkProviderthat uses the customVideoFrameProcessor.Factoryand pass the video sink provider toMediaCodecVideoRenderer.
- Change the
- Text:
- Fix serialization of bitmap cues to resolve
Tried to marshall a Parcel that contained Binder objectserror when usingDefaultExtractorsFactory.setTextTrackTranscodingEnabled(#836). - CEA-708: Ignore
rowLockvalue. The CEA-708-E S-2023 spec states thatrowLockandcolumnLockshould both be assumed to be true, regardless of the values present in the stream (columnLocksupport is not implemented, so it's effectively assumed to always be false).
- Fix serialization of bitmap cues to resolve
- 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.setPlayClearContentWithoutKeyorDefaultDrmSessionManager.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.
- HLS Extension:
- Reduce
HlsMediaPeriodto package-private visibility. This type shouldn't be directly depended on from outside the HLS package.
- 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
PreloadMediaSourcewith the short-form content use case.
- Add a shortform demo module to demo the usage of