Class: Foliokit::Overlay::OverlayVideo
- Inherits:
-
OverlayBase
- Object
- OverlayBase
- Foliokit::Overlay::OverlayVideo
- Defined in:
- lib/foliokit/overlay/overlay_video.rb
Instance Attribute Summary
Attributes inherited from OverlayBase
Instance Method Summary collapse
Methods inherited from OverlayBase
element_base, #initialize, #stateful?
Methods included from Modules::Element
Constructor Details
This class inherits a constructor from Foliokit::Overlay::OverlayBase
Instance Method Details
#export(document, options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/foliokit/overlay/overlay_video.rb', line 17 def export(document, = {}) node = super(document, ) # process youtube videos uri = Addressable::URI.parse(video_url) if uri.absolute? and uri.host =~ /(youtube)/ node["touchable"] = true node["data-type"] = "youtube" node["data-src"] = uri.to_s node["class"] = "overlay-webview" return node end node["src"] = package.store_asset(video_url) node["auto-start"] = auto_start node["loop"] = node["fullscreen"] = play_in_context ? false : true node["playsinline"] = "playsinline" if play_in_context node["controls"] = true if show_controls_by_default node["swipable"] = true node["touchable"] = true node end |
#tagname ⇒ Object
13 14 15 |
# File 'lib/foliokit/overlay/overlay_video.rb', line 13 def tagname "div" end |