video.js scub吧不工作?

时间:2014-12-22 13:11:34

标签: django video.js

我正在使用来自video.js的源文件。 我将以下代码加载到tab-pane active

视频play按钮有效。 scrub栏不起作用。目前只测试了铬。

更新1

<div class="span9"> <video id="tutorial_video" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" width="auto" height="auto" poster="{{STATIC_URL}}video/tutorial/first-frame-how-to-guide.png"> <source src="{{STATIC_URL}}video/tutorial/tutorial.mp4" type='video/mp4'> <source src="{{STATIC_URL}}video/tutorial/tutorial.webm" type='video/webm'> <p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> </p> </div>

这是我用来将电影放在中间的样式代码。

.video-js .vjs-tech { position: relative !important; }

这是一个不起作用的GIF。

enter image description here

我没有得到任何内省运动错误或控制台错误。

更新2

我打破了代码。 有效。 我用上面的新文件覆盖了video-js文件。 我将video-js.css的一大块更改为以下。它没有用。 我将其更改回来,清除了缓存并刷新了页面。它没有用。

/* Individual tracks */
.video-js .vjs-text-track {
  display: none;
  font-size: 1.4em;
  text-align: center;
  margin-bottom: 0.1em;
  /* Transparent black background, or fallback to all black (oldIE) */
  /* background-color-with-alpha */
  background-color: #00618e;
  background-color: rgba(0, 97, 142, 1);
}
.video-js .vjs-subtitles {
  color: #ffffff /* Subtitles are white */;
}
.video-js .vjs-captions {
  color: #ffffff /* Captions are yellow */;
}
.vjs-tt-cue {
  display: block;
}

我在django Web服务器日志中注意到此错误消息。

Exception happened during processing of request from ('192.168.1.70', 54466)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 126
  , in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "C:\Python27\lib\SocketServer.py", line 641, in __init__
    self.finish()
  File "C:\Python27\lib\SocketServer.py", line 694, in finish
    self.wfile.flush()
  File "C:\Python27\lib\socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 10053] An established connection was aborted by the software in your host machine

我相信问题可能出在DJANGO的测试服务器上。我不相信这是video-js的实际问​​题。

3 个答案:

答案 0 :(得分:0)

它应该不起作用。 Django不应该&#34;处理&#34;视频或其他静态文件。是作业ob Web服务器(nginx,apache,....)。 Django只会将url提供给静态文件,Web Server会处理它。
部署应用程序时,您将使用Web Server捕获/ static /或/ media / urls请求。

以nginx为例,我们有this

答案 1 :(得分:0)

我不肯定这会完全解决您的问题,但您的video.js嵌入代码有点混乱。您有两个视频标签,其中一个位于后备段落(&#34; vjs-no-video&#34;)内,没有来源。将它与videojs.com上的嵌入代码进行比较。

<video id="MY_VIDEO_1" class="video-js vjs-default-skin" controls
 preload="auto" width="640" height="264" poster="MY_VIDEO_POSTER.jpg"
 data-setup="{}">
 <source src="MY_VIDEO.mp4" type='video/mp4'>
 <source src="MY_VIDEO.webm" type='video/webm'>
 <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>

如果这不能解决问题,发布实时示例或浏览器错误控制台中显示的任何错误都有助于调试问题。

答案 2 :(得分:0)

我在django Web服务器日志中注意到此错误消息。

Exception happened during processing of request from ('192.168.1.70', 54466)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 126
  , in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "C:\Python27\lib\SocketServer.py", line 641, in __init__
    self.finish()
  File "C:\Python27\lib\SocketServer.py", line 694, in finish
    self.wfile.flush()
  File "C:\Python27\lib\socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
    error: [Errno 10053] An established connection was aborted by the software in your host machine

我相信问题可能出在DJANGO的测试服务器上。我不相信这是video-js的实际问​​题。