javascript - jwplayer in rails error when is added in the web -
i have jwplayer , installing following post jw-player , rails 3.2 once installed :
<script type="text/javascript">jwplayer.key="mykey";</script> <div id="video">loading 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>
and "video screen" black , have following message
started "/jwplayer.flash.swf" 127.0.0.1 @ 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'
thank , time,
in app/assets directory create folder named "jwplayer" , put jwplayer.flash.swf in it. directory structure looks app/assets/jwplayer/jwplayer.flash.swf. , update browser latest version otherwise not support html5.
if still throw same error keep changes , replace line
flashplayer: "<%=asset_path('jwplayer.flash.swf')%>" with
flashplayer: "<%=asset_path('jwplayer/jwplayer.flash.swf')%>"
Comments
Post a Comment