Sha256: 0b04630f2c56714ddcd89d3c691f0a8210aeec4ce28818edef3cf9f1d80d3782

Contents?: true

Size: 921 Bytes

Versions: 1

Compression:

Stored size: 921 Bytes

Contents

module Onebox
  module Engine
    class WistiaOnebox
      include Engine
      include StandardEmbed

      matches_regexp(/https?:\/\/(.+)?(wistia.com|wi.st)\/(medias|embed)\/.*/)
      always_https

      def placeholder_html
        tw = get_twitter
        escaped_src = ::Onebox::Helpers.normalize_url_for_output(tw[:image])
        "<img src='#{escaped_src}' height='#{tw[:player_height]}' #{Helpers.title_attr(tw)}>"
      end

      def to_html
        tw = get_twitter
        src = tw[:url].gsub("?twitter=true", "")
        escaped_src = ::Onebox::Helpers.normalize_url_for_output(src)

        <<-HTML
          <iframe src="#{escaped_src}"
                  width="640"
                  height="360"
                  scrolling="no"
                  frameborder="0"
                  allowtransparency="true"
                  allowfullscreen>
          </iframe>
        HTML
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.8.35 lib/onebox/engine/wistia_onebox.rb