Sha256: 73cd71ee991ef94bb34da42b6e57eb883d2499465687f41419685733f9c10b7f

Contents?: true

Size: 910 Bytes

Versions: 83

Compression:

Stored size: 910 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
        escaped_src = ::Onebox::Helpers.normalize_url_for_output(og[:image])
        "<img src='#{escaped_src}' height='#{og[:video_height]}' #{Helpers.title_attr(og)}>"
      end

      def to_html
        og = get_opengraph
        src = og[:video_secure_url] || og[:video]
        escaped_src = ::Onebox::Helpers.normalize_url_for_output(src)

        <<-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

83 entries across 83 versions & 1 rubygems

Version Path
onebox-1.8.79 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.78 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.77 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.76 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.75 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.74 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.73 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.72 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.71 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.70 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.69 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.68 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.67 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.66 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.65 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.64 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.63 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.62 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.61 lib/onebox/engine/bandcamp_onebox.rb
onebox-1.8.60 lib/onebox/engine/bandcamp_onebox.rb