KurentoRails
KurentoRails is a gem designed to make integrating kurento media server and rails applications easier. We provide a javascript library to provide easy access to kurento's video streaming functionality.
Installation
Add this line to your application's Gemfile:
gem 'kurento_rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install kurento_rails
For reasons that I'm not entirely sure about and don't have time to investigate just yet, the gem isn't correctly bundling websocket-rails in as well on some systems. If your app won't launch after you complete the steps listed below in usage, try fixing it by just adding websocket-rails to your gemfile as well, then re-running bundle.
Usage
After installation, run the following command
rails g kurento_rails:install
This will copy a number of files into your project. These are:
- config/events.rb: This file is responsible for routing websockets events to the correct controller and action
- app/controllers/kurento_controller.rb: This controller is used for serving html pages that interact with kurento. It should at least be a step in the right direction for you.
- app/controllers/kurento_websockets_controller.rb: This controller is responsible for most of the internal streaming logic. The javascript client library interacts heavily with this controller
- app/assets/javascripts/kurento-rails-js: This is the javascript client library. kurento-rails.js is the main code for the library. The other libraries included here are dependencies and should also be included.
- db/migrations/timestamp-create_video_streams.rb: This is the active record migration for the video stream model.
- app/models/kurento_rails_video_stream.rb: This is the video stream model
- app/views/kurento: This folder contains the views associated with the kurento controller. I assume that you're using slim, because slim is fantastic, but if you're not, you can just edit the extensions on these.
finally, you'll need to migrate the database
rake db:migrate
After this, the installation process should be complete.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/andrewls/kurento-rails.
License
The gem is available as open source under the terms of the MIT License.