【问题标题】:use html5 video (localhost) with SimpleHTTPServer将 html5 视频 (localhost) 与 SimpleHTTPServer 一起使用
【发布时间】:2013-03-11 12:17:05
【问题描述】:

我使用google io slide deck,在添加视频链接之前工作正常。我有一个 11MB 的视频文件,我在幻灯片中包含了

<video src="video/out/report.mp4"  height="600" controls>

运行服务器时(server.sh - $open http://localhost:$port/index.html &amp;&amp; python -m SimpleHTTPServer $port;),它卡在视频的位置。

1.0.0.127.in-addr.arpa - - [11/Mar/2013 07:56:18] "GET /images/task.png HTTP/1.1" 200 -
1.0.0.127.in-addr.arpa - - [11/Mar/2013 07:56:18] "GET /images/receive/external.png HTTP/1.1" 200 -
1.0.0.127.in-addr.arpa - - [11/Mar/2013 07:56:18] "GET /video/out/report.mp4 HTTP/1.1" 200 -

最后一行之后没有活动。但是当直接打开 index.html(没有网络服务器,只需双击文件并在浏览器中打开),视频加载

使用网络服务器运行时阻止加载的视频标签 url 有什么问题吗?

谢谢。

【问题讨论】:

  • 可能是 SimpleHTTPServer 正在使用错误的媒体类型提供文件。您应该能够使用浏览器中的开发人员工具或curl -vs http://localhost:8000/video/out/report.mp4 &gt; /dev/null 来判断
  • +1 感谢@TokenMacGuy。我认为使用节点可以更好地解决。

标签: python html simplehttpserver


【解决方案1】:

我也看到了 require.js 错误,导致What is a faster alternative to Python's http.server (or SimpleHTTPServer)?

改用 node.js 服务器效果很好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-16
    • 2019-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-11
    相关资源
    最近更新 更多