Class: Animoto::Resources::Jobs::DirectingAndRendering

Inherits:
Base
  • Object
show all
Defined in:
lib/animoto/resources/jobs/directing_and_rendering.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#errors, #state, #url

Attributes inherited from Base

#errors, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#completed?, endpoint, #failed?, infer_content_type, infer_endpoint, #pending?

Methods inherited from Base

endpoint, #endpoint, #initialize, #load, load, new, original_new, register

Methods included from Support::StandardEnvelope

find_class_for, included

Constructor Details

This class inherits a constructor from Animoto::Resources::Base

Instance Attribute Details

#storyboardResources::Storyboard (readonly)

A Storyboard object for this job.



25
26
27
# File 'lib/animoto/resources/jobs/directing_and_rendering.rb', line 25

def storyboard
  @storyboard
end

#storyboard_urlString (readonly)

The URL for the storyboard created for this job. This storyboard can be used into future rendering jobs to produce different formats, resolutions, etc.

Returns:

  • (String)


21
22
23
# File 'lib/animoto/resources/jobs/directing_and_rendering.rb', line 21

def storyboard_url
  @storyboard_url
end

#stream_urlString (readonly)

Note:

this attribute may not be available when this job is created. If you poll the job while it’s rendering, the URL will appear when the stream is available to view.

If available, the URL where the video can be watched ‘live’ via HTTP Live Streaming.

Returns:

  • (String)


45
46
47
# File 'lib/animoto/resources/jobs/directing_and_rendering.rb', line 45

def stream_url
  @stream_url
end

#videoResources::Video (readonly)

Note:

this object may not have all the most recent attributes, namely the download_url attribute. Use Client#reload! to update the object.

A Video object for this job.

Returns:



38
39
40
# File 'lib/animoto/resources/jobs/directing_and_rendering.rb', line 38

def video
  @video
end

#video_urlString (readonly)

The URL for the video created. Note that this is for the video resource and not the URL to the actual video file (though requesting the resource will give you the URL to the file).

Returns:

  • (String)


31
32
33
# File 'lib/animoto/resources/jobs/directing_and_rendering.rb', line 31

def video_url
  @video_url
end

Class Method Details

.unpack_standard_envelope(body = {}) ⇒ Hash{Symbol=>Object}

Returns:

  • (Hash{Symbol=>Object})

See Also:

  • Support::StandardEnvelope::ClassMethods#unpack_standard_envelope


8
9
10
11
12
13
14
15
# File 'lib/animoto/resources/jobs/directing_and_rendering.rb', line 8

def self.unpack_standard_envelope body = {}
  links = unpack_links(body)
  super.merge({
    :storyboard_url => links['storyboard'],
    :video_url      => links['video'],
    :stream_url     => links['stream']
  })
end

Instance Method Details

#instantiate(attributes = {}) ⇒ Jobs::DirectingAndRendering

Returns:

See Also:

  • Jobs::Base#instantiate


49
50
51
52
53
54
55
56
# File 'lib/animoto/resources/jobs/directing_and_rendering.rb', line 49

def instantiate attributes = {}
  @storyboard_url = attributes[:storyboard_url]
  @storyboard     = Animoto::Resources::Storyboard.new(:url => @storyboard_url) if @storyboard_url
  @video_url      = attributes[:video_url]
  @video          = Animoto::Resources::Video.new(:url => @video_url) if @video_url
  @stream_url     = attributes[:stream_url]
  super
end