0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Integrates Ooyala with Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0

Runtime

 Project Readme

Ooyala::Rails

Integrates Ooyala with Rails

Installation

Add the following to your application's Gemfile:

gem 'ooyala-rails'

source 'https://rails-assets.org' do
  gem 'rails-assets-jquery-ooyala'
end

And then execute:

$ bundle

Configure an initialiser like so:

# config/initializers/ooyala.rb
Ooyala::Rails.configure do |c|
  c.api_key        = 'API_KEY_GOES_HERE'    # required
  c.secret_key     = 'SECRET_KEY_GOES_HERE' # required
  c.player_id      = 'PLAYER_ID_GOES_HERE'  # optional (see below)
  c.player_options = {autoplay: false}      # optional
end

Ideally, use ENV variables instead of storing your credentials in version control.

Usage

There are two modes of use:

1. Standard

  1. Render the JS:
<!-- using configured player_id -->
<%= ooyala_js %>

<!-- specifying player_id -->
<%= ooyala_js player_id: 'PLAYER_ID_GOES_HERE' %>
  1. Render the player(s):
<!-- using configured player_id and default player options -->
<%= ooyala_player 'your_embed_code' %>

<!-- specifying player_id and player options  -->
<%= ooyala_player 'your_embed_code', player_id: 'PLAYER_ID_GOES_HERE', options: {autoplay: true} %>

2. Using jQuery

  1. Add the jquery-ooyala library to application.js:
//= require jquery-ooyala
  1. Render the players using the same arguments as with standard but using a different method:
<!-- using configured player_id and default player options -->
<%= jquery_ooyala_player 'your_embed_code' %>

<!-- specifying player_id and player options  -->
<%= jquery_ooyala_player 'your_embed_code', player_id: 'PLAYER_ID_GOES_HERE', options: {autoplay: true} %>

See jquery-ooyala documentation more functionality.

CSS

The generated container <div> will require some basic CSS, eg:

.oo-player { width:480px; height:360px; }