Class: WscSdk::Models::LiveStream
- Inherits:
-
WscSdk::Model
- Object
- WscSdk::Model
- WscSdk::Models::LiveStream
- Includes:
- TranscoderSharedMethods
- Defined in:
- lib/wsc_sdk/models/live_stream.rb
Overview
A model to represent a Live Stream in the Wowza Streaming Cloud API.
Instance Attribute Summary
Attributes inherited from WscSdk::Model
#attributes, #changes, #data_mode, #endpoint, #errors, #partial_data
Instance Method Summary collapse
-
#default_source_url ⇒ Object
Since the source_url is a write only attribute, when we update the live stream the value is no longer present, so we will default it to the value returned in the source_connection_information attribute, if it is present.
-
#delivery_type_is_required? ⇒ Boolean
Determine if the delivery type opitons is required.
-
#hosted_page_access ⇒ Object
Determine if the hosted page option can be set.
-
#regenerate_connection_code ⇒ WscSdk::Models::TranscoderConnectionCode
Regenerates the connection code for the transcoder.
-
#source_url_is_required? ⇒ Boolean
Determine if the source_url attribute is required.
Methods included from TranscoderSharedMethods
#reset, #start, #state, #stats, #stop, #thumbnail_url
Methods inherited from WscSdk::Model
#add_error, attribute, #build_payload, #build_payload!, #clean!, #clear_primary_key, #delete, #dirty?, #has_attribute?, #ingest_attribute, #ingest_attributes, #initialize, #initialize_attributes, model_name_plural, model_name_singular, #new_model?, #primary_key, primary_key, #primary_key_attribute, #refresh, #save, #schema, schema, #success?, #valid!, #valid?, #validate
Methods included from Loggable
Methods included from ApiResponse
Constructor Details
This class inherits a constructor from WscSdk::Model
Instance Method Details
#default_source_url ⇒ Object
Since the source_url is a write only attribute, when we update the live stream the value is no longer present, so we will default it to the value returned in the source_connection_information attribute, if it is present.
104 105 106 107 108 |
# File 'lib/wsc_sdk/models/live_stream.rb', line 104 def default_source_url sci = (self.attributes[:source_connection_information] || {}) return sci[:source_url] if sci.has_key?(:source_url) return nil end |
#delivery_type_is_required? ⇒ Boolean
Determine if the delivery type opitons is required
89 90 91 |
# File 'lib/wsc_sdk/models/live_stream.rb', line 89 def delivery_type_is_required? encoder == Enums::Encoder::WOWZA_STREAMING_ENGINE end |
#hosted_page_access ⇒ Object
Determine if the hosted page option can be set
95 96 97 |
# File 'lib/wsc_sdk/models/live_stream.rb', line 95 def hosted_page_access self.new_model? ? :read_write : :read end |
#regenerate_connection_code ⇒ WscSdk::Models::TranscoderConnectionCode
Regenerates the connection code for the transcoder.
124 125 126 |
# File 'lib/wsc_sdk/models/live_stream.rb', line 124 def regenerate_connection_code return self.endpoint.regenerate_connection_code(self.id) end |
#source_url_is_required? ⇒ Boolean
Determine if the source_url attribute is required
83 84 85 |
# File 'lib/wsc_sdk/models/live_stream.rb', line 83 def source_url_is_required? delivery_method == Enums::DeliveryMethod::PULL end |