viddler 0.2.1 → 0.2.2

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.
@@ -1,3 +1,8 @@
1
+ == 0.2.2 2008-04-19
2
+
3
+ * 1 enhancement:
4
+ * Viddler::Video#embed_code method now can receive hash with options
5
+
1
6
  == 0.2.1 2008-04-19
2
7
 
3
8
  * 1 bug fix:
@@ -2,7 +2,7 @@ module Viddler #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -37,13 +37,28 @@ module Viddler
37
37
  end
38
38
 
39
39
  # Returns HTML code for video embedding.
40
- def embed_code(player_type='player', width=437, height=370)
40
+ def embed_code(options={})
41
+ options = {
42
+ :player_type => 'player',
43
+ :width => 437,
44
+ :height => 370,
45
+ :autoplay => 'f'
46
+ }.merge(options)
47
+
48
+ # get non flashvars from options
49
+ player_type = options.delete(:player_type)
50
+ width = options.delete(:width)
51
+ height = options.delete(:height)
52
+
53
+ flashvars = options.collect{|key,value| "#{key}=#{value}"}.join('&')
54
+
41
55
  html = <<CODE
42
56
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="#{width}" height="#{height}" id="viddlerplayer-#{self.id}">
43
57
  <param name="movie" value="http://www.viddler.com/#{player_type}/#{self.id}/" />
44
58
  <param name="allowScriptAccess" value="always" />
45
59
  <param name="allowFullScreen" value="true" />
46
- <embed src="http://www.viddler.com/#{player_type}/#{self.id}/" width="#{width}" height="#{height}" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddlerplayer-#{self.id}" >
60
+ <param name="flashvars" value="#{flashvars}" />
61
+ <embed src="http://www.viddler.com/#{player_type}/#{self.id}/" width="#{width}" height="#{height}" type="application/x-shockwave-flash" allowScriptAccess="always" flashvars="#{flashvars}" allowFullScreen="true" name="viddlerplayer-#{self.id}" >
47
62
  </embed>
48
63
  </object>'
49
64
  CODE
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viddler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Sabanin
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-04-19 00:00:00 +08:00
12
+ date: 2008-05-16 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15