【问题标题】:video not found or access denied in Rails在 Rails 中找不到视频或访问被拒绝
【发布时间】:2014-06-24 11:17:23
【问题描述】:

在我的 Rails 应用程序中,我尝试添加如下视频:

<table class="table">
    <tr>
        <th width="25%">Candidate</th>
        <th width="80%">Video</th>
    </tr>
    <tr> 
        <td>
            <%= video_player({:file => "/assets/video/water_msg.flv"}, {:width => 470, :height => 400, :id => "water_msg_video", :onclick => "alert('clicked!');"}) %>
        </td>
    </tr>
       </table>

我在:file 中使用上述相对路径,但出现以下错误:

video not found or access denied: /assets/video/water_msg.flv

当我使用完整路径(或链接)而不是像 http://www.longtailvideo.com/jw/upload/bunny.mp4 这样的相对路径时,视频会播放。我该怎么办?

【问题讨论】:

  • 把你的视频放到public文件夹,然后改:file =&gt; "/video/water_msg.flv"

标签: ruby-on-rails actionview


【解决方案1】:

试试不带/assets/的路径:

<%= video_player({:file => "video/water_msg.flv"}, {:width => 470, :height => 400, :id => "water_msg_video", :onclick => "alert('clicked!');"}) %>

【讨论】:

    猜你喜欢
    • 2011-03-22
    • 1970-01-01
    • 2013-02-21
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-08
    相关资源
    最近更新 更多