New HlsMediaSource.Factory(dataSourceFactory).createMediaSource(omUri(hlsUri)) Set the HLS media source as the playlist with a single media item.ĭataSource.Factory dataSourceFactory = new DefaultHttpDataSource.Factory() HlsMediaSource.Factory(dataSourceFactory).createMediaSource(omUri(hlsUri)) Create a HLS media source pointing to a playlist uri. Val dataSourceFactory: DataSource.Factory = DefaultHttpDataSource.Factory() Using HlsMediaSourceįor more customization options, you can create a HlsMediaSource and pass itĭirectly to the player instead of a MediaItem. Variants, taking into account both available bandwidth and device capabilities. #EXT-X-STREAM-INF tags, then ExoPlayer will automatically adapt between If the URI points to a multivariant playlist that declares multiple The URI of the media item may point to either a media playlist or a multivariant To setMimeType of MediaItem.Builder to explicitly indicate the type of the m3u8, you can pass MimeTypes.APPLICATION_M3U8 tMediaItem(omUri(hlsUri))ĮxoPlayer player = new ExoPlayer.Builder(context).build() Val player = ExoPlayer.Builder(context).build() You can then create a MediaItem for an HLS playlist URI and pass it to the Implementation "dia3:media3-exoplayer-hls:1.0.2" To play an HLS stream, you need to depend on the HLS module. Strongly encourage HLS content producers to generate high quality HLS streams,ĪPI 19+ ("cenc" scheme) and 25+ ("cbcs" scheme)Įxcept for byteranges with undefined lengths Video sample formats must also be supported (see the ExoPlayer supports HLS with multiple container formats.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |