I'm facing the same problem,
Probably your stream is MPEG-TS over UDP. Based on this code (for ExoPlayer media2) : ExoPlayer2UdpDemo
I have tried to convert the code to Media3. This is what I have done so far without success:
player = ExoPlayer.Builder(this)
.build()
.apply {
val factory =
DataSource.Factory { UdpDataSource(3000, 100000) }
val tsExtractorFactory = ExtractorsFactory {
arrayOf(
TsExtractor(TsExtractor.MODE_SINGLE_PMT,
TimestampAdjuster(0), DefaultTsPayloadReaderFactory()
)
)
}
val mediaSource: MediaSource = ProgressiveMediaSource.Factory(factory,tsExtractorFactory)
.createMediaSource(MediaItem.fromUri(Uri.parse("udp://@192.168.11.111:1261")))
setMediaSource(mediaSource)
prepare()
playWhenReady = true
}
val playerView = findViewById<View>(R.id.player_view) as PlayerView
playerView.player = player
I'm not sure if ProgressiveMediaSource is the correct way for this type of stream