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

Version Path
auto_html-1.5.1.1 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.5.3 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.5.2 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.5.1 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.5.0 lib/auto_html/filters/youtube_js_api.rb
marcosinger-auto_html-1.3.6 lib/auto_html/filters/youtube_js_api.rb
galetahub-auto_html-1.0.1 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.4.2 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.4.1 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.4.0 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.3.7 lib/auto_html/filters/youtube_js_api.rb
marcosinger-auto_html-1.3.5 lib/auto_html/filters/youtube_js_api.rb
marcosinger-auto_html-1.3.4 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.3.6 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.3.5 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.3.4 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.3.3 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.3.2 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.3.1 lib/auto_html/filters/youtube_js_api.rb
auto_html-1.3.0 lib/auto_html/filters/youtube_js_api.rb