embeddable 0.0.5 → 0.0.6

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: 2e6a010ead8a00d7bfa9abe89edb88c156edfe44
4
- data.tar.gz: 431d433dc5289ac8ad37726d085e7aa4ec1f99b7
3
+ metadata.gz: 8059f99473e0a02ab6ce11f3f0b5984e6983f61c
4
+ data.tar.gz: ac11c09418a66f3cf9196be49bf46cab659c0080
5
5
  SHA512:
6
- metadata.gz: 848c0f5fc61d403109439fa58c3132ed3bf979d02a01b6fc29036c58e1da52a8fe92afe4ee8f71c45dfbf091eb873c79e6efa22b6cc7a4de7a12550b75fe311e
7
- data.tar.gz: c89fe8f834ad7aa5db1bd3b5f4d5c1cf62a8b64a4b799e334464b41c707ad4117f4ef8069e046c108e43b4d54188818733a456f013c633216862f8eff86a6036
6
+ metadata.gz: 722cc79c9f8ffe438767855514be3ac3c00da45105857d154204dcf8167132f16e6e9ef170088cae8845aa049d8126ce383acf7b8289be5f664994660392b892
7
+ data.tar.gz: b2e9b1f436d870057df169784245e5c9f4d26195ac375caaa75e8762234d2d5d2dbda733a605ec589b832746b2011a89babd438e857971d3e78515fdb5cab7ce
@@ -1,5 +1,6 @@
1
1
  require 'active_support/all'
2
2
  require 'embeddable/version'
3
+ require 'embeddable/railtie' if defined?(Rails)
3
4
 
4
5
  module Embeddable
5
6
  extend ActiveSupport::Concern
@@ -19,7 +20,8 @@ module Embeddable
19
20
  %r{^https?://(?:www\.)?veoh\.com/watch/([^\?]+)},
20
21
  ],
21
22
  vippy: [
22
- %r{https:\/\/vippy.co\/play\/.+\/([^\?\s]+)"}
23
+ %r{https:\/\/vippy.co\/play\/.+\/([^\?\s]+)"},
24
+ %r{https:\/\/vippy.co\/play\/flash\/watch\/([^\?]+)}
23
25
  ],
24
26
  liveleak: [
25
27
  %r{^https?://(?:www\.)?liveleak\.com/view\?i=([^\?]+)},
@@ -0,0 +1,15 @@
1
+ require 'embeddable/view_helpers'
2
+
3
+ module Embeddable
4
+ class Railtie < Rails::Railtie
5
+ initializer "embeddable.view_helpers" do
6
+ ActionView::Base.send :include, ViewHelpers
7
+ end
8
+
9
+ initializer 'embeddable.add_view_paths', :after => :add_view_paths do |app|
10
+ ActiveSupport.on_load(:action_controller) do
11
+ append_view_path "#{Gem.loaded_specs['embeddable'].full_gem_path}/views"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Embeddable
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -0,0 +1,22 @@
1
+ module ViewHelpers
2
+ def embed_video(embeddable, width, height)
3
+ attributes = { id: embeddable.video_id, width: width, height: height }
4
+
5
+ if embeddable.video_on_youtube?
6
+ render 'embeddable/partials/youtube', attributes
7
+ elsif embeddable.video_on_vimeo?
8
+ render 'embeddable/partials/vimeo', attributes
9
+ elsif embeddable.video_on_dailymotion?
10
+ render 'embeddable/partials/dailymotion', attributes
11
+ elsif embeddable.video_on_veoh?
12
+ render 'embeddable/partials/veoh', attributes
13
+ elsif embeddable.video_on_vippy?
14
+ render 'embeddable/partials/vippy', attributes
15
+ elsif embeddable.video_on_liveleak?
16
+ # not supported
17
+ link_to embeddable.url, embeddable.url
18
+ else
19
+ link_to embeddable.url, embeddable.url
20
+ end
21
+ end
22
+ end
@@ -0,0 +1 @@
1
+ <iframe width="<%= width %>" height="<%= height %>" src="//www.dailymotion.com/embed/video/<%= id %>" frameborder="0" allowfullscreen webkitallowfullscreen mozillowfullscreen></iframe>
@@ -0,0 +1,6 @@
1
+ <object width="<%= width %>" height="<%= height %>" id="veohFlashPlayer" name="veohFlashPlayer">
2
+ <param name="movie" value="http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1446&permalinkId=<%= id %>&player=videodetailsembedded&videoAutoPlay=0&id=anonymous"></param>
3
+ <param name="allowFullScreen" value="true"></param>
4
+ <param name="allowscriptaccess" value="always"></param>
5
+ <embed src="http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1446&permalinkId=<%= id %>&player=videodetailsembedded&videoAutoPlay=0&id=anonymous" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="<%= width %>" height="<%= height %>" id="veohFlashPlayerEmbed" name="veohFlashPlayerEmbed"></embed>
6
+ </object>
@@ -0,0 +1 @@
1
+ <iframe width="<%= width %>" height="<%= height %>" src="//player.vimeo.com/video/<%= id %>" frameborder="0" allowfullscreen webkitallowfullscreen mozillowfullscreen></iframe>
@@ -0,0 +1,16 @@
1
+ <div itemscope itemtype="http://schema.org/VideoObject" class="vippy-video" style="width: <%= width %>; height: <%= height %>;">
2
+ <meta itemprop="thumbnailURL" content="https://vippy.co/play/image/<%= id %>" />
3
+ <meta itemprop="embedUrl" content="https://vippy.co/play/flash/watch/<%= id %>" />
4
+ <meta itemprop="width" content="<%= width %>" />
5
+ <meta itemprop="height" content="<%= height %>" />
6
+ <object class="vippy-video-object" type="application/x-shockwave-flash" data="https://vippy.co/play/flash/watch/<%= id %>" width="<%= width %>" height="<%= height %>">
7
+ <param name="player" value="https://vippy.co/play/flash/watch/<%= id %>" />
8
+ <param name="allowScriptAccess" value="always" />
9
+ <param name="allowFullScreen" value="true" />
10
+ <param name="wmode" value="direct" />
11
+ <param name="movie" value="https://vippy.co/play/flash/watch/<%= id %>" />
12
+ <video style="position: absolute; top: 0px; left: 0px;" class="vippy-video-object" width="<%= width %>" height="<%= height %>" preload="none" controls="controls" poster="https://vippy.co/play/image/<%= id %>">
13
+ <source src="https://vippy.co/play/mobile/watch/<%= id %>" />
14
+ </video>
15
+ </object>
16
+ </div>
@@ -0,0 +1 @@
1
+ <iframe width="<%= width %>" height="<%= height %>" src="//www.youtube.com/embed/<%= id %>" frameborder="0" allowfullscreen webkitallowfullscreen mozillowfullscreen></iframe>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embeddable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Gorset
@@ -9,62 +9,62 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-05 00:00:00.000000000 Z
12
+ date: 2014-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '4.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '4.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ~>
33
33
  - !ruby/object:Gem::Version
34
34
  version: '1.3'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ~>
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.3'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - '>='
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ">="
53
+ - - '>='
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ">="
60
+ - - '>='
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ">="
67
+ - - '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  description: Embeddable makes it easier to embed videos.
@@ -75,17 +75,24 @@ executables: []
75
75
  extensions: []
76
76
  extra_rdoc_files: []
77
77
  files:
78
- - ".gitignore"
79
- - ".travis.yml"
78
+ - .gitignore
79
+ - .travis.yml
80
80
  - Gemfile
81
81
  - MIT-LICENSE.md
82
82
  - README.md
83
83
  - Rakefile
84
84
  - embeddable.gemspec
85
85
  - lib/embeddable.rb
86
+ - lib/embeddable/railtie.rb
86
87
  - lib/embeddable/version.rb
88
+ - lib/embeddable/view_helpers.rb
87
89
  - spec/lib/embeddable_spec.rb
88
90
  - spec/spec_helper.rb
91
+ - views/embeddable/partials/_dailymotion.html.erb
92
+ - views/embeddable/partials/_veoh.html.erb
93
+ - views/embeddable/partials/_vimeo.html.erb
94
+ - views/embeddable/partials/_vippy.html.erb
95
+ - views/embeddable/partials/_youtube.html.erb
89
96
  homepage: http://github.com/hyperoslo/embeddable
90
97
  licenses:
91
98
  - MIT
@@ -96,17 +103,17 @@ require_paths:
96
103
  - lib
97
104
  required_ruby_version: !ruby/object:Gem::Requirement
98
105
  requirements:
99
- - - ">="
106
+ - - '>='
100
107
  - !ruby/object:Gem::Version
101
108
  version: '0'
102
109
  required_rubygems_version: !ruby/object:Gem::Requirement
103
110
  requirements:
104
- - - ">="
111
+ - - '>='
105
112
  - !ruby/object:Gem::Version
106
113
  version: '0'
107
114
  requirements: []
108
115
  rubyforge_project:
109
- rubygems_version: 2.2.0
116
+ rubygems_version: 2.0.6
110
117
  signing_key:
111
118
  specification_version: 4
112
119
  summary: Embeddable makes it easier to embed videos.