Sha256: eaf7eb554f42199f3645ff86824ac22669c1f4a2826c5c21548ded972f50f71b

Contents?: true

Size: 744 Bytes

Versions: 3

Compression:

Stored size: 744 Bytes

Contents

module Onebox
  module Engine
    class BandCampOnebox
      include Engine
      include StandardEmbed

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

      def placeholder_html
        og = get_opengraph
        "<img src='#{og[:image]}' height='#{og[:video_height]}' #{Helpers.title_attr(og)}>"
      end

      def to_html
        og = get_opengraph
        src = og[:video_secure_url] || og[:video]

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

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
onebox-1.7.2 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.7.1 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.7.0 lib/onebox/engine/bandcamp_onebox.rb