Html 如何使用Django网站播放视频?

Html 如何使用Django网站播放视频?,html,django,video-streaming,Html,Django,Video Streaming,我正在开发一个网站与django。我想嵌入一个通过for循环迭代的视频 {% for i in ImageData %} <td> <object width="425px" height="360px" > <param name="allowFullScreen" value="true"/> <param name="wmode" value="transparent"/> <param name="movie" value="{{ M

我正在开发一个网站与django。我想嵌入一个通过for循环迭代的视频

{% for i in ImageData %}
<td>
<object width="425px" height="360px" >
<param name="allowFullScreen" value="true"/>
<param name="wmode" value="transparent"/>
<param name="movie" value="{{ MEDIA_URL }}{{ i.video }}"/>
<embed src="{{ MEDIA_URL }}{{ i.video }}" width="425" height="360" allowFullScreen="true" type="video/avi" wmode="transparent"/>
<\td>
{% endfor %}
进一步: 我注意到的另一件事是,这个错误只发生在谷歌chrome中,而不是firefox4中。。我应该采取什么步骤来纠正它?
事先谢谢你

Django与此无关,真的


AVI视频不能仅作为
运行。您应该使用其中一种(不适用于所有浏览器),或者将视频转换为
.flv
并使用flash播放器,例如。

这种类型的错误不是来自Django。但是Google Chrome可能在连接时出错

这里有许多这样的错误,它们告诉它的浏览器错误:


您可能会遇到Django缺乏对视频流的支持的问题。因此,最好将Django与Web服务器(例如Nginx、Apache)结合使用,这样Django就可以处理动态内容,而媒体内容是由Web服务器直接提供的。有关更多详细信息,请参见此问题:

您的视频是什么格式的?它们在哪里托管?@stevejalim:video格式是.avi,托管在ubuntu django服务器上,“无法运行”是什么意思?如果您需要帮助,我们需要更多详细信息。可能是因为您没有关闭
标记?
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 284, in run
    self.finish_response()
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 324, in finish_response
    self.write(data)
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 416, in write
    self._write(data[offset:offset+chunk_size])
  File "/usr/lib/python2.6/socket.py", line 318, in write
    self.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
    self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 48640)
Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 283, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 309, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 322, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 570, in __init__
    BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.6/SocketServer.py", line 618, in __init__
    self.finish()
  File "/usr/lib/python2.6/SocketServer.py", line 661, in finish
    self.wfile.flush()
  File "/usr/lib/python2.6/socket.py", line 297, in flush
    self._sock.sendall(buffer(data, write_offset, buffer_size))
error: [Errno 32] Broken pipe