0

I am developing a website with django . I wanted to embed a video which is iterated through a for loop.

{% 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 %}

I am getting the video on the page, but not able to stream it. !! Can anyone please help me?

working on localhost:8000, it does show me a video box but cannot run .

Update: This is the error i got in the terminal when the django server is run, the website is still on the Chorme (in 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

Further: The other thing i noticed, is that this error occurs only in google-chrome and not in firefox4 .. Any step i should follow to get it corrected ? Thank you in advance

3 Answers3

0

You may be encountering a problem with Django's lack of support for HTTP Range requests - which are commonly used with video streaming. So you're probably better off using Django in conjunction with a webserver (e.g. Nginx, Apache) so Django handles the dynamic content with the media content is provided directly by the webserver. See this Question for more details: Byte Ranges in Django

Community
  • 1
  • 1
Pierz
  • 7,064
  • 52
  • 59
0

Django has nothing to do with this, really.

AVI video cannot just run as an <embed>. You should use either HTML5 <video> tag (won't work in every browser), or convert your video to .flv and use a flash player, like OSPlayer, for example.

Silver Light
  • 44,202
  • 36
  • 123
  • 164
0

This type of error is not from Django. But the Google Chrome might have some error connecting!

Here are many such errors where they tell its browser fault:

Community
  • 1
  • 1
Nagaraj Tantri
  • 5,172
  • 12
  • 54
  • 78