I have an ios app with laravel (lumen) on the server side. I am trying to play the videos in the server, on application.
I am using a Player that plays videos with a direct link (e.g vine video link), however when I save the same vine video on my local server, the application doesn't play the video. In fact, when I try the video with my api route, surprisingly it plays the video on Chrome! But on the application end, I receive error:
The server is not correctly configured - 12939
(Please note that if I copy the same mp4 file into the xCode project, add it on 'copy bundle resources', and try with fileWithPath, it works. So I believe it's definitely caused by the server, not vidoo file/codec. )
My route: $app->get('/player/{filename}', 'PlayerController@show');
Methods:
public function show ($filename)
{
$this->playVideo($filename, 'recordings');
}
public function playVideo($filename, $showType)
{
if (file_exists("../uploads/" . $showType . "/" . $filename)) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$type = finfo_file($finfo, "../uploads/" . $showType . "/" . $filename);
header("Content-Type: " . $type);
readfile("../uploads/" . $showType . "/" . $filename);
}
}
To recap my problem, the video is playing on Chrome but receiving '12939' - 'Server is not correctly configured' on the mobile app.
Edit:
I tried using this as mentioned in the Apple Documentations:
curl --range 0-99 http://myapi.dev/test.mp4 -o /dev/null
However the documentation says:
"If the tool reports that it downloaded 100 bytes, the media server correctly handled the byte-range request. If it downloads the entire file, you may need to update the media server."
I received 100% and it downloaded the whole file for me, so I believe this is my problem. But I am not sure how to overcome this issue? What am I doing wrong? What should I do?