Class: Preprocessor::Video::Default
- Inherits:
-
Object
- Object
- Preprocessor::Video::Default
- Includes:
- Utilities
- Defined in:
- lib/preprocessor/video.rb
Instance Attribute Summary collapse
-
#poster ⇒ Object
Returns the value of attribute poster.
-
#src ⇒ Object
Returns the value of attribute src.
Instance Method Summary collapse
-
#initialize(options) ⇒ Default
constructor
A new instance of Default.
- #tag ⇒ Object
Methods included from Utilities
Constructor Details
#initialize(options) ⇒ Default
36 37 38 39 |
# File 'lib/preprocessor/video.rb', line 36 def initialize() self.src = [:src] self.poster = [:poster] end |
Instance Attribute Details
#poster ⇒ Object
Returns the value of attribute poster.
31 32 33 |
# File 'lib/preprocessor/video.rb', line 31 def poster @poster end |
#src ⇒ Object
Returns the value of attribute src.
31 32 33 |
# File 'lib/preprocessor/video.rb', line 31 def src @src end |
Instance Method Details
#tag ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/preprocessor/video.rb', line 41 def tag src = absolutize(self.src, ::Preprocessor::Video.[:default_path]) poster = self.poster && %{poster="#{self.poster}"} # eventually should use http://camendesign.com/code/video_for_everybody %{<video controls #{poster}><source src="#{src}.ogv" type="video/ogg" /><source src="#{src}.mp4" type="video/mp4" /></video>} end |