Class: Onebox::Engine::VideoOnebox
- Inherits:
-
Object
- Object
- Onebox::Engine::VideoOnebox
show all
- Includes:
- Onebox::Engine
- Defined in:
- lib/onebox/engine/video_onebox.rb
Constant Summary
DEFAULT
Instance Attribute Summary
#errors, #options, #timeout, #uri, #url
Instance Method Summary
collapse
all_iframe_origins, engines, included, #initialize, origins_to_regexes
Instance Method Details
#placeholder_html ⇒ Object
#to_html ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/onebox/engine/video_onebox.rb', line 14
def to_html
if @url[/^https:\/\/www.dropbox.com\/s\//]
@url.sub!("https://www.dropbox.com", "https://dl.dropboxusercontent.com")
end
escaped_url = ::Onebox::Helpers.normalize_url_for_output(@url)
<<-HTML
<div class="onebox video-onebox">
<video width='100%' height='100%' controls #{@options[:disable_media_download_controls] ? 'controlslist="nodownload"' : ""}>
<source src='#{escaped_url}'>
<a href='#{escaped_url}'>#{@url}</a>
</video>
</div>
HTML
end
|