mooktakim-acts_as_video_fu 1.3.2 → 1.3.12

Sign up to get free protection for your applications and to get access to all the features.
data/install.rb CHANGED
@@ -1 +1,2 @@
1
1
  # Install hook code here
2
+ #
@@ -3,7 +3,7 @@ module Mdarby
3
3
  module Acts_as_video_fu_helper
4
4
 
5
5
  def display_video(obj, width = 425)
6
- video_klass(obj).embed_html
6
+ video_klass(obj).embed_html(width)
7
7
  end
8
8
 
9
9
  def thumbnail_url(obj)
data/lib/you_tube.rb CHANGED
@@ -5,23 +5,32 @@ class YouTube
5
5
  default_params :output => 'xml'
6
6
 
7
7
  def initialize(obj)
8
- @clip_id = obj.video_url.split('?v=').last
8
+ @clip_id = obj.video_url.split('?v=').last.split('&').first
9
9
  @embed_url = "http://www.youtube.com/v/#{@clip_id}&hl=en&fs=1"
10
10
  @response = self.class.get("/feeds/api/videos/#{@clip_id}")
11
11
  end
12
12
 
13
+ def screen_ratio
14
+ height = @response["entry"]["media:group"]["media:thumbnail"][0]["height"].to_f
15
+ width = @response["entry"]["media:group"]["media:thumbnail"][0]["width"].to_f
16
+ height / width
17
+ end
18
+
13
19
  def thumbnail_url
14
- @response["entry"]["media:group"]["media:thumbnail"][0]["url"]
20
+ #@response["entry"]["media:group"]["media:thumbnail"][0]["url"]
21
+ "http://img.youtube.com/vi/#{@clip_id}/0.jpg"
15
22
  end
16
23
 
17
24
  def embed_html(width = 425)
18
- width = 524 if width.to_i < 1
19
- height = (width.to_i * 0.809411764705882).to_i
25
+ width = 425 if width.to_i < 1
26
+ height = (width.to_f * screen_ratio).to_i
20
27
  <<-END
21
- <object width="#{width}" height="#{height}">
28
+ <object width="#{width}" height="#{height}" style="z-index: 0; position: relative;">
22
29
  <param name="movie" value="#{@embed_url}" />
23
30
  <param name="allowFullScreen" value="true" />
24
- <embed src="#{@embed_url}" type="application/x-shockwave-flash" allowfullscreen="true" width="#{width}" height="#{height}" />
31
+ <param name="wmode" value="transparent" />
32
+ <param name="bgcolor" value="#FFFFFF" />
33
+ <embed src="#{@embed_url}" type="application/x-shockwave-flash" bgcolor="#FFFFFF" allowfullscreen="true" wmode="transparent" width="#{width}" height="#{height}" />
25
34
  </object>
26
35
  END
27
36
  end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mooktakim-acts_as_video_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.12
5
5
  platform: ruby
6
6
  authors:
7
+ - Mooktakim Ahmed
7
8
  - Matt Darby
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2009-03-15 00:00:00 -07:00
13
+ date: 2009-10-04 00:00:00 +01:00
13
14
  default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
@@ -23,7 +24,7 @@ dependencies:
23
24
  version: 0.3.1
24
25
  version:
25
26
  description: Rails plugin that easily allows you to show video streams on your site.
26
- email: matt@matt-darby.com
27
+ email: mooktakim@fluxter.co.uk
27
28
  executables: []
28
29
 
29
30
  extensions: []
@@ -44,9 +45,10 @@ files:
44
45
  - tasks/acts_as_video_fu_tasks.rake
45
46
  - test/acts_as_video_fu_test.rb
46
47
  - uninstall.rb
47
- has_rdoc: false
48
- homepage: http://github.com/mdarby/acts_as_video_fu/tree/master
49
- licenses:
48
+ has_rdoc: true
49
+ homepage: http://github.com/mooktakim/acts_as_video_fu/tree/master
50
+ licenses: []
51
+
50
52
  post_install_message:
51
53
  rdoc_options: []
52
54
 
@@ -69,7 +71,7 @@ requirements: []
69
71
  rubyforge_project:
70
72
  rubygems_version: 1.3.5
71
73
  signing_key:
72
- specification_version: 2
74
+ specification_version: 3
73
75
  summary: Rails plugin that easily allows you to show video streams on your site.
74
76
  test_files: []
75
77