
ffmpeg hls doesn't works on iOs devices.
I use the ffmpeg tool to generate the m3u8 file from the mp4 video, and it generates segments files and the playlist.
---
Here is the string to generate:
ffmpeg -i input.mp4 -pix_fmt yuv420p -vcodec libx264 -r 25 -profile:v baseline -b:v 1500k -maxrate 2000k -force_key_frames 10 -map 0 -flags -global_header -f segment -segment_list playlist.m3u8 -segment_time 10 -segment_format mpeg_ts -segment_list_type m3u8 output%03d.ts
---
As result i have an numbers of .ts files and m3u8 like this:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:19
#EXTINF:10.040000,
output000.ts
#EXTINF:10.840000,
output001.ts
#EXTINF:10.360000,
output002.ts
<...>
#EXTINF:17.360000,
output100.ts
#EXTINF:3.640000,
output101.ts
#EXT-X-ENDLIST
---
It works perfect on my laptop in Safari and Chrome browsers, but when i try to watch the video on my iPad or iPhone it returns "File could not be played". When i try to open m3u8 file directly on iPad, it works perfect. Here is my embed code:
jwplayer("videoPlayer").setup({
file: 'http://localhost:3000/240/child.m3u8',
tracks: [{
file: 'http://localhost:3000/240/thumbnails.vtt',
kind: "thumbnails"
}],
debug: "true",
image: "<%=resource.front.url(:player, false)%>",
primary: "flash",
'autostart': false
});