[Feature Request] autodetect HLS & Dash
What is the need and use case of this feature?
Currently you have to manually pass a type on android if you're using HLS or Dash. I think this should be enhanced such that default will attempt to auto-detect it for you based on the extension of the URL (.m3u8 -> hls, .mpd -> dash).
Looking at https://developer.android.com/media/media3/exoplayer/hls#using-mediaitem, exoplayer can also autodetect these based on the url.
See their example code:
// Create a player instance.
val player = ExoPlayer.Builder(context).build()
// Set the media item to be played.
player.setMediaItem(MediaItem.fromUri(hlsUri))
// Prepare the player.
player.prepare()
Perhaps we need to use MediaItem.fromUri(src)?
Same goes for DASH: https://developer.android.com/media/media3/exoplayer/dash#using-mediaitem
@jspizziri do you want to give this pr a try: https://github.com/doublesymmetry/react-native-track-player/pull/2525/files
@puckey I'll give it a try and let you know.