Ryan K
Ryan K

Reputation: 4053

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?

Upvotes: 1

Views: 356

Answers (1)

Tauqeer Ahmad
Tauqeer Ahmad

Reputation: 540

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.

Upvotes: 1

Related Questions