ooyala-rails 0.3.2 → 0.3.3
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 +4 -4
- data/README.md +14 -14
- data/app/helpers/ooyala_helper.rb +17 -12
- data/app/views/application/_ooyala_player.html.erb +1 -4
- data/lib/ooyala/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8271fc78f88ca0445e95108705d34e21a2ee7a2f
|
4
|
+
data.tar.gz: 4ecb824ad782e3188522034e5c94b82dc4c1a973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6529597444b4508e4d90f00970c393388702baef26f365090b1d6e2c6cb06e490ca5879969f1583c7d55648bc63fef28f021866991d36a39894909ba316b0a6a
|
7
|
+
data.tar.gz: 65ff9b19b174aa66f9859e590741ddefed0428008343761488305cb8caa9bd6c6ac513d35d25303e9553de4f209d10594b65cce3e3861d5ad10ff7daa1730b36
|
data/README.md
CHANGED
@@ -30,25 +30,25 @@ Ideally, use ENV variables instead of storing your credentials in version contro
|
|
30
30
|
|
31
31
|
## Usage
|
32
32
|
|
33
|
-
|
33
|
+
First, render the JS:
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
```erb
|
36
|
+
<!-- using configured player_id -->
|
37
|
+
<%= ooyala_js %>
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
<!-- specifying player_id -->
|
40
|
+
<%= ooyala_js player_id: 'PLAYER_ID_GOES_HERE' %>
|
41
|
+
```
|
42
42
|
|
43
|
-
|
44
|
-
<%= ooyala_player 'your_embed_code', player_id: 'PLAYER_ID_GOES_HERE' %>
|
45
|
-
```
|
43
|
+
Next, render your player(s):
|
46
44
|
|
47
|
-
|
45
|
+
```erb
|
46
|
+
<!-- using configured player_id and default player options -->
|
47
|
+
<%= ooyala_player 'your_embed_code' %>
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
<!-- specifying player_id and player options -->
|
50
|
+
<%= ooyala_player 'your_embed_code', player_id: 'PLAYER_ID_GOES_HERE', options: {autoplay: true} %>
|
51
|
+
```
|
52
52
|
|
53
53
|
The generated container `<div>` will require some basic CSS, eg:
|
54
54
|
|
@@ -1,16 +1,21 @@
|
|
1
1
|
module OoyalaHelper
|
2
|
+
# Generates Ooyala player JS
|
3
|
+
def ooyala_js(player_id: default_ooyala_player_id)
|
4
|
+
javascript_include_tag "//player.ooyala.com/v3/#{player_id}"
|
5
|
+
end
|
6
|
+
|
2
7
|
# Renders Ooyala player
|
3
|
-
def ooyala_player(embed_code,
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
def ooyala_player(embed_code, div_id: embed_code, options: default_ooyala_player_options)
|
9
|
+
render 'ooyala_player', embed_code: embed_code, div_id: div_id, options: options.to_json.html_safe
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def default_ooyala_player_id
|
15
|
+
Ooyala::Rails.config.player_id
|
16
|
+
end
|
17
|
+
|
18
|
+
def default_ooyala_player_options
|
19
|
+
Ooyala::Rails.config.player_options || {}
|
15
20
|
end
|
16
21
|
end
|
@@ -1,9 +1,6 @@
|
|
1
|
-
<% unless @loaded_ooyala_js.include?(player_id) %>
|
2
|
-
<script src="http://player.ooyala.com/v3/<%= player_id %>"></script>
|
3
|
-
<% end %>
|
4
1
|
<div class="ooyala-player" id="<%= div_id %>"></div>
|
5
2
|
<script type="text/javascript" charset="utf-8">
|
6
3
|
OO.ready(function() {
|
7
|
-
window.player = OO.Player.create('<%= div_id %>', '<%= embed_code %>', <%=
|
4
|
+
window.player = OO.Player.create('<%= div_id %>', '<%= embed_code %>', <%= options %>);
|
8
5
|
});
|
9
6
|
</script>
|
data/lib/ooyala/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ooyala-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zubin Henner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|