Sha256: 1db17bad5e678c10b25ecc0fffa1b19051ec35ffa620bfcc8c901b1e24256da7
Contents?: true
Size: 461 Bytes
Versions: 8
Compression:
Stored size: 461 Bytes
Contents
module Onebox module Engine class AudioOnebox include Engine matches_regexp(/^(https?:)?\/\/.*\.(mp3|ogg|wav|m4a)(\?.*)?$/i) def always_https? WhitelistedGenericOnebox.host_matches(uri, WhitelistedGenericOnebox.https_hosts) end def to_html url = ::Onebox::Helpers.normalize_url_for_output(@url) "<audio controls><source src='#{url}'><a href='#{url}'>#{url}</a></audio>" end end end end
Version data entries
8 entries across 8 versions & 1 rubygems