github androidx/media 1.12.0-beta01

pre-release17 minutes ago
  • Common Library:
    • Reduce C.DEFAULT_BUFFER_SEGMENT_SIZE from 65536 to 65520 so each buffer allocation (including its byte[] object header) fits in whole OS pages in ART's large object space, reducing sample buffer memory usage by ~6% on 4 KiB-page devices and ~20% on 16 KiB-page devices.
    • Replace androidx.media3.common.util.NullableType with JSpecify org.jspecify.annotations.Nullable.
    • Remove androidx.media3.common.util.UnknownNull in favor of JSpecify nullness annotations. Kotlin subclasses of RunnableFutureTask with a nullable result type (such as Void?) must specify a nullable type argument (e.g., RunnableFutureTask<Void?, Exception>).
    • Add AdViewProvider.getAdVideoView() to provide the video container View that can be resized during ad playback.
    • Map the mlpa RFC 6381 codec string to MimeTypes.AUDIO_TRUEHD in MimeTypes.getMediaMimeType, fixing missing muxed Dolby TrueHD audio tracks during HLS chunkless preparation (#3485).
    • Fix AdPlaybackState.withAdDurationsUs to copy the passed array and AdPlaybackState.fromAdPlaybackState to copy all array fields of the ad groups, so that an instance can no longer be modified through retained or shared arrays.
    • Fix IllegalStateException ("Player is accessed on the wrong thread.") when Player.listen or Player.listenTo is cancelled from a thread other than the player's application thread (for example, during Compose UI test teardown) (#3005).
  • ExoPlayer:
    • Fix an issue where a renderer enabled early for an upcoming media period could start rendering before playback transitions to that period.
    • Kotlin subclasses of CompositeMediaSource that use nullable child source IDs (such as Void?) must specify a nullable type argument (e.g., CompositeMediaSource<Void?>).
    • Verify in AdsMediaSource that AdPlaybackState.removedAdGroupCount does not decrease across AdPlaybackState updates.
    • Fix an issue where transitioning between media periods that use different renderers could prematurely enable the incoming renderer before the outgoing renderer finished rendering (for example, throwing IllegalStateException ("Multiple renderer media clocks enabled.")) when Flags.FLAG_PER_STREAM_MEDIA_PROGRESSION is enabled.
    • Fix an issue where transitioning to an ad at a custom playback speed could delay advancing all renderers to the ad period when Flags.FLAG_PER_STREAM_MEDIA_PROGRESSION is enabled.
    • Fix issues with pre-warming renderers during media period transitions and track reselections.
    • Add MediaPeriod.supportsStreamPrerollFlags() (defaulting to false) so that custom MediaPeriod implementations can opt in to reporting initial discontinuities using SampleStream.getFlags(), falling back to MediaPeriod.readDiscontinuity() when not supported and Flags.FLAG_PER_STREAM_MEDIA_PROGRESSION is enabled.
    • Fix an issue where skipping an ad followed by another ad in the same ad group was reported with DISCONTINUITY_REASON_AUTO_TRANSITION instead of DISCONTINUITY_REASON_SKIP, or not reported at all when AdsMediaSource uses lazy content source preparation.
  • Transformer:
    • Add CodecDB (androidx.media3.transformer.codecdb), which recommends video encoder configurations (codec, encoder settings and bitrate) for the current device from measured encoder quality data.
  • Extractors:
    • ADTS: Fix AdtsExtractor deriving the audio format from a false sync word in the payload of a partial first frame, which could cause playback of live AAC streams joined mid-frame to fail or stall (#3464).
    • Fix ArrayIndexOutOfBoundsException in FragmentedMp4Extractor when a fragment contains a trun box with no samples (#3471).
    • ADTS: Add FLAG_DISABLE_ID3_METADATA to AdtsExtractor to stop ID3 data in the stream from being output as an application/id3 track.
    • MP4: Fix gapless playback of AAC tracks whose muxer (such as FFmpeg) shortens the last stts entry to exclude the encoder padding, which caused the padding to be derived as 0 from the elst edit list and the end of the last frame to be played (#3489).
    • Fix large upfront peek buffer allocations and OutOfMemoryError when sniffing corrupt or non-media files that start with ID3 (#3502).
  • Inspector:
    • Fix an issue where cancelling the future returned by MetadataRetriever.retrieveDurationUs() prevented close() from releasing the underlying MediaSource (#3468).
    • Fix MediaExtractorCompat to return MediaFormat.KEY_FRAME_RATE as an integer, matching the platform MediaExtractor.
  • Audio:
    • Fix an issue where buffered skipped silence was included in AudioSink.getCurrentPositionUs(boolean) and reported using AudioSink.Listener.onSilenceSkipped() before playback reached the skipped region (#3472).
    • Set codec provenance using AudioTrack.Builder.setCodecProvenance on API 37+ when playing spatialized multichannel PCM audio decoded from a compressed format.
    • Fix AudioTrack initialization retries being skipped when 1 second of audio is at least as large as the initial buffer size, which made DTS-HD passthrough fail on devices with limited audio memory (#3487).
  • Video:
    • Allow falling back to an H.265/HEVC decoder for backward-compatible Dolby Vision Profile 7 streams, and no longer fall back to an AV1 decoder for Profile 10 streams whose base layer signals full range with unspecified transfer characteristics (#3486).
    • Fix decoder selection in MediaCodecUtil to avoid selecting primary decoders that don't functionally support the format's profile (such as a Dolby Vision decoder for a different profile) when no decoder fully supports the format (#3486).
  • Text:
    • Reduce memory usage in DvbParser by rendering subtitle regions directly into region-sized bitmaps instead of retaining a full-screen scratch bitmap.
  • Effect:
    • Fix a NullPointerException in DefaultVideoFrameProcessor when flushing (for example, while seeking or scrubbing in CompositionPlayer) (#3470).
    • Fix DefaultGlObjectsProvider.release throwing a GlException when the provider is reused after a release (#2016).
  • Muxers:
    • Validate the track Format when adding a track to Mp4Muxer or FragmentedMp4Muxer, instead of failing later when writing samples or closing the muxer.
    • Make repeated calls to Muxer.close() a no-op in all library Muxer implementations, and treat the muxer as closed even if close() throws. Calling any other method after close() now throws an IllegalStateException.
  • IMA extension:
    • Support the IMA SDK's ResizablePlayer interface to allow interactive ads to resize and reposition the video player view within the ad container, and add ImaAdsLoader.requestAds(DataSpec, Object, AdViewProvider) (deprecating ImaAdsLoader.requestAds(DataSpec, Object, ViewGroup)).
  • Session:
    • Stabilize media button preferences APIs.
    • Reduce memory usage by no longer retaining compressed artwork data in CacheBitmapLoader.
    • Avoid redundant MediaSession.setQueue(null) calls on timeline updates when the platform session queue is already null (for example, when Player.COMMAND_GET_TIMELINE is unavailable).
    • Fix an issue where MediaSessionService did not let a service implementation the option to recover properly by not attempting to create a new session (#3490).
    • Report Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE instead of Player.TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED when a legacy MediaSessionCompat metadata update modifies the active queue item's metadata or duration without changing the queue.
    • Fix missing artwork for legacy sessions that set a null METADATA_KEY_DISPLAY_ICON (or artwork URI) alongside a valid METADATA_KEY_ALBUM_ART: null artwork values are now skipped when converting legacy metadata.
  • UI:
    • Add a subtitles Composable slot to ContentFrame and Player, with default support in media3-ui-compose-material3 for rendering bitmap and horizontal text subtitle cues.
    • Add SubtitleView.setTextDirectionHeuristic to allow customizing the text direction heuristic used for bidirectional subtitle text wrapping (#3454).
    • Animate all control slots in Player in media3-ui-compose-material3, including custom ones, and remove the visible parameter from PlayerDefaults.TopControls, CenterControls and BottomControls. This is a breaking change on an unstable API.
    • Support AdViewProvider.getAdVideoView() in PlayerView by wrapping exo_content_frame in exo_content_frame_container.
    • Reduce memory usage in SubtitleView by releasing cached subtitle bitmaps and text layouts when cues are cleared, and fix an issue where stale subtitle text could remain visible when a cue has insufficient width to lay out.
  • HLS extension:
    • Fix issues where reloading a failed or canceled HLS media chunk could retain partially buffered samples without discarding or splicing, or reset the load position to an outdated seek position (#3362).
    • Fix IllegalStateException when seeking to the start of a buffered segment after an adaptive track switch.
    • Fix several playback issues when switching pathways with HLS Content Steering (#3465).
  • DASH extension:
    • Fix duplicated or garbled CEA-608 subtitles when a stream has multiple embedded caption tracks (#887).
  • Cast extension:
    • Fix an issue where RemoteCastPlayer load requests were dropped by Android TV receivers (#3462).
    • Update com.google.android.gms:play-services-cast-framework dependency to 23.0.0.
    • Add CastParams.Builder.setSystemOutputSwitcherEnabled(boolean) to configure whether Cast devices appear in the system output switcher without requiring MediaTransferReceiver to be declared in AndroidManifest.xml, and enable the system output switcher by default for apps targeting API 37+ on devices running API 37+.
    • Support predefined Cast MediaMetadata fields in DefaultMediaItemConverter by mapping fields without a dedicated MediaItem.mediaMetadata property to and from MediaItem.mediaMetadata.extras, and preserve custom extras in MediaInfo.customData.
    • Stop throwing exceptions in DefaultMediaItemConverter when a playback URI is missing or conversion fails, preserving the media ID and metadata in the CastPlayer timeline for Cast queue items without a playback URI.
    • Add SessionAvailabilityListener.onCastSessionAvailable(boolean) to indicate whether an available Cast session was started using intent to join, and preserve remote playback state instead of overwriting it with local player state when joining a Cast session using intent to join in CastPlayer.
    • Populate MediaInfo and timeline durations from MediaMetadata.durationMs for non-live items in DefaultMediaItemConverter and RemoteCastPlayer, and retain receiver-resolved durations and livestream status across queue seeks.
  • Demo app:
    • Allow reordering playlist items by dragging in the session demo app.
  • Remove deprecated symbols:
    • Remove androidx.media3.transformer.TextureAssetLoader. Use androidx.media3.transformer.RawAssetLoader instead.
    • Remove public DefaultDecoderFactory constructors. Use DefaultDecoderFactory.Builder instead.
    • Remove DefaultLoadErrorHandlingPolicy.DEFAULT_TRACK_BLACKLIST_MS. Use DefaultLoadErrorHandlingPolicy.DEFAULT_TRACK_EXCLUSION_MS instead.
    • Remove DefaultVideoFrameProcessor.Factory.Builder.setRequireRegisteringAllInputFrames(boolean). Use VideoFrameProcessor.INPUT_TYPE_SURFACE_AUTOMATIC_FRAME_REGISTRATION instead.
    • Remove EditedMediaItemSequence.Builder.experimentalSetForceAudioTrack(boolean) and EditedMediaItemSequence.Builder.experimentalSetForceVideoTrack(boolean). Use EditedMediaItemSequence.Builder(Set) instead.
    • Remove EditedMediaItemSequence.forceAudioTrack. Use trackTypes.contains(C.TRACK_TYPE_AUDIO) instead.
    • Remove EditedMediaItemSequence.forceVideoTrack. Use trackTypes.contains(C.TRACK_TYPE_VIDEO) instead.
    • Remove ExportResult.durationMs and ExportResult.Builder.setDurationMs. Use ExportResult.approximateDurationMs and ExportResult.Builder.setApproximateDurationMs instead.
    • Remove SilenceSkippingAudioProcessor.DEFAULT_PADDING_SILENCE_US. Specify silence behavior using silenceRetentionRatio instead.
    • Remove Timeline.getPeriodPosition(Window, Period, int, long, long). Use Timeline.getPeriodPositionUs(Window, Period, int, long, long) instead.

Don't miss a new media release

NewReleases is sending notifications on new releases.