ooyala-rails 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1d987f62114f1a976416b2b475ce3ffce2047c29
4
+ data.tar.gz: ad9daab804c70c0dae62e3d5e24612d2ddbe4995
5
+ SHA512:
6
+ metadata.gz: d0d28a39e22a8c4d8468cfbc982db85dc0d3808e7d76733124e3be3822e56fee59bcf23b02a819b0754ff2abb9b6b51f37ea0ced3580a81f87170f33dc778d34
7
+ data.tar.gz: 478a07b9d524a2316cd508ea38f7d7e785b082b0416ce04d38ed492c6503a7e7c9b7a94b4916ed383ccc3199c5825d3ebf454edbd33f8c44ebfa5f73b43d39a9
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ooyala-rails.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # Ooyala::Rails
2
+
3
+ Integrates Ooyala with Rails
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'ooyala-rails'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Configure an initialiser like so:
18
+
19
+ ```ruby
20
+ # config/initializers/ooyala.rb
21
+ Ooyala::Rails.configure do |c|
22
+ c.api_key = 'API_KEY_GOES_HERE' # required
23
+ c.secret_key = 'SECRET_KEY_GOES_HERE' # required
24
+ c.player_id = 'PLAYER_ID_GOES_HERE' # optional (see below)
25
+ c.player_options = {autoplay: false} # optional
26
+ end
27
+ ```
28
+
29
+ Ideally, use ENV variables instead of storing your credentials in version control.
30
+
31
+ ## Usage
32
+
33
+ To render a player:
34
+
35
+ ```erb
36
+ <%= ooyala_player 'your_embed_code' %>
37
+ ```
38
+
39
+ This only works when `player_id` is configured.
40
+
41
+ To specify `player_id`:
42
+
43
+ ```erb
44
+ <%= ooyala_player 'your_embed_code', player_id: 'PLAYER_ID_GOES_HERE' %>
45
+ ```
46
+
47
+ To add/override player options:
48
+
49
+ ```erb
50
+ <%= ooyala_player 'your_embed_code', options: {autoplay: true} %>
51
+ ```
52
+
53
+ The generated container `<div>` will require some basic CSS, eg:
54
+
55
+ ```css
56
+ div.ooyala-player { width:480px; height:360px; }
57
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,16 @@
1
+ module OoyalaHelper
2
+ # Renders Ooyala player
3
+ def ooyala_player(embed_code,
4
+ div_id: embed_code,
5
+ player_id: Ooyala::Rails.config.player_id,
6
+ options: Ooyala::Rails.config.player_options || {})
7
+ @loaded_ooyala_js ||= Set.new
8
+ render('ooyala_player',
9
+ embed_code: embed_code,
10
+ div_id: div_id,
11
+ player_id: player_id,
12
+ options: options).tap do |_|
13
+ @loaded_ooyala_js << player_id
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ <% unless @loaded_ooyala_js.include?(player_id) %>
2
+ <script src="http://player.ooyala.com/v3/<%= player_id %>"></script>
3
+ <% end %>
4
+ <div class="ooyala-player" id="<%= div_id %>"></div>
5
+ <script type="text/javascript" charset="utf-8">
6
+ OO.ready(function() {
7
+ window.player = OO.Player.create('<%= div_id %>', '<%= embed_code %>', <%= options.to_json %>);
8
+ });
9
+ </script>
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ooyala/rails"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,23 @@
1
+ require 'ooyala/rails/version'
2
+
3
+ module Ooyala
4
+ module Rails
5
+ def self.config
6
+ @config ||= Config.new
7
+ end
8
+
9
+ def self.configure
10
+ yield config
11
+ end
12
+
13
+ class Config
14
+ attr_accessor :api_key
15
+ attr_accessor :player_id
16
+ attr_accessor :player_options
17
+ attr_accessor :secret_key
18
+ end
19
+
20
+ class Engine < ::Rails::Engine
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ module Ooyala
2
+ module Rails
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ooyala/rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'ooyala-rails'
8
+ spec.version = Ooyala::Rails::VERSION
9
+ spec.authors = ["Zubin Henner"]
10
+ spec.email = ['zubin@rubidium.com.au']
11
+
12
+ spec.summary = "Integrates Ooyala with Rails"
13
+ spec.homepage = 'https://github.com/zubin/ooyala-rails'
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
16
+ spec.bindir = "exe"
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_dependency 'rails', '>= 4'
21
+ spec.add_dependency 'ooyala-v2-api'
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.10'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ooyala-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Zubin Henner
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-11-04 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '4'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: ooyala-v2-api
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.10'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '10.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '10.0'
69
+ description:
70
+ email:
71
+ - zubin@rubidium.com.au
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".travis.yml"
78
+ - Gemfile
79
+ - README.md
80
+ - Rakefile
81
+ - app/helpers/ooyala_helper.rb
82
+ - app/views/application/_ooyala_player.html.erb
83
+ - bin/console
84
+ - bin/setup
85
+ - lib/ooyala/rails.rb
86
+ - lib/ooyala/rails/version.rb
87
+ - ooyala-rails.gemspec
88
+ homepage: https://github.com/zubin/ooyala-rails
89
+ licenses: []
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.4.7
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Integrates Ooyala with Rails
111
+ test_files: []