Sha256: b8dfdc06b45d2cb537534d74e0e02fea0870b3610ad99acfa9b8a10e55a9f5f3

Contents?: true

Size: 781 Bytes

Versions: 1

Compression:

Stored size: 781 Bytes

Contents

module Onebox
  module Engine
    class BandCampOnebox
      include Engine
      include StandardEmbed

      matches_regexp(/^https?:\/\/.*\.bandcamp\.com\/(album|track)\//)
      always_https

      def placeholder_html
        og = get_opengraph
        "<img src='#{og.image}' height='#{og.video_height}' #{og.title_attr}>"
      end

      def to_html
        og = get_opengraph
        escaped_src = og.video_secure_url || og.video

        <<-HTML
          <iframe src="#{escaped_src}"
                  width="#{og.video_width}"
                  height="#{og.video_height}"
                  scrolling="no"
                  frameborder="0"
                  allowfullscreen>
          </iframe>
        HTML
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
onebox-1.8.81 lib/onebox/engine/bandcamp_onebox.rb