Sha256: b7db1911171080306774761d27a4fdec9c418ee8b305b5a77e4fb043ee8fce14
Contents?: true
Size: 553 Bytes
Versions: 37
Compression:
Stored size: 553 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 escaped_url = ::Onebox::Helpers.normalize_url_for_output(@url) <<-HTML <audio controls> <source src="#{escaped_url}"> <a href="#{escaped_url}">#{@url}</a> </audio> HTML end end end end
Version data entries
37 entries across 37 versions & 1 rubygems