I'm struggling since more than a week with this problem.
I made a rails webapp, mobile first, using html5 for video. I made some videos (webm and mp4 for cross browser / cross device compatibility).
my video tag :
<%= video_tag ["assets/my.webm","assets/my.mp4"], controls: true, :autobuffer => true %>
my problem is that the mp4 doesn't play on ios device (specially iphone I'm targetting), tested on iphone 3GS, iphone 4 and iphone 6+
After some research, I have already try :
. adding a js element using "touchstart" ios function (code erase since it wasn't working)
. adding Accept-Range to my host file (and test result with a curl request)
<IfModule mod_headers.c>
Header set Accept-Ranges "bytes"
</IfModule>
. putting first the mp4 in the video_tag,
. adding data into config/initializers/mime-types
Mime::Type.register "video/webm", :webm
Mime::Type.register "video/ogg", :ogv
Mime::Type.register "video/mp4", :mp4
Mime::Type.register "video/mp4", :m4v
. find the best converting option with ffmpeg
ffmpeg -i in.mp4 -c:v libx264 -profile:v baseline -level 3.1 -r 30 -crf 24 -vf "scale=-2:720" -codec:a libfdk_aac -b:a 128k out.mp4
based on following informations found here and elsewhere codec H264, Main Profile level 3.1, 30 fps, audio 128 Kbps, 48kHz,
testing results with
ffprobe -show_format -pretty -print_format json
. I also try to get the video directly through the url http://quickies.media/assets/quickies.media.test1.mp4 on ios device with no more luck
Is there someone here that can have an idea ?? I am get short ideas now after all my previous tests ...
one detail, I also have videos in public/videos/:id directory that are not playable too
very thanks in advance :)