ooyala-rails 0.3.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8271fc78f88ca0445e95108705d34e21a2ee7a2f
4
- data.tar.gz: 4ecb824ad782e3188522034e5c94b82dc4c1a973
3
+ metadata.gz: 5792782cd2c38b5510043fdc343b64ba4841baca
4
+ data.tar.gz: 0f5e96246c36fd8a1bf8e5a80a017571080ff249
5
5
  SHA512:
6
- metadata.gz: 6529597444b4508e4d90f00970c393388702baef26f365090b1d6e2c6cb06e490ca5879969f1583c7d55648bc63fef28f021866991d36a39894909ba316b0a6a
7
- data.tar.gz: 65ff9b19b174aa66f9859e590741ddefed0428008343761488305cb8caa9bd6c6ac513d35d25303e9553de4f209d10594b65cce3e3861d5ad10ff7daa1730b36
6
+ metadata.gz: 4a04e7c09b9ca29f7464027db7651910dc86ea7004dc5d12f1b919c9b1d2fbd558886c00a43648ff399540f52f341a52f739e22ca34ea9cdc30ecb1398ae1114
7
+ data.tar.gz: 55726c0ca08558109340504c7f2feaaea90675c6876e609053fe47d90dd25073b40c7880d01b686d855664374f1d5417e069878c65c2d3efa235209d9cb3e529
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source 'https://rubygems.org'
2
+ source 'https://rails-assets.org'
2
3
 
3
4
  # Specify your gem's dependencies in ooyala-rails.gemspec
4
5
  gemspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ooyala::Rails
2
2
 
3
- Integrates Ooyala with Rails
3
+ Integrates [Ooyala](http://www.ooyala.com/) with Rails
4
4
 
5
5
  ## Installation
6
6
 
@@ -30,7 +30,11 @@ Ideally, use ENV variables instead of storing your credentials in version contro
30
30
 
31
31
  ## Usage
32
32
 
33
- First, render the JS:
33
+ There are two modes of use:
34
+
35
+ ### 1. Standard
36
+
37
+ 1. Render the JS:
34
38
 
35
39
  ```erb
36
40
  <!-- using configured player_id -->
@@ -40,7 +44,7 @@ First, render the JS:
40
44
  <%= ooyala_js player_id: 'PLAYER_ID_GOES_HERE' %>
41
45
  ```
42
46
 
43
- Next, render your player(s):
47
+ 2. Render the player(s):
44
48
 
45
49
  ```erb
46
50
  <!-- using configured player_id and default player options -->
@@ -50,8 +54,30 @@ Next, render your player(s):
50
54
  <%= ooyala_player 'your_embed_code', player_id: 'PLAYER_ID_GOES_HERE', options: {autoplay: true} %>
51
55
  ```
52
56
 
57
+ ### 2. Using jQuery
58
+
59
+ 1. Add the [jquery-ooyala](https://www.npmjs.com/package/jquery-ooyala) library to `application.js`:
60
+
61
+ ```javascript
62
+ //= require jquery-ooyala
63
+ ```
64
+
65
+ 2. Render the players using the same arguments as with standard but using a different method:
66
+
67
+ ```erb
68
+ <!-- using configured player_id and default player options -->
69
+ <%= jquery_ooyala_player 'your_embed_code' %>
70
+
71
+ <!-- specifying player_id and player options -->
72
+ <%= jquery_ooyala_player 'your_embed_code', player_id: 'PLAYER_ID_GOES_HERE', options: {autoplay: true} %>
73
+ ```
74
+
75
+ See [jquery-ooyala](https://www.npmjs.com/package/jquery-ooyala) documentation more functionality.
76
+
77
+ ## CSS
78
+
53
79
  The generated container `<div>` will require some basic CSS, eg:
54
80
 
55
81
  ```css
56
- div.ooyala-player { width:480px; height:360px; }
82
+ .oo-player { width:480px; height:360px; }
57
83
  ```
@@ -1,4 +1,19 @@
1
1
  module OoyalaHelper
2
+ # Renders Ooyala player with jQuery plugin: https://www.npmjs.com/package/jquery-ooyala
3
+ def jquery_ooyala_player(embed_code,
4
+ div_id: embed_code,
5
+ player_id: default_ooyala_player_id,
6
+ options: default_ooyala_player_options)
7
+ content_tag(:div,
8
+ '',
9
+ id: div_id,
10
+ class: 'oo-player',
11
+ data: {
12
+ player_id: player_id,
13
+ content_id: embed_code,
14
+ })
15
+ end
16
+
2
17
  # Generates Ooyala player JS
3
18
  def ooyala_js(player_id: default_ooyala_player_id)
4
19
  javascript_include_tag "//player.ooyala.com/v3/#{player_id}"
@@ -1,4 +1,4 @@
1
- <div class="ooyala-player" id="<%= div_id %>"></div>
1
+ <div class="oo-player" id="<%= div_id %>"></div>
2
2
  <script type="text/javascript" charset="utf-8">
3
3
  OO.ready(function() {
4
4
  window.player = OO.Player.create('<%= div_id %>', '<%= embed_code %>', <%= options %>);
@@ -1,5 +1,5 @@
1
1
  module Ooyala
2
2
  module Rails
3
- VERSION = '0.3.3'
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.add_dependency 'rails', '>= 4'
21
21
  spec.add_dependency 'ooyala-v2-api'
22
+ spec.add_dependency 'rails-assets-jquery-ooyala'
22
23
 
23
24
  spec.add_development_dependency 'bundler', '~> 1.10'
24
25
  spec.add_development_dependency 'rake', '~> 10.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ooyala-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zubin Henner
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails-assets-jquery-ooyala
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bundler
43
57
  requirement: !ruby/object:Gem::Requirement