xxoo / av_media_player

A lightweight media player for flutter.
https://pub.dev/packages/av_media_player
BSD 2-Clause "Simplified" License
11 stars 0 forks source link

Can't play HLS with uncorrect content type #10

Open Predidit opened 3 months ago

Predidit commented 3 months ago

http://yun.366day.site/mp4hls/dmhls/dianwanka1.m3u8

The HLS stream has uncorrect content type (content-type: "image/gif") , seems that they are abusing Baidu image CDN.

The stream can be played by offical flutter video_player, but can't be played by av media player.

xxoo commented 3 months ago

Which platform did u test? It plays fine on android and ios in my test

Predidit commented 3 months ago

It can't be display on windows.

xxoo commented 3 months ago

I think the issue isn’t with the Content-Type but with the file headers. MediaPlayer relies on these headers to determine the file type. However, these headers have been disguised. So, you need to use a local HTTP server to remove the first 148 bytes of these files and then send the processed result to the player.