Class: Editframe::VideoBuilder
- Inherits:
-
Object
- Object
- Editframe::VideoBuilder
- Defined in:
- lib/editframe/video/builder.rb
Instance Attribute Summary collapse
-
#layers ⇒ Object
readonly
Returns the value of attribute layers.
Instance Method Summary collapse
- #add_audio(source, options = {}) ⇒ Object
- #add_image(source, options = {}) ⇒ Object
- #add_text(text, options = {}) ⇒ Object
- #add_video(source, options = {}) ⇒ Object
- #add_waveform(options = {}) ⇒ Object
- #encode ⇒ Object
-
#initialize(options = {}) ⇒ VideoBuilder
constructor
A new instance of VideoBuilder.
Constructor Details
#initialize(options = {}) ⇒ VideoBuilder
Returns a new instance of VideoBuilder.
6 7 8 9 10 |
# File 'lib/editframe/video/builder.rb', line 6 def initialize( = {}) @form = {} @layers = [] @options = || { background_color: 'black', resolution: '700x700', duration: 10 } end |
Instance Attribute Details
#layers ⇒ Object (readonly)
Returns the value of attribute layers.
4 5 6 |
# File 'lib/editframe/video/builder.rb', line 4 def layers @layers end |
Instance Method Details
#add_audio(source, options = {}) ⇒ Object
12 13 14 15 16 |
# File 'lib/editframe/video/builder.rb', line 12 def add_audio(source, = {}) layer = add_layer({ :type => 'audio', ** }) add_asset(layer[:id], source) layer end |
#add_image(source, options = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/editframe/video/builder.rb', line 18 def add_image(source, = {}) layer = add_layer({ :type => 'image', ** }) add_asset(layer[:id], source) layer end |
#add_text(text, options = {}) ⇒ Object
24 25 26 27 |
# File 'lib/editframe/video/builder.rb', line 24 def add_text(text, = {}) layer = add_layer({ :type => 'waveform', :text => text, ** }) layer end |
#add_video(source, options = {}) ⇒ Object
29 30 31 32 33 |
# File 'lib/editframe/video/builder.rb', line 29 def add_video(source, = {}) layer = add_layer({ :type => 'video', ** }) add_asset(layer[:id], source) layer end |
#add_waveform(options = {}) ⇒ Object
35 36 37 38 |
# File 'lib/editframe/video/builder.rb', line 35 def add_waveform( = {}) layer = add_layer({ :type => 'waveform', ** }) layer end |