Rails中找不到视频或访问被拒绝

时间:2014-06-24 11:17:23

标签: ruby-on-rails actionview

在我的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这样的相对路径时,视频会播放。我该怎么办?

1 个答案:

答案 0 :(得分:0)

尝试不使用/assets/的路径:

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