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
Returns a new instance of Default.
35 36 37 38 |
# File 'lib/preprocessor/video.rb', line 35 def initialize() self.src = [:src] self.poster = [:poster] end |
Instance Attribute Details
#poster ⇒ Object
Returns the value of attribute poster.
30 31 32 |
# File 'lib/preprocessor/video.rb', line 30 def poster @poster end |
#src ⇒ Object
Returns the value of attribute src.
30 31 32 |
# File 'lib/preprocessor/video.rb', line 30 def src @src end |
Instance Method Details
#tag ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/preprocessor/video.rb', line 40 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 |