Class: Gollum::Macro::Video

Inherits:
Gollum::Macro show all
Defined in:
lib/gollum-lib/macro/video.rb

Instance Method Summary collapse

Methods inherited from Gollum::Macro

#initialize, instance

Constructor Details

This class inherits a constructor from Gollum::Macro

Instance Method Details

#render(fname, auto = false) ⇒ Object



4
5
6
7
8
# File 'lib/gollum-lib/macro/video.rb', line 4

def render(fname, auto=false)
  escaped_fname = CGI.escapeHTML(fname)
  properties = auto ? "autoplay='true' playsinline='true' muted='true' loop='true'" : "controls='true'"
  "<video width='100%' height='100%' src='#{escaped_fname}' #{properties}>HTML5 video is not supported on this browser.</video>"
end