Sha256: c49c368cc4aafd4329190f29d95e0b21b297df7173599d13b1dddd06eb5a4f35
Contents?: true
Size: 734 Bytes
Versions: 20
Compression:
Stored size: 734 Bytes
Contents
AutoHtml.add_filter(:youtube_js_api).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}?enablejsapi=1&playerapiid=ytplayer"></param><param name="wmode" value="transparent"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/#{youtube_id}?enablejsapi=1&playerapiid=ytplayer" type="application/x-shockwave-flash" wmode="transparent" width="#{options[:width]}" height="#{options[:height]}" allowscriptaccess="always"></embed></object>} end end
Version data entries
20 entries across 20 versions & 3 rubygems