【发布时间】:2014-03-30 04:23:12
【问题描述】:
我在 ruby on rails 应用中播放上传的视频时遇到问题。
所以我在上传视频时使用paperclip-ffmpeg gem 处理我的视频,我可以创建视频的缩略图,但我无法播放视频。当我右键单击视频时,我可以下载并且可以使用计算机上的播放器播放它,但我无法在我的视图中播放它。此外,当我右键单击它时,“播放”、“跳过”等选项都被阻止。这是我的模型:
class Video < ActiveRecord::Base
has_attached_file :clip, :styles => {
:medium => { :geometry => "640x480", :format => 'flv'},
:thumb => {:geometry => "100x100#", :format => 'jpg', :time => 10}
}, :processors => [:ffmpeg]
do_not_validate_attachment_file_type(:clip)
end
这是我的观点:
<table class="table">
<tr>
<th>Video</th>
<th>Title</th>
<th>Caption</th>
</tr>
<% @video.each do |video| %>
<tr>
<td>
<%= image_tag video.clip.url(:thumb) %>
<%= video_tag video.clip.url(:medium) %>
</td>
<td>
<%= label_tag video.title %>
</td>
<td>
<%= label_tag video.caption %>
</td>
</tr>
<% end %>
</table>
我也尝试过使用videojs_rails gem,但我也无法使用它播放视频。如果有人可以帮助我,我将不胜感激,我一直在到处寻找答案,但没有找到对我有用的答案。
提前致谢
【问题讨论】:
标签: ruby-on-rails video ffmpeg html5-video