【发布时间】:2011-08-19 07:41:50
【问题描述】:
我正在用 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 %}
我在页面上获取视频,但无法流式传输。 !!谁能帮帮我?
在 localhost:8000 上工作,它确实显示了一个视频框但无法运行。
更新: 这是我在运行 django 服务器时在终端中遇到的错误,网站仍在 Chorme(在 Ubuntu 中)
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
进一步: 我注意到的另一件事是,这个错误只发生在 google-chrome 而不是 firefox4 .. 我应该采取什么步骤来纠正它? 提前谢谢你
【问题讨论】:
-
你的视频是什么格式的?它们在哪里托管?
-
@stevejalim : 视频格式为 .avi 并托管在 ubuntu django 服务器上
-
“无法运行”是什么意思?如果您需要帮助,我们需要更多详细信息
-
可能是因为你没有关闭
<object>标签?
标签: html django video-streaming