Sha256: 256636207e9cfb49f292a2afb6ce945ee8dc8ea4e15bf51a3ac8a576867a44db

Contents?: true

Size: 746 Bytes

Versions: 4

Compression:

Stored size: 746 Bytes

Contents

AutoHtml.add_filter(:dailymotion).with(:width => 480, :height => 360) do |text, options|
  text.gsub(/http:\/\/www\.dailymotion\.com.*\/video\/(.+)_*/) do
    video_id = $1
    %{<object type="application/x-shockwave-flash" data="http://www.dailymotion.com/swf/#{video_id}&related=0" width="#{options[:width]}" height="#{options[:height]}"><param name="movie" value="http://www.dailymotion.com/swf/#{video_id}&related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><a href="http://www.dailymotion.com/video/#{video_id}?embed=1"><img src="http://www.dailymotion.com/thumbnail/video/#{video_id}" width="#{options[:width]}" height="#{options[:height]}"/></a></object>}
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
auto_html-1.6.4 lib/auto_html/filters/dailymotion.rb
auto_html-1.6.3 lib/auto_html/filters/dailymotion.rb
auto_html-1.6.2 lib/auto_html/filters/dailymotion.rb
auto_html-1.6.1 lib/auto_html/filters/dailymotion.rb