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.44 lib/onebox/engine/audio_onebox.rb
onebox-1.5.43 lib/onebox/engine/audio_onebox.rb
onebox-1.5.42 lib/onebox/engine/audio_onebox.rb
onebox-1.5.41 lib/onebox/engine/audio_onebox.rb
onebox-1.5.40 lib/onebox/engine/audio_onebox.rb
onebox-1.5.39 lib/onebox/engine/audio_onebox.rb
onebox-1.5.38 lib/onebox/engine/audio_onebox.rb
onebox-1.5.37 lib/onebox/engine/audio_onebox.rb
onebox-1.5.36 lib/onebox/engine/audio_onebox.rb
onebox-1.5.35 lib/onebox/engine/audio_onebox.rb
onebox-1.5.34 lib/onebox/engine/audio_onebox.rb
onebox-1.5.33 lib/onebox/engine/audio_onebox.rb
onebox-1.5.32 lib/onebox/engine/audio_onebox.rb
onebox-1.5.31 lib/onebox/engine/audio_onebox.rb
onebox-1.5.30 lib/onebox/engine/audio_onebox.rb
onebox-1.5.29 lib/onebox/engine/audio_onebox.rb
onebox-1.5.28 lib/onebox/engine/audio_onebox.rb
onebox-1.5.27 lib/onebox/engine/audio_onebox.rb
onebox-1.5.26 lib/onebox/engine/audio_onebox.rb
onebox-1.5.25 lib/onebox/engine/audio_onebox.rb