简体   繁体   中英

Rails Play MP4 on iOS

I have an .mp4 that I want to play on my site via the video_tag like so:

<%= video_tag "video1.mp4", type: "video/mp4" %>

This works on Firefox and Safari (on Mac) and on Android Chrome, but it doesn't work on Safari for iOS. Is there some special command or option to be able to view .mp4 on an iOS device?

To play mp4 on IOS mp4 encoding setting should be changed according to IOS requirements.

Actually not all encoded Mp4 files are supported by iPhone. Different encoding may cause some file to work and fail for others.

Best possible encoding settings are

  1. Only use the H.264 Baseline
  2. Profile Level 3.0
  3. Resolution below 640 x 480 and framerate up to 30 fps
  4. bitrate limit of 900kb.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM