Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用本地视频(即localhost:4000访问)时无法调节视频进度 #24

Closed
CCJohny opened this issue Aug 27, 2018 · 7 comments
Closed

Comments

@CCJohny
Copy link

CCJohny commented Aug 27, 2018

当我点击进度条任意位置时都会跳回第一秒

@CCJohny
Copy link
Author

CCJohny commented Aug 27, 2018

是本地资源不支持断点续传吗还是

@dixyes
Copy link
Member

dixyes commented Aug 31, 2018

你可以试着直接用浏览器打开这个文件

  • 如果同样情况,是HTTP服务器/浏览器的问题
  • 如果能用,再试着使用dplayer的范例播放视频
    • 如果同样情况,是dplayer的问题 向dplayer反馈
    • 如果能用,尽可能详细的告诉我你的环境(系统版本 浏览器版本 node hexo-tag-dp dplayer的版本 视频文件编码 格式等等

@DIYgod
Copy link
Member

DIYgod commented Aug 31, 2018

本地文件不支持

@DIYgod DIYgod closed this as completed Aug 31, 2018
@dixyes
Copy link
Member

dixyes commented Aug 31, 2018

@DIYgod 我猜他说的是hexo自带的预览模式 http://localhost:4000/somePath/someFile.mp4 这种算是本地么

(最近沉迷做python的coolq嵌入 沉迷的不行都没看邮件。。。

@DIYgod
Copy link
Member

DIYgod commented Aug 31, 2018

@dixyes 应该也算

@A-Circle-Zhang
Copy link
Member

localhost 也是一种本地服务器,对浏览器而言,和网络服务器没任何区别。

我觉得这个问题是要看本地服务器支不支持 Range 。

@dixyes
Copy link
Member

dixyes commented Aug 31, 2018

emmm 好像是hexo的锅

>C:\Users\DIXXPS\Desktop\pycompact>curl http://localhost:4000/blog/x.mp4 -H"Range: bytes=1000-1012" -vvv --output -
*   Trying ::1...
* TCP_NODELAY set
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 4000 (#0)
> GET /blog/x.mp4 HTTP/1.1
> Host: localhost:4000
> User-Agent: curl/7.55.1
> Accept: */*
> Range: bytes=1000-1012
>
< HTTP/1.1 200 OK
< X-Powered-By: Hexo
< Content-Type: video/mp4
< Date: Fri, 31 Aug 2018 14:31:15 GMT
< Connection: keep-alive
< Transfer-Encoding: chunked
<
(一坨乱码二进制) * Failed writing body (4096 != 16384)
* Failed writing data
* Closing connection 0
curl: (23) Failed writing body (4096 != 16384)

http-server的正确响应:

C:\Users\DIXXPS\Desktop\pycompact>curl http://localhost/x.mp4 -H"Range: bytes=1000-1012" -vvv --output -
*   Trying ::1...
* TCP_NODELAY set
* connect to ::1 port 80 failed: Connection refused
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /x.mp4 HTTP/1.1
> Host: localhost
> User-Agent: curl/7.55.1
> Accept: */*
> Range: bytes=1000-1012
>
< HTTP/1.1 206 Partial Content
< server: ecstatic-3.2.0
< Content-Range: bytes 1000-1012/173181126
< Accept-Ranges: bytes
< Content-Length: 13
< Content-Type: video/mp4; charset=utf-8
< cache-control: max-age=3600
< last-modified: Thu, 29 Jun 2017 10:49:04 GMT
< etag: W/"2814749767885134-173181126-"2017-06-29T10:49:04.000Z""
< Date: Fri, 31 Aug 2018 14:35:22 GMT
< Connection: keep-alive
<
  �  �?   �  * Connection #0 to host localhost left intact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants