Sha256: e4d4afb82c485370d8ca0b3d33cbc838181def292907c770b5f4747d89a4a97b

Contents?: true

Size: 489 Bytes

Versions: 8

Compression:

Stored size: 489 Bytes

Contents

module Onebox
  module Engine
    class VideoOnebox
      include Engine

      matches_regexp(/^(https?:)?\/\/.*\.(mov|mp4|webm|ogv)(\?.*)?$/i)

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

      def to_html
        url = ::Onebox::Helpers.normalize_url_for_output(@url)
        "<video width='100%' height='100%' controls><source src='#{url}'><a href='#{url}'>#{url}</a></video>"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
onebox-1.7.3 lib/onebox/engine/video_onebox.rb
onebox-1.7.2 lib/onebox/engine/video_onebox.rb
onebox-1.7.1 lib/onebox/engine/video_onebox.rb
onebox-1.7.0 lib/onebox/engine/video_onebox.rb
onebox-1.6.9 lib/onebox/engine/video_onebox.rb
onebox-1.6.8 lib/onebox/engine/video_onebox.rb
onebox-1.6.7 lib/onebox/engine/video_onebox.rb
onebox-1.6.6 lib/onebox/engine/video_onebox.rb