加载媒体时出错:在jw_player导轨中无法播放文件错误 [英] Error loading media: File could not be played error in jw_player rails

查看:699
本文介绍了加载媒体时出错:在jw_player导轨中无法播放文件错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用下面提到的代码从本地磁盘播放视频.但是它不起作用,而是抛出了错误加载媒体:无法播放文件错误错误.我已经在下面提到了代码.

I am using the below mentioned code to play a video from my local disk. But its not working instead of that it's throwing Error loading media: File could not be played error error. I have mentioned the code below.

 <%= jwplayer_assets %>
 <%= jwplayer ({:file => "/home/user/Downloads/digital.mp4", :image => "/home/user/Downloads/Retreats_21.jpg"}) %>

我是这个jw_player的新手.所以请帮我解决这个问题.预先感谢..

I'am new to this jw_player. so please help me to solve this issue. Thanks in advance..

推荐答案

http:下载jwplayer //www.longtailvideo.com/jw-player/download/

将这些文件放入特定目录:-

Put these files to the particular directory:-

  • app/assets/jwplayer/jwplayer.flash.swf
  • 供应商/资产/javascripts/jwplayer.js
  • vendor/assets/javascripts/jwplayer.html5.js

然后将这些行添加到 application.js

//= require jwplayer
//= require jwplayer.html5

在您正在播放视频的页面上,添加以下行

On the page where you are playing video, add these lines

<script type="text/javascript">jwplayer.key="YOUR_JWPLAYER_KEY";</script>
<div id="video">Loading the player ...</div>
<script type="text/javascript">
jwplayer("video").setup({
    flashplayer: "<%=asset_path('jwplayer.flash.swf')%>",
    file: "<%= file_path %>",
    height: 360,
    width: 640,
    analytics: {
        enabled: false,
       cookies: false
   }
});
</script>

https://account.longtailvideo.com/#/account 获取您的许可证密钥部分中的自托管播放器许可证密钥(YOUR_JWPLAYER_KEY).

看看 https://github.com/shamsulsham89/jwplayer-rails3.2

请先在 Chrome版本30

这篇关于加载媒体时出错:在jw_player导轨中无法播放文件错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆