This release includes the following changes since 1.6.1:
- ExoPlayer:
- Add
ExoPlayer.setScrubbingModeEnabled(boolean)method. This optimizes the player for many frequent seeks (for example, from a user dragging a scrubber bar around). The behavior of scrubbing mode can be customized withsetScrubbingModeParameters(..)onExoPlayerandExoPlayer.Builder. - Allow customizing fractional seek tolerance in scrubbing mode.
- Increase codec operating rate in scrubbing mode.
- Fix bug where prepare errors in the content of
AdsMediaSourcemay be never reported (#2337). - Fix memory leak in
MergingMediaSource, for example used when sideloading subtitles (#2338). - Allow
CmcdConfiguration.Factoryto returnnullto disable CMCD logging for specific media items (#2386). - Increase default image buffer size from 128kB (copy-paste mistake from text tracks) to 26MB, which is large enough for 50MP Ultra HDR images (#2417).
- Add
PreCacheHelperthat allows apps to pre-cache a single media with specified start position and duration.
- Add
- Transformer:
- Filling an initial gap (added via
addGap()) with silent audio now requires explicitly settingexperimentalSetForceAudioTrack(true)inEditedMediaItemSequence.Builder. If the gap is in the middle of the sequence, then this flag is not required. - Move
Muxerinterface frommedia3-transformertomedia3-muxer. - Make setting
MediaItem.Builder().setImageDuration(long)mandatory to import a media item as an image. - Add
Transformer.Builder().experimentalSetMp4EditListTrimEnabled(boolean)which includes an MP4 edit list when trimming to instruct players to ignore samples between the key frame before the trim start point, and the trim start point. - Update Composition Demo app to use Kotlin and Jetpack Compose, and add a custom
VideoCompositorSettingsto arrange sequences into a 2x2 or PiP layout.
- Filling an initial gap (added via
- Extractors:
- MP3: Use duration and data size from unseekable Xing, VBRI and similar variable bitrate metadata when falling back to constant bitrate seeking due to
FLAG_ENABLE_CONSTANT_BITRATE_SEEKING(_ALWAYS)(#2194).
- MP3: Use duration and data size from unseekable Xing, VBRI and similar variable bitrate metadata when falling back to constant bitrate seeking due to
- Audio:
- Allow constant power upmixing/downmixing in DefaultAudioMixer.
- Make
ChannelMappingAudioProcessor,TrimmingAudioProcessorandToFloatPcmAudioProcessorpublic (#2339). - Use
AudioTrack#getUnderrunCount()inAudioTrackPositionTrackerto detect underruns inDefaultAudioSinkinstead of best-effort estimation. - Improve audio timestamp smoothing for unexpected position drift from the audio output device.
- Fix bug where A/V sync is broken for the first 10 seconds after resuming from pause when connected to Bluetooth devices.
- Fix bug that
AnalyticsListener.onAudioPositionAdvancingwas not reporting the time when the audio started advancing but the time of the first measurement.
- Video:
- Add experimental
ExoPlayerAPI to include theMediaCodec.BUFFER_FLAG_DECODE_ONLYflag when queuing decode-only input buffers. This flag will signal the decoder to skip the decode-only buffers thereby resulting in faster seeking. Enable it withDefaultRenderersFactory.experimentalSetEnableMediaCodecBufferDecodeOnlyFlag. - Improve codec performance checks for software video codecs. This may lead to some additional tracks being marked as
EXCEEDS_CAPABILITIES. - Fix VP9 Widevine playback errors on some devices (#2408).
- Add experimental
- Text:
- Fix SSA and SubRip to display an in-progress cue when enabling subtitles (#2309).
- Fix playback getting stuck when switching from a stream with a subtitle error to a live stream with an empty subtitle track (#2328).
- Fix garbled CEA-608 subtitles when playing H.262 streams containing B-frames (#2372).
- Add support for SSA subtitles with
CodecId = S_TEXT/SSAin Matroska files. PreviouslyMatroskaExtractoronly supportedCodecId = S_TEXT/ASSwhich is meant to represent the 'advanced' (v4+) variant of SubStation Alpha subtitles (but ExoPlayer's parsing logic is the same for both variants) (#2384). - Add support for the
layerproperty in SubStation Alpha (SSA) subtitle files which is used to define the z-order of cues when more than one is shown on screen at the same time (#2124).
- Effect:
- Add
Presentation.createForShortSide(int)that creates aPresentationthat ensures the shortest side always matches the given value, regardless of input orientation.
- Add
- Muxers:
writeSampleData()API now uses muxer specificBufferInfoclass instead ofMediaCodec.BufferInfo.- Add
Muxer.Factory#supportsWritingNegativeTimestampsInEditListwhich defaults to false.
- IMA extension:
- Fix a bug where a load error in one ad may accidentally invalidate another ad group.
- Fix bug where ad groups after the end of a VOD window stalled playback. Ads groups with a start time after the window are not enqueued into the
MediaPeriodQueueanymore (#2215).
- Session:
- Fix a bug where passing null into
getLibraryRootof aMediaBrowserconnected to a legacyMediaBrowserServiceCompatproduced aNullPointerException. - Fix a bug where where sending custom actions, a search result or a getItem request crashed the legacy session app with a
ClassNotFoundException. - Fix a bug where
MediaItem.LocalConfiguration.uriwas shared to the platform sessions'sMediaMetadata. To intentionally share a URI to allow controllers to re-request the media, setMediaItem.RequestMetadata.mediaUriinstead.
- Fix a bug where passing null into
- UI:
- Fix a Compose bug which resulted in a gap between setting the initial button states and observing the change in state (e.g. icon shapes or being enabled). Any changes made to the Player outside of the observation period are now picked up (#2313).
- Add state holders and composables to the
media3-ui-composemodule forSeekBackButtonStateandSeekForwardButtonState. - Make
PlayerSurfaceaccept a nullablePlayerargument. - Add support for ExoPlayer's scrubbing mode to
PlayerControlView. When enabled, this puts the player into scrubbing mode when the user starts dragging the scrubber bar, issues aplayer.seekTocall for every movement, and then exits scrubbing mode when the touch is lifted from the screen. This integration can be enabled with eithertime_bar_scrubbing_enabled = truein XML or thesetTimeBarScrubbingEnabled(boolean)method from Java/Kotlin.
- Downloads:
- Add partial download support for progressive streams. Apps can prepare a progressive stream with
DownloadHelper, and request aDownloadRequestfrom the helper with specifying the time-based media start and end positions that the download should cover. The returnedDownloadRequestcarries the resolved byte range, with which aProgressiveDownloadercan be created and download the content correspondingly. - Add
DownloadHelper.Factorywith which the staticDownloadHelper.forMediaItem()methods are replaced. - Add
FactoryforSegmentDownloaderimplementations. - Add partial download support for adaptive streams. Apps can prepare an adaptive stream with
DownloadHelper, and request aDownloadRequestfrom the helper with specifying the time-based media start and end positions that the download should cover. The returnedDownloadRequestcarries the resolved time range, with which a concreteSegmentDownloadercan be created and download the content correspondingly.
- Add partial download support for progressive streams. Apps can prepare a progressive stream with
- HLS extension:
- Support X-ASSET-LIST and live streams with
HlsInterstitialsAdsLoader.
- Support X-ASSET-LIST and live streams with
- RTSP extension:
- Add parsing support for SessionDescriptions containing lines with trailing whitespace characters (#2357).
- Cast extension:
- Add support for
getDeviceVolume(),setDeviceVolume(),getDeviceMuted(), andsetDeviceMuted()(#2089).
- Add support for
- Test Utilities:
- Removed
transformer.TestUtil.addAudioDecoders(String...),transformer.TestUtil.addAudioEncoders(String...), andtransformer.TestUtil.addAudioEncoders(ShadowMediaCodec.CodecConfig, String...). UseShadowMediaCodecConfigto configure shadow encoders and decoders instead. - Replaced the "exotest" prefix with "media3" in codec names reported by
ShadowMediaCodecConfig.
- Removed
- Remove deprecated symbols:
- Removed deprecated
SegmentDownloaderconstructorSegmentDownloader(MediaItem, Parser<M>, CacheDataSource.Factory, Executor)and the corresponding constructors in its subclassesDashDownloader,HlsDownloaderandSsDownloader. - Removed deprecated
Player.hasNext(),Player.hasNextWindow(). UsePlayer.hasNextMediaItem()instead. - Removed deprecated
Player.next(). UsePlayer.seekToNextMediaItem()instead. - Removed deprecated
Player.seekToPreviousWindow(). UsePlayer.seekToPreviousMediaItem()instead. - Removed deprecated
Player.seekToNextWindow(). UsePlayer.seekToNextMediaItem()instead. - Removed deprecated
BaseAudioProcessorinexoplayermodule. UseBaseAudioProcessorundercommonmodule. - Remove deprecated
MediaCodecVideoRendererconstructorMediaCodecVideoRenderer(Context, MediaCodecAdapter.Factor, MediaCodecSelector, long, boolean, @Nullable Handler, @Nullable VideoRendererEventListener, int, float, @Nullable VideoSinkProvider).
- Removed deprecated