I’ve used fijkplayer library which is available on flutter to play m3u8 videos.
Playing without download is working fine and the issue only happens when I trying to play downloaded videos. Also, I tried other libraries like chewie, flutter_jikplayer, flutter_tencentplayer but none of them worked.
This issue happens only on the hls links of Vimeo. I’ve implemented everything using a public hls link available on the internet. After that, I found this bug.
This output seems to be a protocol related issue.
The xcode output is,
===== versions =====
ijkplayer : f0.7.8
FFmpeg : ff4.0--ijk0.8.25--20191031--001
libavutil : 56.14.100
libavcodec : 58.18.100
libavformat : 58.12.100
libswscale : 5.1.100
libswresample: 3.1.100
===== options =====
player-opts : overlay-format = fcc-bgra
player-opts : videotoolbox = 1
player-opts : enable-position-notify = 1
player-opts : start-on-prepared = 1
format-opts : ijkapplication = 4850081840
format-opts : ijkiomanager = 4849971424
===================
Opening 'https://46vod-adaptive.akamaized.net/exp=1597409385~acl=%2F04cf7e17-5507-416e-97c2-a26f6a27d395%2F%2A~hmac=2d7bd4c50e30032541752817b808bd618f7b0fff4a472e3d0b481f0aa2bd11f5/04cf7e17-5507-416e-97c2-a26f6a27d395/sep/audio/7724a1ec/playlist.m3u8' for reading
Protocol 'https' not on whitelist 'file,crypto'!
/var/mobile/Containers/Data/Application/0851E4DB-AA4C-4346-A6F2-5F2D00478D61/Documents/offline/+919744480203133/playlist.m3u8: Invalid argument
Let me know if anything is require, Will update here.
The HLS files expire after a certain amount of time. So if you're downloading the m3u8, you're not actually downloading the video, just a link to the playlist/manifest file that tells the player where to pull the real (usually mp4) video files from. You can see similar examples with the M3U (this example links to mp3 files, but m3u8 usually links to mp4 files).
So instead you'll want to download the actual mp4 files from Vimeo and then pass those files to your player. I gave an answer here that talks through one way to do that. (Here's how to download with Flutter).
The links to the mp4 files expire as well. But if you download them before they expire, you can access them anytime from disk (using the local file URL).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With