Erorr 404 : Issue with Switching Bitrates in Multi-Bitrate HLS Stream Using CMAF on Demo App
Dear Friends
I am experiencing an issue when trying to switch bitrates in a multi-bitrate HLS stream using latest version of demo app. The stream uses CMAF (.m4s segments) instead of the traditional .ts segments. While the master playlist (master.m3u8) and all the variant playlists (master_0.m3u8, master_1.m3u8, master_2.m3u8) are accessible and correctly listed, I encounter a 404 Response Code error when attempting to switch between the bitrates during playback.
Issue: The player correctly accesses and begins playback of the initial stream, but when switching to a different bitrate, it fails with a 404 Response Code. The error appears to be related to the player attempting to load the .m4s segments but being unable to find them or incorrectly handling the CMAF segments.
internalError [eventTime=21.22, mediaPos=40.24, window=0, period=0, loadError
androidx.media3.datasource.HttpDataSource$InvalidResponseCodeException: Response code: 404
at androidx.media3.datasource.cronet.CronetDataSource.open(CronetDataSource.java:647)
at androidx.media3.datasource.DefaultDataSource.open(DefaultDataSource.java:275)
at androidx.media3.datasource.cache.CacheDataSource.openNextSource(CacheDataSource.java:802)
at androidx.media3.datasource.cache.CacheDataSource.open(CacheDataSource.java:615)
at androidx.media3.datasource.StatsDataSource.open(StatsDataSource.java:86)
at androidx.media3.exoplayer.hls.HlsMediaChunk.prepareExtraction(HlsMediaChunk.java:525)
at androidx.media3.exoplayer.hls.HlsMediaChunk.feedDataToExtractor(HlsMediaChunk.java:498)
at androidx.media3.exoplayer.hls.HlsMediaChunk.loadMedia(HlsMediaChunk.java:467)
at androidx.media3.exoplayer.hls.HlsMediaChunk.load(HlsMediaChunk.java:424)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Steps Taken: Verified that all referenced .m4s files in the playlists are accessible directly via a browser and through tools like curl. Confirmed that the master playlist and variant playlists are correctly formatted and accessible. The issue seems specific to the handling of CMAF (.m4s) segments during bitrate switching. Request: Could you please assist in identifying why the player is unable to handle the CMAF segments during bitrate switching? Is there any specific configuration required for the player to correctly support CMAF in HLS streams?
I appreciate your help in resolving this issue.