[HTML payload içeriği buraya]
32.7 C
Jakarta
Sunday, May 17, 2026

Media3 1.6.0 — what’s new?



Posted by Andrew Lewis – Software program Engineer

This text is cross-published on Medium

This launch features a host of bug fixes, efficiency enhancements and new options. Learn on to search out out extra, and as at all times please try the full launch notes for a complete overview of adjustments on this launch.


Playback, MediaSession and UI

ExoPlayer now helps HLS interstitials for advert insertion in HLS streams. To play these adverts utilizing ExoPlayer’s built-in playlist assist, cross an HlsInterstitialsAdsLoader.AdsMediaSourceFactory because the media supply manufacturing facility when creating the participant. For extra info see the official documentation.

This launch additionally contains experimental assist for ‘pre-warming’ decoders. With out pre-warming, transitions from one playlist merchandise to the following will not be seamless in some instances, for instance, we might have to modify codecs, or decode some video frames to succeed in the beginning place of the brand new media merchandise. With pre-warming enabled, a secondary video renderer can begin decoding the brand new media merchandise earlier, giving near-seamless transitions. You’ll be able to do that characteristic out by enabling it on the DefaultRenderersFactory. We’re actively engaged on additional enhancements to the best way we work together with decoders, together with including a ‘quick in search of mode’ so keep tuned for updates on this space.

Media3 1.6.0 introduces a brand new media3-ui-compose module that accommodates performance for constructing Compose UIs for playback. You’ll find a reference implementation within the Media3 Compose demo and be taught extra in Getting began with Compose-based UI. At this level we’re offering a primary set of foundational state courses that hyperlink to the Participant, along with some fundamental composable constructing blocks. You should utilize these to construct your individual personalized UI widgets. We plan to publish default Materials-themed composables in a later launch.

Another enhancements on this launch embody: transferring system calls off the applying’s most important thread to the background (which ought to cut back ANRs), a brand new decoder module wrapping libmpegh (for bundling object-based audio decoding in your app), and a repair for the Solid extension for apps concentrating on API 34+. There are additionally fixes throughout MPEG-TS and WebVTT extraction, DRM, downloading/caching, MediaSession and extra.

Media extraction and body retrieval

The brand new MediaExtractorCompat is a drop-in substitute for the framework MediaExtractor however carried out utilizing Media3’s extractors. If you happen to’re utilizing the Android framework MediaExtractor, take into account migrating to get constant conduct throughout gadgets and cut back crashes.

We have additionally added experimental assist for retrieving video frames in a brand new class ExperimentalFrameExtractor, which might act as a substitute for the MediaMetadataRetriever getFrameAtTime strategies. There are a couple of advantages over the framework implementation: HDR enter is supported (by default tonemapping right down to SDR, however with the choice to supply HLG bitmaps from Android 14 onwards), Media3 results will be utilized (together with Presentation to scale the output to a desired dimension) and it runs quicker on some gadgets resulting from transferring coloration area conversion to the GPU. This is an instance of utilizing the brand new API:

val bitmap =
    withContext(Dispatchers.IO) {
        val configuration =
            ExperimentalFrameExtractor.Configuration
                .Builder()
                .setExtractHdrFrames(true)
                .construct()
        val frameExtractor =
            ExperimentalFrameExtractor(
                context,
                configuration,
            )

        frameExtractor.setMediaItem(mediaItem, /*results*/ listOf())

        val body = frameExtractor.getFrame(timestamps).await()
        frameExtractor.launch()
        body.bitmap
    }

Enhancing, transcoding and export

Media3 1.6.0 contains efficiency, stability and practical enhancements in Transformer. Highlights embody: assist for transcoding/transmuxing Dolby Imaginative and prescient streams on gadgets that assist this format and a brand new MediaProjectionAssetLoader for recording from the display screen, which you’ll be able to check out within the Transformer demo app.

Take a look at Frequent media processing operations with Jetpack Media3 Transformer for some code snippets displaying how one can course of media with Transformer, and tricks to cut back latency.

This launch additionally features a new Kotlin-based demo app showcasing Media3’s video results framework. You’ll be able to choose from quite a lot of video results and preview them by way of ExoPlayer.setVideoEffects.

Media3 video effect animation

Animation displaying distinction adjustment and a confetti impact within the new demo app

Get began sith Media3 1.6.0

Please get in contact by way of the Media3 challenge Tracker if you happen to run into any bugs, or in case you have questions or characteristic requests. We stay up for listening to from you!

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles