Sha256: c107b4e4d54bf03feb654b175fd8857a9f5204cf6f2cbd8885d4a2106f5f9d4b

Contents?: true

Size: 395 Bytes

Versions: 23

Compression:

Stored size: 395 Bytes

Contents

module Onebox
  module Engine
    class AudioOnebox
      include Engine

      matches_regexp /^(https?:)?\/\/.*\.(mp3|ogg|wav)(\?.*)?$/

      def always_https?
        WhitelistedGenericOnebox.host_matches(uri, WhitelistedGenericOnebox.https_hosts)
      end

      def to_html
        "<audio controls><source src='#{@url}'><a href='#{@url}'>#{@url}</a></audio>"
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
onebox-1.5.24 lib/onebox/engine/audio_onebox.rb
onebox-1.5.23 lib/onebox/engine/audio_onebox.rb
onebox-1.5.22 lib/onebox/engine/audio_onebox.rb