Class: Video::DailyMotion
- Inherits:
-
Video
- Object
- Video
- Video::DailyMotion
- Defined in:
- lib/videoclip/videos/daily_motion.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.match?(uri) ⇒ Boolean
4 5 6 |
# File 'lib/videoclip/videos/daily_motion.rb', line 4 def self.match?(uri) (uri.host =~ /^(?:www\.)?dailymotion\.com$/i) && (uri.path =~ /\/video\/[^_]+_/) end |
Instance Method Details
#assign(uri) ⇒ Object
8 9 10 11 |
# File 'lib/videoclip/videos/daily_motion.rb', line 8 def assign(uri) @key = uri.path.match(/\/video\/([^_]+)_/)[1] @url = "http://www.dailymotion.com/video/#{@key}" end |
#embed(style = nil) ⇒ Object
13 14 15 |
# File 'lib/videoclip/videos/daily_motion.rb', line 13 def (style = nil) %(<object width="#{width(style)}" height="#{height(style)}"><param name="movie" value="http://www.dailymotion.com/swf/#{@key}" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://www.dailymotion.com/swf/#{@key}" type="application/x-shockwave-flash" width="#{width(style)}" height="#{height(style)}" allowFullScreen="true" allowScriptAccess="always"></embed></object>) end |