gpt4 book ai didi

javascript - 将 jwplayer in rails 添加到网络时出错

转载 作者:行者123 更新时间:2023-11-30 06:29:46 24 4
gpt4 key购买 nike

我已经有了 jwplayer,我正在按照这篇文章 JW-Player and Rails 3.2 安装安装后:

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

然后“视频屏幕”变黑了,我收到以下消息

Started GET "/jwplayer.flash.swf" for 127.0.0.1 at 2013-08-28 17:23:20 +0200

ActionController::RoutingError (No route matches [GET] "/jwplayer.flash.swf"):
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0) lib/rails/engine.rb:511:in `call'
railties (4.0.0) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/jcr/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/jcr/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/jcr/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

非常感谢您的帮助和时间,

最佳答案

在 app/assets 目录中创建一个名为“jwplayer”的文件夹并将 jwplayer.flash.swf 放入其中。这样目录结构看起来像app/assets/jwplayer/jwplayer.flash.swf。并将浏览器更新到最新版本,否则将不支持 HTML5。

如果它仍然会抛出相同的错误,则保持更改不变并替换该行

flashplayer: "<%=asset_path('jwplayer.flash.swf')%>"与

flashplayer: "<%=asset_path('jwplayer/jwplayer.flash.swf')%>"

关于javascript - 将 jwplayer in rails 添加到网络时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18492275/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com