Class: Animoto::Manifests::Rendering
- Defined in:
- lib/animoto/manifests/rendering.rb
Instance Attribute Summary collapse
-
#format ⇒ String
The format of the rendered video.
-
#framerate ⇒ Integer
The framerate of the rendered video.
-
#resolution ⇒ String
The vertical resolution of the rendered video.
-
#storyboard ⇒ Resources::Storyboard
The storyboard this rendering targets.
-
#streaming ⇒ Boolean
writeonly
If streaming is set to true, a “live” stream will be made available to watch while the video is rendering via HTTP Live Streaming.
Attributes inherited from Base
#http_callback_format, #http_callback_url, #partner_metadata
Instance Method Summary collapse
-
#initialize(*args) ⇒ Manifests::Rendering
constructor
Creates a new rendering manifest.
-
#streaming? ⇒ Boolean
Returns true if an HTTP Live Streaming URL will be created for this video while it’s rendering.
-
#to_hash ⇒ Hash{String=>Object}
Returns a representation of this manifest as a Hash.
Methods inherited from Base
#associated_job_class, associated_job_class, infer_content_type
Methods included from Support::ContentType
Constructor Details
#initialize(*args) ⇒ Manifests::Rendering
Creates a new rendering manifest.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/animoto/manifests/rendering.rb', line 38 def initialize *args = args.last.is_a?(Hash) ? args.pop : {} super() @storyboard = args.shift @resolution = [:resolution] @framerate = [:framerate] @format = [:format] @streaming = [:streaming] # We may or may not ever support other streaming formats @streaming_format = "http_live_streaming" end |
Instance Attribute Details
#format ⇒ String
The format of the rendered video. Valid values are ‘h264’.
16 17 18 |
# File 'lib/animoto/manifests/rendering.rb', line 16 def format @format end |
#framerate ⇒ Integer
The framerate of the rendered video. Valid values are 12, 15, 24 or 30.
12 13 14 |
# File 'lib/animoto/manifests/rendering.rb', line 12 def framerate @framerate end |
#resolution ⇒ String
The vertical resolution of the rendered video. Valid values are ‘180p’, ‘270p’, ‘360p’, ‘480p’, or ‘720p’.
8 9 10 |
# File 'lib/animoto/manifests/rendering.rb', line 8 def resolution @resolution end |
#storyboard ⇒ Resources::Storyboard
The storyboard this rendering targets.
20 21 22 |
# File 'lib/animoto/manifests/rendering.rb', line 20 def storyboard @storyboard end |
#streaming=(value) ⇒ Boolean (writeonly)
If streaming is set to true, a “live” stream will be made available to watch while the video is rendering via HTTP Live Streaming. This stream URL will be exposed on the associated rendering job.
26 27 28 |
# File 'lib/animoto/manifests/rendering.rb', line 26 def streaming=(value) @streaming = value end |
Instance Method Details
#streaming? ⇒ Boolean
Returns true if an HTTP Live Streaming URL will be created for this video while it’s rendering.
54 55 56 |
# File 'lib/animoto/manifests/rendering.rb', line 54 def streaming? @streaming end |
#to_hash ⇒ Hash{String=>Object}
Returns a representation of this manifest as a Hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/animoto/manifests/rendering.rb', line 62 def to_hash hash = { 'rendering_job' => { 'rendering_manifest' => { 'rendering_parameters' => {} } } } job = hash['rendering_job'] add_callback_information job job manifest = job['rendering_manifest'] manifest['storyboard_url'] = storyboard.url if storyboard params = manifest['rendering_parameters'] params['resolution'] = resolution params['framerate'] = framerate params['format'] = format if streaming? params['streaming_parameters'] = {} params['streaming_parameters']['format'] = @streaming_format end hash end |