Sha256: 6dc4d659e578682b8efbb252f78fd4d2776c9c7af2e8ccbc98dc6c6134cc06a4

Contents?: true

Size: 575 Bytes

Versions: 7

Compression:

Stored size: 575 Bytes

Contents

AutoHtml.add_filter(:youtube).with(:width => 390, :height => 250) do |text, options|
  text.gsub(/http:\/\/(www.)?youtube\.com\/watch\?v=([A-Za-z0-9._%-]*)(\&\S+)?/) do
    youtube_id = $2
    %{<object width="#{options[:width]}" height="#{options[:height]}"><param name="movie" value="http://www.youtube.com/v/#{youtube_id}"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/#{youtube_id}" type="application/x-shockwave-flash" wmode="transparent" width="#{options[:width]}" height="#{options[:height]}"></embed></object>}
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
dejan-auto_html-1.1.0 lib/auto_html/filters/youtube.rb
dejan-auto_html-1.1.1 lib/auto_html/filters/youtube.rb
dejan-auto_html-1.1.2 lib/auto_html/filters/youtube.rb
dejan-auto_html-1.2.0 lib/auto_html/filters/youtube.rb
galetahub-auto_html-1.0.1 lib/auto_html/filters/youtube.rb
auto_html-1.2.1 lib/auto_html/filters/youtube.rb
auto_html-1.2.0 lib/auto_html/filters/youtube.rb