viddler 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/lib/viddler/version.rb +1 -1
- data/lib/viddler/video.rb +17 -2
- metadata +2 -2
data/History.txt
CHANGED
data/lib/viddler/version.rb
CHANGED
data/lib/viddler/video.rb
CHANGED
@@ -37,13 +37,28 @@ module Viddler
|
|
37
37
|
end
|
38
38
|
|
39
39
|
# Returns HTML code for video embedding.
|
40
|
-
def embed_code(
|
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
|
-
<
|
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.
|
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-
|
12
|
+
date: 2008-05-16 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|