django html5 video,django - Playing video HTML5 and Apache - Stack Overflow

What I'd like to do is to play a video served by an request to a URL.

The webserver is Django

Here the HttpResponse to serve the video is formed:

filename = rec_path(recording_id) + '/rgb_video.mp4'

wrapper = FileWrapper(file(filename))

response = HttpResponse(wrapper, content_type='video/mp4')

response['Content-Disposition'] = 'filename=video.mp4'

response['Content-Length'] = os.path.getsize(filename)

return response

And in the HTML side I have

Your browser does not support the video tag. //add this line

I can download the video but not play it this way. I've tried installing the mod_h264 mod

and configuring a simple VirtualHost that only serves files. I've also tried Jwplayer but none of them worked.

UPDATE: Strangely one of the videos play this way. All videos are produced with the same settings so I'm not sure what's causing this. The video that plays is quite short, 8 seconds, so perhaps that is the cause?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值