Ruby 和 Webrick 视频流
我正在开发一个网络应用程序,它将流式传输视频数据库,但我在使用 Webbrick 和 HTML5 视频时遇到困难。我正在使用一个简单的 HTML 标签,但视频似乎不会显示。有什么帮助吗? (顺便说一句,文件路径是正确的)。
这是我的 HTML 代码:
<div id="lr_video">
<%= video_tag (["videos/final_video.mp4", "final_video.ogg", "movie.webm"], :size => "320x240", :controls => true, :autobuffer => true) %>
</div>
我的 Ruby 代码:
在 config/application.rb 中:
...
..
#HTML5 Video !!!
config.assets.paths << "#{Rails.root}/public/assets/videos"
..
...
现在我使用 Webrick 作为生产服务器,并将我的视频放在“/public/assets/videos”下,但视频没有显示
任何内容帮助 ?
I am developing a web-app that will stream a database of videos, but I am having difficulties with Webbrick and HTML5 Video. I am using a simple HTML tag but the video won't seem to show up. any help ? (the file path is correct btw).
Here is my HTML Code:
<div id="lr_video">
<%= video_tag (["videos/final_video.mp4", "final_video.ogg", "movie.webm"], :size => "320x240", :controls => true, :autobuffer => true) %>
</div>
my Ruby code:
in config/application.rb:
...
..
#HTML5 Video !!!
config.assets.paths << "#{Rails.root}/public/assets/videos"
..
...
now I am using Webrick as a production server, and I put my videos under "/public/assets/videos" but the video doesn't show up
any help ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您发送的视频可能带有错误的 Content-Type 标头。
检查它的输出
应该说
如果没有,那么您应该修复内容类型标头的生成。
You are probably sending the video with the wrong Content-Type header.
Check the output of
It should say
If if does not, then you should fix the generation of the content-type header.