Sha256: 24f331877d274b3f415d5b96aff1d856f46290f99a7bb8e5fcc936b83f80c053

Contents?: true

Size: 749 Bytes

Versions: 9

Compression:

Stored size: 749 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

9 entries across 9 versions & 1 rubygems

Version Path
onebox-1.8.89 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.88 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.87 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.86 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.85 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.84 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.83 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.82 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.80 lib/onebox/engine/bandcamp_onebox.rb