HTML5 video element non-seekable when using Django development server

萝らか妹 提交于 2019-12-04 03:08:53

Django's dev server probably doesn't support HTTP byte ranges, which is what browsers usually use to implement seeking.

Any production web server, e.g. Apache, lighttpd, or nginx, should support these fine. If you can run your entire Django app one of these servers the problem should go away.

A workaround would be to just serve the video from a server like that: set one of them up to statically serve the video directory on your machine on a different port than Django's dev server, and then in your dev environment either change the <video src= URL to point to the new web server, or write a special view for videos that redirects to the new web server.

Silver Light

I didn't ran into anything like that myself, but I can guess, that Django development server can't stream a video "just like that". You might have to use ETAG middleware to cure this.

Take look at this question: How to stream an HttpResponse with Django

Also note the current builtin dev server is single-threaded so it may freeze easyly.

The concurrent test server : https://github.com/jaylett/django_concurrent_test_server is better for streaming/uploads... (not usable in prod)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!