我想通过 HTML5 video 标签播放我的 webapp 文件夹中的一些 mp4 和 webm 视频文件。
但我遇到的问题是 tomcat 的状态码只有 200:
Request URL:http://localhost:8080/resources/1.mp4
Request Method:GET
Status Code:200 OK
但是当我从 apache 网络服务器执行相同操作时,我将获得状态代码 206:
Request URL:http://localhost/1.mp4
Request Method:GET
Status Code:206 Partial Content
是否可以激活 apache tomcat 的代码 206。默认情况下,在 web.xml 中,useAcceptRanges 为 [true]。
感谢您的帮助。
最佳答案
您需要自己实现 HTTP 范围支持。参见 this ,几乎相同的问题/答案。
关于apache - 为 Apache Tomcat 6 启用状态代码 206,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13627949/