Class: Animoto::Resources::Video
- Defined in:
- lib/animoto/resources/video.rb
Instance Attribute Summary collapse
-
#cover_image_url ⇒ String
readonly
If available, the URL to the cover image file.
-
#download_url ⇒ String
readonly
The URL to the video file.
-
#format ⇒ String
readonly
The format of the video.
-
#framerate ⇒ Integer
readonly
The framerate of the video.
-
#resolution ⇒ String
readonly
The resolution of the video.
-
#storyboard ⇒ Resources::Storyboard
readonly
The Storyboard object this video was rendered from.
-
#storyboard_url ⇒ String
readonly
The URL to the storyboard resource this video was rendered from.
-
#stream_url ⇒ String
readonly
If available, the URL where this video can be watched via HTTP Live Streaming.
Attributes inherited from Base
Class Method Summary collapse
- .unpack_rendering_parameters(body) ⇒ Hash{String=>Object}
- .unpack_standard_envelope(body) ⇒ Hash{Symbol=>Object}
Instance Method Summary collapse
-
#instantiate(attributes = {}) ⇒ Resources::Video
Sets the attributes on a new video.
Methods inherited from Base
endpoint, #endpoint, #initialize, #load, load, new, original_new, register
Methods included from Support::StandardEnvelope
Constructor Details
This class inherits a constructor from Animoto::Resources::Base
Instance Attribute Details
#cover_image_url ⇒ String (readonly)
If available, the URL to the cover image file.
42 43 44 |
# File 'lib/animoto/resources/video.rb', line 42 def cover_image_url @cover_image_url end |
#download_url ⇒ String (readonly)
The URL to the video file.
30 31 32 |
# File 'lib/animoto/resources/video.rb', line 30 def download_url @download_url end |
#format ⇒ String (readonly)
The format of the video.
50 51 52 |
# File 'lib/animoto/resources/video.rb', line 50 def format @format end |
#framerate ⇒ Integer (readonly)
The framerate of the video.
54 55 56 |
# File 'lib/animoto/resources/video.rb', line 54 def framerate @framerate end |
#resolution ⇒ String (readonly)
The resolution of the video.
58 59 60 |
# File 'lib/animoto/resources/video.rb', line 58 def resolution @resolution end |
#storyboard ⇒ Resources::Storyboard (readonly)
The Storyboard object this video was rendered from.
38 39 40 |
# File 'lib/animoto/resources/video.rb', line 38 def storyboard @storyboard end |
#storyboard_url ⇒ String (readonly)
The URL to the storyboard resource this video was rendered from.
34 35 36 |
# File 'lib/animoto/resources/video.rb', line 34 def storyboard_url @storyboard_url end |
#stream_url ⇒ String (readonly)
If available, the URL where this video can be watched via HTTP Live Streaming.
46 47 48 |
# File 'lib/animoto/resources/video.rb', line 46 def stream_url @stream_url end |
Class Method Details
.unpack_rendering_parameters(body) ⇒ Hash{String=>Object}
8 9 10 |
# File 'lib/animoto/resources/video.rb', line 8 def self.unpack_rendering_parameters body (unpack_payload(body)['metadata'] || {})['rendering_parameters'] end |
.unpack_standard_envelope(body) ⇒ Hash{Symbol=>Object}
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/animoto/resources/video.rb', line 14 def self.unpack_standard_envelope body links = unpack_links(body) params = unpack_rendering_parameters(body) super.merge({ :download_url => links['file'], :storyboard_url => links['storyboard'], :cover_image_url => links['cover_image'], :stream_url => links['stream'], :format => params['format'], :framerate => params['framerate'], :resolution => params['resolution'] }) end |
Instance Method Details
#instantiate(attributes = {}) ⇒ Resources::Video
Sets the attributes on a new video.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/animoto/resources/video.rb', line 71 def instantiate attributes = {} @download_url = attributes[:download_url] @storyboard_url = attributes[:storyboard_url] @storyboard = Animoto::Resources::Storyboard.new(:url => @storyboard_url) if @storyboard_url @cover_image_url = attributes[:cover_image_url] @stream_url = attributes[:stream_url] @format = attributes[:format] @framerate = attributes[:framerate] @resolution = attributes[:resolution] super end |