title: Laravel 5 HTTP Response, M4V Files, and iOS MPMoviePlayerViewController
body: <p>I have a situation that has me stumped so I'm looking for any help I can get. </p>
  
  <p>I have a iOS App that uses MPMoviePlayerViewController to play M4V Video Files managed by a Laravel 5 site. </p>
  
  <p>The video files play perfectly fine (in iOS) if they are directly downloaded from the Laravel 5 /public folder.  However, I'm normally storing and serving the Video Files from Laravel 5's Storage Facade as I'm eventually going to use S3 and elastic transcoder.</p>
  
  <p>This works in FireFox with the QuickTime browser plugin, VLC, and other streaming video clients, but not our iOS App.</p>
  
  <p>As far as I can tell the MPMoviePlayerViewController is being picky about how the HTTP Response is being formatted. I have tried StreamedResponse, but that does not seem to help.</p>
  
  <p>So for example the following URL that pulls the file directly from the /public folder works fine from iOS:</p>
  
  <pre><code>http://172.16.160.1/video_ae9a7da0efa211e4b115f73708c37d67.m4v
  </code></pre>
  
  <p>But if I use Laravel 5 to pull the file from Storage with this URL iOS will not play it.</p>
  
  <pre><code>http://172.16.160.1/api/getfile/f444b190ef5411e4b7068d1890d109e8/video_ae9a7da0efa211e4b115f73708c37d67.m4v
  </code></pre>
  
  <p>Note iOS does not provide any meaningful errors, to help debug this, but I'm positive its how my HTTP Response is being made by Laravel 5.</p>
  
  <p>Here is my Route:</p>
  
  <pre><code>Route::get('myapi/getfile/{filename?}', 'APIController@getfile')-&gt;where('filename', '(.*)');
  </code></pre>
  
  <p>Here is my Controller:</p>
  
  <pre><code>    public function getfile($filename)
  {
      return $api = API::getfile($filename);
  }
  </code></pre>
  
  <p>Here is my Model:</p>
  
  <pre><code>public static function getfile($filename) {
  $file = Storage::disk('local')-&gt;get('Files/'.$filename);
  return (new Response($file, 200))-&gt;header('Content-Type', 'video/mp4');
  }
  </code></pre>
  
  <p>If I left out any supporting info please let me know and I'll post it. My next step may be to setup Wireshark testbed and see what the handshake looks like.</p>
  
  <p>Thanks in advance for the help. :-)</p>