Class: Twilio::REST::Video::V1::CompositionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Video::V1::CompositionInstance
- Defined in:
- lib/twilio-ruby/rest/video/v1/composition.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Composition resource.
-
#audio_sources ⇒ Array<String>
The array of track names to include in the composition.
-
#audio_sources_excluded ⇒ Array<String>
The array of track names to exclude from the composition.
-
#bitrate ⇒ String
The average bit rate of the composition’s media.
-
#context ⇒ CompositionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_completed ⇒ Time
The date and time in GMT when the composition’s media processing task finished, specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_deleted ⇒ Time
The date and time in GMT when the composition generated media was deleted, specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the CompositionInstance.
-
#duration ⇒ String
The duration of the composition’s media file in seconds.
-
#fetch ⇒ CompositionInstance
Fetch the CompositionInstance.
- #format ⇒ Format
-
#initialize(version, payload, sid: nil) ⇒ CompositionInstance
constructor
Initialize the CompositionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URL of the media file associated with the composition.
-
#media_external_location ⇒ String
The URL of the media file associated with the composition when stored externally.
-
#resolution ⇒ String
The dimensions of the video image in pixels expressed as columns (width) and rows (height).
-
#room_sid ⇒ String
The SID of the Group Room that generated the audio and video tracks used in the composition.
-
#sid ⇒ String
The unique string that we created to identify the Composition resource.
-
#size ⇒ String
The size of the composed media file in bytes.
- #status ⇒ Status
-
#status_callback ⇒ String
The URL called using the ‘status_callback_method` to send status information on every composition event.
-
#status_callback_method ⇒ String
The HTTP method used to call ‘status_callback`.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#trim ⇒ Boolean
Whether to remove intervals with no media, as specified in the POST request that created the composition.
-
#url ⇒ String
The absolute URL of the resource.
-
#video_layout ⇒ Hash
An object that describes the video layout of the composition in terms of regions.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CompositionInstance
Initialize the CompositionInstance
551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 551 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'status' => payload['status'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_completed' => Twilio.deserialize_iso8601_datetime(payload['date_completed']), 'date_deleted' => Twilio.deserialize_iso8601_datetime(payload['date_deleted']), 'sid' => payload['sid'], 'room_sid' => payload['room_sid'], 'audio_sources' => payload['audio_sources'], 'audio_sources_excluded' => payload['audio_sources_excluded'], 'video_layout' => payload['video_layout'], 'resolution' => payload['resolution'], 'trim' => payload['trim'], 'format' => payload['format'], 'bitrate' => payload['bitrate'] == nil ? payload['bitrate'] : payload['bitrate'].to_i, 'size' => payload['size'], 'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i, 'media_external_location' => payload['media_external_location'], 'status_callback' => payload['status_callback'], 'status_callback_method' => payload['status_callback_method'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Composition resource.
598 599 600 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 598 def account_sid @properties['account_sid'] end |
#audio_sources ⇒ Array<String>
Returns The array of track names to include in the composition. The composition includes all audio sources specified in ‘audio_sources` except those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`.
640 641 642 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 640 def audio_sources @properties['audio_sources'] end |
#audio_sources_excluded ⇒ Array<String>
Returns The array of track names to exclude from the composition. The composition includes all audio sources specified in ‘audio_sources` except for those specified in `audio_sources_excluded`. The track names in this property can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty.
646 647 648 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 646 def audio_sources_excluded @properties['audio_sources_excluded'] end |
#bitrate ⇒ String
Returns The average bit rate of the composition’s media.
676 677 678 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 676 def bitrate @properties['bitrate'] end |
#context ⇒ CompositionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
589 590 591 592 593 594 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 589 def context unless @instance_context @instance_context = CompositionContext.new(@version , @params['sid']) end @instance_context end |
#date_completed ⇒ Time
Returns The date and time in GMT when the composition’s media processing task finished, specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
616 617 618 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 616 def date_completed @properties['date_completed'] end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
610 611 612 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 610 def date_created @properties['date_created'] end |
#date_deleted ⇒ Time
Returns The date and time in GMT when the composition generated media was deleted, specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
622 623 624 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 622 def date_deleted @properties['date_deleted'] end |
#delete ⇒ Boolean
Delete the CompositionInstance
725 726 727 728 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 725 def delete context.delete end |
#duration ⇒ String
Returns The duration of the composition’s media file in seconds.
688 689 690 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 688 def duration @properties['duration'] end |
#fetch ⇒ CompositionInstance
Fetch the CompositionInstance
733 734 735 736 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 733 def fetch context.fetch end |
#format ⇒ Format
670 671 672 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 670 def format @properties['format'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
747 748 749 750 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 747 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.CompositionInstance #{values}>" end |
#links ⇒ Hash
Returns The URL of the media file associated with the composition.
718 719 720 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 718 def links @properties['links'] end |
#media_external_location ⇒ String
Returns The URL of the media file associated with the composition when stored externally. See [External S3 Compositions](/docs/video/api/external-s3-compositions) for more details.
694 695 696 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 694 def media_external_location @properties['media_external_location'] end |
#resolution ⇒ String
Returns The dimensions of the video image in pixels expressed as columns (width) and rows (height). The string’s format is ‘widthxheight`, such as `640x480`.
658 659 660 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 658 def resolution @properties['resolution'] end |
#room_sid ⇒ String
Returns The SID of the Group Room that generated the audio and video tracks used in the composition. All media sources included in a composition must belong to the same Group Room.
634 635 636 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 634 def room_sid @properties['room_sid'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Composition resource.
628 629 630 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 628 def sid @properties['sid'] end |
#size ⇒ String
Returns The size of the composed media file in bytes.
682 683 684 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 682 def size @properties['size'] end |
#status ⇒ Status
604 605 606 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 604 def status @properties['status'] end |
#status_callback ⇒ String
Returns The URL called using the ‘status_callback_method` to send status information on every composition event.
700 701 702 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 700 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method used to call ‘status_callback`. Can be: `POST` or `GET`, defaults to `POST`.
706 707 708 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 706 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
740 741 742 743 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 740 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Video.V1.CompositionInstance #{values}>" end |
#trim ⇒ Boolean
Returns Whether to remove intervals with no media, as specified in the POST request that created the composition. Compositions with ‘trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
664 665 666 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 664 def trim @properties['trim'] end |
#url ⇒ String
Returns The absolute URL of the resource.
712 713 714 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 712 def url @properties['url'] end |
#video_layout ⇒ Hash
Returns An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info.
652 653 654 |
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 652 def video_layout @properties['video_layout'] end |