title: What is the proper way to serve mp4 files through rails to an Ipad?
body: <p>We're having trouble serving mp4s that will play on an ipad using a default rails 3 app. The mp4 is served correctly when viewing the route in chrome and other browsers on a desktop. </p>
  
  <p>Here is our code:</p>
  
  <pre><code>file_path = File.join(Rails.root, 'test.mp4')
  send_file(file_path, :disposition =&gt; "inline", :type =&gt; "video/mp4")
  </code></pre>
  
  <p>We hit 0.0.0.0:3000/video/test.mp4 to view the video and are presented with cannot play icon on the ipad. We've tried modifying various headers "Content-Length", "Content-Range", etc but they don't seem to affect the end result. </p>
  
  <p>We've also tried using send_data to some extent</p>
  
  <p>i.e.</p>
  
  <pre><code>File.open(file_path, "r") do |f|
      send_data f.read, :type =&gt; "video/mp4"
  end 
  </code></pre>
  
  <p>The same video serves fine from the public folder when viewed on the Ipad.</p>
  
  <p>What is the proper way to serve mp4 files through rails to an Ipad?</p>