This release includes the following changes since the 1.5.1 release:
- Common Library:
- Remove
Format.toBundle(boolean excludeMetadata)method, useFormat.toBundle()instead. - Add
AudioManagerCompatandAudioFocusRequestCompatto replace the equivalent classes inandroidx.media.
- Remove
- ExoPlayer:
- Consider language when selecting a video track. By default select a 'main' video track that matches the language of the selected audio track, if available. Explicit video language preferences can be expressed with
TrackSelectionParameters.Builder.setPreferredVideoLanguage(s). - Add
selectedAudioLanguageparameter toDefaultTrackSelector.selectVideoTrack()method. - Add
retryCountparameter toMediaSourceEventListener.onLoadStartedand correspondingMediaSourceEventListener.EventDispatchermethods. - Fix bug where playlist items or periods in multi-period DASH streams with durations that don't match the actual content could cause frame freezes at the end of the item (#1698).
- Reduce default values for
bufferForPlaybackMsandbufferForPlaybackAfterRebufferMsinDefaultLoadControlto 1000 and 2000 ms respectively. - Add
MediaExtractorCompat, a new class that provides equivalent functionality to platformMediaExtractor. - Move
BasePreloadManager.Listenerto a top levelPreloadManagerListener. RenderersFactory.createSecondaryRenderercan be implemented to provide secondary renderers for pre-warming. Pre-warming enables quicker media item transitions during playback.- Enable sending
CmcdDatafor manifest requests in adaptive streaming formats DASH, HLS, and SmoothStreaming (#1951). - Provide
MediaCodecInfoof the codec that will be initialized inMediaCodecRenderer.onReadyToInitializeCodec(#1963). - Change
AdsMediaSourceto allow theAdPlaybackStatesto grow by appending ad groups. Invalid modifications are detected and throw an exception.
- Consider language when selecting a video track. By default select a 'main' video track that matches the language of the selected audio track, if available. Explicit video language preferences can be expressed with
- Transformer:
- Update parameters of
VideoFrameProcessor.registerInputStreamandVideoFrameProcessor.Listener.onInputStreamRegisteredto useFormat. - Add support for transmuxing into alternative backwards compatible formats.
- Generate HDR static metadata when using
DefaultEncoderFactory.
- Update parameters of
- Extractors:
- AVI: Fix handling of files with constant bitrate compressed audio where the stream header stores the number of bytes instead of the number of chunks.
- Audio:
- Fix
onAudioPositionAdvancingto be called when playback resumes (previously it was called when playback was paused).
- Fix
- Video:
- Fix
MediaCodecVideoRenderersuch that when without aSurface, the renderer will skip just-early frames only if theVideoFrameReleaseControl.getFrameReleaseActionis notFRAME_RELEASE_TRY_AGAIN_LATER.
- Fix
- Text:
- Stop eagerly loading all subtitle files configured with
MediaItem.Builder.setSubtitleConfigurations, and instead only load one if it is selected by track selection (#1721).
- Stop eagerly loading all subtitle files configured with
- Effect:
- Moved the functionality of
OverlaySettingsintoStaticOverlaySettings.OverlaySettingscan be subclassed to allow dynamic overlay settings.
- Moved the functionality of
- Muxers:
- Moved
MuxerExceptionout ofMuxerinterface to avoid a very long fully qualified name.
- Moved
- Session:
- Add
Contextas a parameter toMediaButtonReceiver.shouldStartForegroundService(#1887).
- Add
- UI:
- Add
PlayerSurfaceComposable tomedia3-ui-composemodule. - Add
PlayPauseButtonState,NextButtonState,PreviousButtonState,RepeatButtonState,ShuffleButtonStateclasses and the correspondingrememberPlayPauseButtonState,rememberNextButtonState,rememberPreviousButtonState,rememberRepeatButtonState,rememberShuffleButtonStateComposables tomedia3-ui-composemodule.
- Add
- HLS Extension:
- Add a first version of
HlsInterstitialsAdsLoader. The ads loader reads the HLS interstitials of an HLS media playlist and maps them to theAdPlaybackStatethat is passed to theAdsMediaSource. This initial version only supports HLS VOD streams withX-ASSET-URIattributes. - Add
HlsInterstitialsAdsLoader.AdsMediaSourceFactory. Apps can use it to createAdsMediaSourceinstances that use anHlsInterstitialsAdsLoaderin a convenient and safe way.
- Add a first version of
- DASH Extension:
- Add AC-4 Level-4 format support for DASH (#1898).
- Decoder Extensions (FFmpeg, VP9, AV1, etc.):
- Add the MPEG-H decoder module which uses the native MPEG-H decoder module to decode MPEG-H audio (#1826).
- Demo app:
- Add
MinimalControls(PlayPauseButton,NextButton,PreviousButton) andExtraControls(RepeatButton,ShuffleButton) Composable UI elements todemo-composeutilizingPlayPauseButtonState,NextButtonState,PreviousButtonState,RepeatButtonState,ShuffleButtonState.
- Add
- Remove deprecated symbols:
- Remove deprecated
AudioMixer.create()method. UseDefaultAudioMixer.Factory().create()instead. - Remove the following deprecated
Transformer.Buildermethods:setTransformationRequest(), usesetAudioMimeType(),setVideoMimeType(), andsetHdrMode()instead.setAudioProcessors(), set the audio processor in anEditedMediaItem.Builder.setEffects(), and pass it toTransformer.start()instead.setVideoEffects(), set video effect in anEditedMediaItem.Builder.setEffects(), and pass it toTransformer.start()instead.setRemoveAudio(), useEditedMediaItem.Builder.setRemoveAudio()to remove the audio from theEditedMediaItempassed toTransformer.start()instead.setRemoveVideo(), useEditedMediaItem.Builder.setRemoveVideo()to remove the video from theEditedMediaItempassed toTransformer.start()instead.setFlattenForSlowMotion(), useEditedMediaItem.Builder.setFlattenForSlowMotion()to flatten theEditedMediaItempassed toTransformer.start()instead.setListener(), useaddListener(),removeListener()orremoveAllListeners()instead.
- Remove the following deprecated
Transformer.Listenermethods:onTransformationCompleted(MediaItem), useonCompleted(Composition, ExportResult)instead.onTransformationCompleted(MediaItem, TransformationResult), useonCompleted(Composition, ExportResult)instead.onTransformationError(MediaItem, Exception), useonError(Composition, ExportResult, ExportException)instead.onTransformationError(MediaItem, TransformationException), useonError(Composition, ExportResult, ExportException)instead.onTransformationError(MediaItem, TransformationResult, TransformationException), useonError(Composition, ExportResult, ExportException)instead.onFallbackApplied(MediaItem, TransformationRequest, TransformationRequest), useonFallbackApplied(Composition, TransformationRequest, TransformationRequest)instead.
- Remove deprecated
TransformationResultclass. UseExportResultinstead. - Remove deprecated
TransformationExceptionclass. UseExportExceptioninstead. - Remove deprecated
Transformer.PROGRESS_STATE_NO_TRANSFORMATION. UseTransformer.PROGRESS_STATE_NOT_STARTEDinstead. - Remove deprecated
Transformer.setListener(). UseTransformer.addListener(),Transformer.removeListener()orTransformer.removeAllListeners()instead. - Remove deprecated
Transformer.startTransformation(). UseTransformer.start(MediaItem, String)instead. - Remove deprecated
SingleFrameGlShaderProgram. UseBaseGlShaderPrograminstead. - Remove
Transformer.flattenForSlowMotion. UseEditedMediaItem.flattenForSlowMotioninstead.
- Remove deprecated