Sha256: 4761935b8f2cd02437b33df7657a352c1c23949a4f9d60cb948d12b8bafee45e

Contents?: true

Size: 427 Bytes

Versions: 40

Compression:

Stored size: 427 Bytes

Contents

module Onebox
  module Engine
    class VideoOnebox
      include Engine

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

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

      def to_html
        "<video width='100%' height='100%' controls><source src='#{@url}'><a href='#{@url}'>#{@url}</a></video>"
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
onebox-1.6.5 lib/onebox/engine/video_onebox.rb
onebox-1.6.4 lib/onebox/engine/video_onebox.rb
onebox-1.6.3 lib/onebox/engine/video_onebox.rb
onebox-1.6.2 lib/onebox/engine/video_onebox.rb
onebox-1.6.1 lib/onebox/engine/video_onebox.rb
onebox-1.6.0 lib/onebox/engine/video_onebox.rb
onebox-1.5.65 lib/onebox/engine/video_onebox.rb
onebox-1.5.64 lib/onebox/engine/video_onebox.rb
onebox-1.5.63 lib/onebox/engine/video_onebox.rb
onebox-1.5.62 lib/onebox/engine/video_onebox.rb
onebox-1.5.61 lib/onebox/engine/video_onebox.rb
onebox-1.5.60 lib/onebox/engine/video_onebox.rb
onebox-1.5.50 lib/onebox/engine/video_onebox.rb
onebox-1.5.49 lib/onebox/engine/video_onebox.rb
onebox-1.5.48 lib/onebox/engine/video_onebox.rb
onebox-1.5.47 lib/onebox/engine/video_onebox.rb
onebox-1.5.45 lib/onebox/engine/video_onebox.rb
onebox-1.5.44 lib/onebox/engine/video_onebox.rb
onebox-1.5.43 lib/onebox/engine/video_onebox.rb
onebox-1.5.42 lib/onebox/engine/video_onebox.rb