Sha256: fed9bf4b0fdc6f66bdaf296a939fa4031bfd08d5f46881f4b9997cb8a62aa6a7

Contents?: true

Size: 982 Bytes

Versions: 21

Compression:

Stored size: 982 Bytes

Contents

AutoHtml.add_filter(:metacafe).with(:width => 440, :height => 272, :show_stats => false, :autoplay => false) do |text, options|
  text.gsub(/http:\/\/www\.metacafe\.com\/watch\/([A-Za-z0-9._%-]*)\/([A-Za-z0-9._%-]*)(\/)?/) do
    metacafe_id = $1
    metacafe_slug = $2
    width  = options[:width]
    height = options[:height]
    show_stats      = options[:show_stats] ? "showStats=yes" : "showStats=no"
    autoplay        = options[:autoplay] ? "autoPlay=yes" : "autoPlay=no"
    flash_vars = [show_stats, autoplay].join("|")

    %{<div style="background:#000000;width:#{width}px;height:#{height}px"><embed flashVars="playerVars=#{flash_vars}" src="http://www.metacafe.com/fplayer/#{metacafe_id}/#{metacafe_slug}.swf" width="#{width}" height="#{height}" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_#{metacafe_id}" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></div>}
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
auto_html-whistlerbrk-2.0.0.pre lib/auto_html/filters/metacafe.rb
auto_html-1.6.4 lib/auto_html/filters/metacafe.rb
auto_html-1.6.3 lib/auto_html/filters/metacafe.rb
auto_html-1.5.1.1 lib/auto_html/filters/metacafe.rb
auto_html-1.6.2 lib/auto_html/filters/metacafe.rb
auto_html-1.6.1 lib/auto_html/filters/metacafe.rb
auto_html-1.6.0 lib/auto_html/filters/metacafe.rb
auto_html-1.5.3 lib/auto_html/filters/metacafe.rb
auto_html-1.5.2 lib/auto_html/filters/metacafe.rb
auto_html-1.5.1 lib/auto_html/filters/metacafe.rb
auto_html-1.5.0 lib/auto_html/filters/metacafe.rb
marcosinger-auto_html-1.3.6 lib/auto_html/filters/metacafe.rb
auto_html-1.4.2 lib/auto_html/filters/metacafe.rb
auto_html-1.4.1 lib/auto_html/filters/metacafe.rb
auto_html-1.4.0 lib/auto_html/filters/metacafe.rb
auto_html-1.3.7 lib/auto_html/filters/metacafe.rb
marcosinger-auto_html-1.3.5 lib/auto_html/filters/metacafe.rb
marcosinger-auto_html-1.3.4 lib/auto_html/filters/metacafe.rb
auto_html-1.3.6 lib/auto_html/filters/metacafe.rb
auto_html-1.3.5 lib/auto_html/filters/metacafe.rb