Class: EmbeddedURL::Vimeo

Inherits:
Object
  • Object
show all
Defined in:
lib/embedded_url/vimeo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Vimeo

Returns a new instance of Vimeo.



6
7
8
# File 'lib/embedded_url/vimeo.rb', line 6

def initialize(url)
  self.url = url
end

Instance Attribute Details

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/embedded_url/vimeo.rb', line 4

def url
  @url
end

Instance Method Details

#to_embeddedObject



10
11
12
13
14
15
# File 'lib/embedded_url/vimeo.rb', line 10

def to_embedded
  if url =~ /vimeo\.com/
    video_id = url.split("/").last
    "<object type=\"application/x-shockwave-flash\" width=\"400\" height=\"300\" data=\"http://vimeo.com/moogaloop.swf?clip_id=#{video_id}&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF\"><param name=\"quality\" value=\"best\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"allowfullscreen\" value=\"true\" /><param name=\"scale\" value=\"showAll\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id=#{video_id}&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF\" /><embed src=\"http://www.vimeo.com/moogaloop.swf?clip_id=#{video_id}&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"400\" height=\"300\"></embed></object>"      
  end
end