Class: Video::LiveLeak

Inherits:
Video
  • Object
show all
Defined in:
lib/videoclip/videos/live_leak.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.match?(uri) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/videoclip/videos/live_leak.rb', line 4

def self.match?(uri)
  (uri.host =~ /^(?:www\.)?liveleak\.com$/i) && (uri.path == '/view') && !CGI.parse(uri.query)['i'].blank?
end

Instance Method Details

#assign(uri) ⇒ Object



8
9
10
11
# File 'lib/videoclip/videos/live_leak.rb', line 8

def assign(uri)
  @key = CGI.parse(uri.query)['i'].first
  @url = "http://www.liveleak.com/view?i=#{@key}"
end

#embed(style = nil) ⇒ Object



13
14
15
# File 'lib/videoclip/videos/live_leak.rb', line 13

def embed(style = nil)
  %(<object width="#{width(style)}" height="#{height(style)}"><param name="movie" value="http://www.liveleak.com/e/#{@key}"></param><param name="wmode" value="transparent"></param><embed src="http://www.liveleak.com/e/#{@key}" type="application/x-shockwave-flash" wmode="transparent" width="#{width(style)}" height="#{height(style)}"></embed></object>)
end