Hello,
First of all, what a beautiful framework web2py is! Thank you!

I am having issues streaming a video file to ios devices.
The file is not the problem because the same file plays properly on
those devices when it is served by Amazon CloudFront (here is the URL
-
http://video-js.zencoder.com/oceans-clip.mp4)
The only difference I can think of is 1) how web2py & apache are
streaming the file or 2) the HTTP response headers. I have attached
that info below. Can someone point me in the right direction? Thanks
again. -rajesh

Here is how i stream the file:
def stream():
    video = db(db.pl_video.id == request.args(0)).select().first()
    import os
    path=os.path.join(request.folder,'uploads',video.file)
    response.headers['Content-Type']="video/mp4"
    return response.stream(open(path,'rb'),chunk_size=4096)

Here are the HTTP response headers from Amazon Cloudfront:
HTTP/1.0 206 Partial Content
x-amz-id-2: ndMXqK+Ph7tr
+cIpwwLGIguiEbBFldo8R5zaSoixpSOi2vk8TrveD8o20ndW2Wwu
x-amz-request-id: 2DD534881E789D54
Date: Sun, 04 Dec 2011 08:50:38 GMT
Last-Modified: Wed, 19 May 2010 04:26:19 GMT
ETag: "22f0a95f531d7b0e5f4d62111bd96129"
Accept-Ranges: bytes
Content-Type: video/mp4
Server: AmazonS3
Content-Range: bytes 15032-19448240/19448241
Content-Length: 19433209
Age: 60075
X-Cache: Hit from cloudfront
X-Amz-Cf-Id: vOTpmdd_GSiqJODWXhmXN0bAGqP4z5jtGNoLAKdRtjpGthJi0-f7jA==
Via: 1.0 8c4b909b02aa03af96f7c65f7c7b1ffd.cloudfront.net:11180
(CloudFront), 1.0 bd872f9042b68d05c09b3026d21f96b2.cloudfront.net:
11180 (CloudFront)
Connection: keep-alive

And here are the HTTP response headers from web2py via Apache:
HTTP/1.1 200 OK
Date: Fri, 02 Mar 2012 16:42:07 GMT
Server: Apache/2.2.22 (Amazon)
X-Powered-By: web2py
Expires: Fri, 02 Mar 2012 16:42:07 GMT
Pragma: no-cache
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Set-Cookie: session_id_phylo=67.164.21.6-98bb86b9-7459-48b5-85a0-
abcc90dfa234; expires=Sun, 01-Apr-2012 16:42:07 GMT; Path=/
Content-Length: 19448241
Connection: close
Content-Type: video/mp4

Reply via email to