Class: Onebox::Engine::VideoOnebox

Inherits:
Object
  • Object
show all
Includes:
Onebox::Engine
Defined in:
lib/onebox/engine/video_onebox.rb

Constant Summary

Constants included from Onebox::Engine

DEFAULT

Instance Attribute Summary

Attributes included from Onebox::Engine

#cache, #timeout, #uri, #url

Instance Method Summary collapse

Methods included from Onebox::Engine

engines, included, #initialize, #options, #options=, #placeholder_html

Instance Method Details

#always_https?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/onebox/engine/video_onebox.rb', line 8

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

#to_htmlObject



12
13
14
15
16
17
18
19
20
# File 'lib/onebox/engine/video_onebox.rb', line 12

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