views:

26

answers:

1

I have to implement service which should stream a video content to iPhone application. My service is implemented in PHP:

header("Content-Type: video/mp4");
header('Content-Length: '.$result['size']);
echo $result['data']; 

where result is array containing the content of the video file and its size.

When I open it with browser there isn't problem (I have quick time and the video has played). However the application cannot open it, but it works with local files (sorry i don't have currently the code of the mobile aplication). When I have opend it in safary from the iPhone it says that the file cannot be downloaded.

It seems that I am missing some headers.

A: 

The problem was that iPhone app( the media component) uses range header. First it requests with range 0-1 to check if there is a result and after this it requests the whole content. I've used this .

Lyubomir Todorov