I have a situation that hurts me, so I'm looking for any help I can get.
I have an iOS application that uses MPMoviePlayerViewController to play M4V video files managed by a Laravel 5 site.
Video files play perfectly (on iOS) if they are directly downloaded from the Laravel 5 / public folder. However, I usually store and maintain video files with the Laravel 5 Storage Facade, as I will ultimately use S3 and an elastic transcoder.
This works in FireFox with the QuickTime browser plugin, VLC, and other streaming video clients, but not our iOS app.
As far as I can tell, MPMoviePlayerViewController are picky about how the HTTP response is formatted. I tried StreamedResponse, but it doesn't seem to help.
So, for example, the following URL, which pulls the file directly from / the public folder, works fine with iOS:
http:
But if I use Laravel 5 to pull a file out of storage using this URL, iOS will not play it.
http://172.16.160.1/api/getfile/f444b190ef5411e4b7068d1890d109e8/video_ae9a7da0efa211e4b115f73708c37d67.m4v
Note. iOS doesn't contain any significant bugs to help debug this, but I'm sure my HTTP response is being executed by Laravel 5.
Here is my route:
Route::get('myapi/getfile/{filename?}', ' APIController@getfile ')->where('filename', '(.*)');
Here is my controller:
public function getfile($filename) { return $api = API::getfile($filename); }
Here is my model:
public static function getfile($filename) { $file = Storage::disk('local')->get('Files/'.$filename); return (new Response($file, 200))->header('Content-Type', 'video/mp4'); }
If I left any supporting information, please let me know and I will publish it. The next step might be to install the Wireshark test bench and see what the handshake looks like.
Thank you in advance for your help. :-)