Class: Video::Spike

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.match?(uri) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.match?(uri)
  (uri.host =~ /^(?:www\.)?spike\.com$/i) && (uri.path =~ /^\/video\/[^\/]+\/\d+/)
end

Instance Method Details

#assign(uri) ⇒ Object



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

def assign(uri)
  @key = uri.path.match(/^\/video\/[^\/]+\/(\d+)/)[1]
  @url = "http://www.spike.com/video/x/#{@key}"
end

#embed(style = nil) ⇒ Object



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

def embed(style = nil)
  %(<embed width="#{width(style)}" height="#{height(style)}" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip=#{@key}" allowfullscreen="true"></embed>)
end