Я пытаюсь воспроизвести видео с django 3.0
и videojs
. Когда я играю легкие видео (например, 5 МБ), я могу играть без проблем. Но мне нужно воспроизвести видео размером 1 ГБ для приложения, которое я разрабатываю. Вот этот код для воспроизведения видео.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="{% static 'css/video-js.css' %}" rel="stylesheet" type="text/css">
<script src="{% static 'js/videojs-ie8.min.js' %}"></script>
<title>Smart City</title>
<head>
<body>
<video
id="my-video"
class="video-js"
controls
preload="auto"
width="640"
height="264"
>
<source src="{% static 'videos/video1.mp4' %}" type="video/mp4">
</video>
</body>
</html>
И Django сказал эту ошибку:
Traceback (most recent call last):
File "C:\path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 279, in write
self._write(data)
File "C:\path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\path\to\Python\Python37-32\lib\socketserver.py", line 796, in write
self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] Se ha anulado una conexión establecida por el software en su equipo host
[13/Jan/2020 16:00:09] "GET /static/videos/10049.mp4 HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 60615)
Traceback (most recent call last):
File "C:path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "C:\path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:\path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 279, in write
self._write(data)
File "C:\path\to\Python37-32\lib\wsgiref\handlers.py", line 453, in _write
result = self.stdout.write(data)
File "C:\path\to\Python\Python37-32\lib\socketserver.py", line 796, in write
self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] Se ha anulado una conexión establecida por el software en su equipo host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "D:\PycharmProjects\<project>\venv\lib\site-packages\django\core\servers\basehttp.py", line 119, in handle_error
super().handle_error()
File "C:path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "C:path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "C:path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "C:path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "C:path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 344, in client_is_modern
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\giturra\AppData\Local\Programs\Python\Python37-32\lib\socketserver.py", line 647, in process_request_thread
self.finish_request(request, client_address)
File "C:path\to\Python\Python37-32\lib\socketserver.py", line 357, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:path\to\Python\Python37-32\lib\socketserver.py", line 717, in __init__
self.handle()
File "D:\PycharmProjects\<project>\venv\lib\site-packages\django\core\servers\basehttp.py", line 174, in handle
self.handle_one_request()
File "D:\PycharmProjects\<project>\venv\lib\site-packages\django\core\servers\basehttp.py", line 197, in handle_one_request
handler.run(self.server.get_app())
File "C:path\to\Python\Python37-32\lib\wsgiref\handlers.py", line 144, in run
self.close()
File "D:\PycharmProjects\<project>\venv\lib\site-packages\django\core\servers\basehttp.py", line 114, in close
super().close()
File "path\to\Python\Python37-32\lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
Я не знаю, важно ли это, но я использую Google Chrome для отображения приложения.