I have an ios application with laravel (lumen) on the server side. I am trying to play a video on a server in an application.
I use Player, which plays a video with a direct link (for example, a video for videos), however, when I save the same video on your local server, the application does not play the video. In fact, when I try the video using my api route, it is amazing that it plays the video on Chrome! But at the end of the application, I get an error message:
Server is configured incorrectly - 12939
(Note that if I copy the same mp4 file to the xCode project, add it to the "instance package resources" and try with theWithPath file, it works. Therefore, I believe this is definitely caused by the server, not the 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 reproduce my problem, the video plays in Chrome, but gets "12939" - "Server is not configured correctly" in the mobile application.
Edit:
I tried using this as stated in 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 processed the request for a byte range. If it downloads the entire file, you may need to update the media server."
100%, , , . , ? ? ?