Class: WowzaCloud::Stream
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Returns the value of attribute access_key.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#aspect_ratio_height ⇒ Object
Returns the value of attribute aspect_ratio_height.
-
#aspect_ratio_width ⇒ Object
Returns the value of attribute aspect_ratio_width.
-
#billing_mode ⇒ Object
Returns the value of attribute billing_mode.
-
#broadcast_location ⇒ Object
Returns the value of attribute broadcast_location.
-
#closed_caption_type ⇒ Object
Returns the value of attribute closed_caption_type.
-
#connection_code ⇒ Object
Returns the value of attribute connection_code.
-
#connection_code_expires_at ⇒ Object
Returns the value of attribute connection_code_expires_at.
-
#delivery_method ⇒ Object
Returns the value of attribute delivery_method.
-
#delivery_protocol ⇒ Object
Returns the value of attribute delivery_protocol.
-
#delivery_protocols ⇒ Object
Returns the value of attribute delivery_protocols.
-
#delivery_type ⇒ Object
Returns the value of attribute delivery_type.
-
#disable_authentication ⇒ Object
Returns the value of attribute disable_authentication.
-
#encoder ⇒ Object
Returns the value of attribute encoder.
-
#hosted_page ⇒ Object
Returns the value of attribute hosted_page.
-
#hosted_page_description ⇒ Object
Returns the value of attribute hosted_page_description.
-
#hosted_page_logo_image ⇒ Object
Returns the value of attribute hosted_page_logo_image.
-
#hosted_page_sharing_icons ⇒ Object
Returns the value of attribute hosted_page_sharing_icons.
-
#hosted_page_title ⇒ Object
Returns the value of attribute hosted_page_title.
-
#id ⇒ Object
Returns the value of attribute id.
-
#low_latency ⇒ Object
Returns the value of attribute low_latency.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#player_countdown ⇒ Object
Returns the value of attribute player_countdown.
-
#player_countdown_at ⇒ Object
Returns the value of attribute player_countdown_at.
-
#player_embed_code ⇒ Object
Returns the value of attribute player_embed_code.
-
#player_id ⇒ Object
Returns the value of attribute player_id.
-
#player_logo_image ⇒ Object
Returns the value of attribute player_logo_image.
-
#player_resposive ⇒ Object
Returns the value of attribute player_resposive.
-
#player_type ⇒ Object
Returns the value of attribute player_type.
-
#player_video_poster_image ⇒ Object
Returns the value of attribute player_video_poster_image.
-
#player_width ⇒ Object
Returns the value of attribute player_width.
-
#recording ⇒ Object
Returns the value of attribute recording.
-
#remove_hosted_page_logo_image ⇒ Object
Returns the value of attribute remove_hosted_page_logo_image.
-
#remove_player_video_poster_image ⇒ Object
Returns the value of attribute remove_player_video_poster_image.
-
#source_connection_information ⇒ Object
Returns the value of attribute source_connection_information.
-
#source_url ⇒ Object
Returns the value of attribute source_url.
-
#stream_name ⇒ Object
Returns the value of attribute stream_name.
-
#streaming_server ⇒ Object
Returns the value of attribute streaming_server.
-
#target_delivery_protocol ⇒ Object
Returns the value of attribute target_delivery_protocol.
-
#transcoder_type ⇒ Object
Returns the value of attribute transcoder_type.
-
#use_stream_source ⇒ Object
Returns the value of attribute use_stream_source.
-
#username ⇒ Object
Returns the value of attribute username.
-
#video_fallback ⇒ Object
Returns the value of attribute video_fallback.
Attributes inherited from Client
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Stream
constructor
A new instance of Stream.
- #reset ⇒ Object
-
#schedule ⇒ Object
Returns the first active schedule attached to this stream, if one exists.
- #schedules ⇒ Object
- #start ⇒ Object
- #stats ⇒ Object
-
#status ⇒ Object
(also: #state)
end.
- #stop ⇒ Object
- #thumbnail ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Stream
Returns a new instance of Stream.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/wowza_cloud/stream.rb', line 28 def initialize(params = {}) super params.each do |k, v| instance_variable_set(:"@#{k}", v) if self.respond_to?("#{k}=") end if(conn_params = params['source_connection_information']) self.streaming_server = conn_params['primary_server'] self.stream_name = conn_params['stream_name'] self.disable_authentication = conn_params['disable_authentication'] self.username = conn_params['username'] self.password = conn_params['password'] end end |
Instance Attribute Details
#access_key ⇒ Object
Returns the value of attribute access_key.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def access_key @access_key end |
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def api_key @api_key end |
#aspect_ratio_height ⇒ Object
Returns the value of attribute aspect_ratio_height.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def aspect_ratio_height @aspect_ratio_height end |
#aspect_ratio_width ⇒ Object
Returns the value of attribute aspect_ratio_width.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def aspect_ratio_width @aspect_ratio_width end |
#billing_mode ⇒ Object
Returns the value of attribute billing_mode.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def billing_mode @billing_mode end |
#broadcast_location ⇒ Object
Returns the value of attribute broadcast_location.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def broadcast_location @broadcast_location end |
#closed_caption_type ⇒ Object
Returns the value of attribute closed_caption_type.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def @closed_caption_type end |
#connection_code ⇒ Object
Returns the value of attribute connection_code.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def connection_code @connection_code end |
#connection_code_expires_at ⇒ Object
Returns the value of attribute connection_code_expires_at.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def connection_code_expires_at @connection_code_expires_at end |
#delivery_method ⇒ Object
Returns the value of attribute delivery_method.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def delivery_method @delivery_method end |
#delivery_protocol ⇒ Object
Returns the value of attribute delivery_protocol.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def delivery_protocol @delivery_protocol end |
#delivery_protocols ⇒ Object
Returns the value of attribute delivery_protocols.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def delivery_protocols @delivery_protocols end |
#delivery_type ⇒ Object
Returns the value of attribute delivery_type.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def delivery_type @delivery_type end |
#disable_authentication ⇒ Object
Returns the value of attribute disable_authentication.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def disable_authentication @disable_authentication end |
#encoder ⇒ Object
Returns the value of attribute encoder.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def encoder @encoder end |
#hosted_page ⇒ Object
Returns the value of attribute hosted_page.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def hosted_page @hosted_page end |
#hosted_page_description ⇒ Object
Returns the value of attribute hosted_page_description.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def hosted_page_description @hosted_page_description end |
#hosted_page_logo_image ⇒ Object
Returns the value of attribute hosted_page_logo_image.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def hosted_page_logo_image @hosted_page_logo_image end |
#hosted_page_sharing_icons ⇒ Object
Returns the value of attribute hosted_page_sharing_icons.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def hosted_page_sharing_icons @hosted_page_sharing_icons end |
#hosted_page_title ⇒ Object
Returns the value of attribute hosted_page_title.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def hosted_page_title @hosted_page_title end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def id @id end |
#low_latency ⇒ Object
Returns the value of attribute low_latency.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def low_latency @low_latency end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def password @password end |
#player_countdown ⇒ Object
Returns the value of attribute player_countdown.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def player_countdown @player_countdown end |
#player_countdown_at ⇒ Object
Returns the value of attribute player_countdown_at.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def player_countdown_at @player_countdown_at end |
#player_embed_code ⇒ Object
Returns the value of attribute player_embed_code.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def @player_embed_code end |
#player_id ⇒ Object
Returns the value of attribute player_id.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def player_id @player_id end |
#player_logo_image ⇒ Object
Returns the value of attribute player_logo_image.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def player_logo_image @player_logo_image end |
#player_resposive ⇒ Object
Returns the value of attribute player_resposive.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def player_resposive @player_resposive end |
#player_type ⇒ Object
Returns the value of attribute player_type.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def player_type @player_type end |
#player_video_poster_image ⇒ Object
Returns the value of attribute player_video_poster_image.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def player_video_poster_image @player_video_poster_image end |
#player_width ⇒ Object
Returns the value of attribute player_width.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def player_width @player_width end |
#recording ⇒ Object
Returns the value of attribute recording.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def recording @recording end |
#remove_hosted_page_logo_image ⇒ Object
Returns the value of attribute remove_hosted_page_logo_image.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def remove_hosted_page_logo_image @remove_hosted_page_logo_image end |
#remove_player_video_poster_image ⇒ Object
Returns the value of attribute remove_player_video_poster_image.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def remove_player_video_poster_image @remove_player_video_poster_image end |
#source_connection_information ⇒ Object
Returns the value of attribute source_connection_information.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def source_connection_information @source_connection_information end |
#source_url ⇒ Object
Returns the value of attribute source_url.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def source_url @source_url end |
#stream_name ⇒ Object
Returns the value of attribute stream_name.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def stream_name @stream_name end |
#streaming_server ⇒ Object
Returns the value of attribute streaming_server.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def streaming_server @streaming_server end |
#target_delivery_protocol ⇒ Object
Returns the value of attribute target_delivery_protocol.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def target_delivery_protocol @target_delivery_protocol end |
#transcoder_type ⇒ Object
Returns the value of attribute transcoder_type.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def transcoder_type @transcoder_type end |
#use_stream_source ⇒ Object
Returns the value of attribute use_stream_source.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def use_stream_source @use_stream_source end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def username @username end |
#video_fallback ⇒ Object
Returns the value of attribute video_fallback.
3 4 5 |
# File 'lib/wowza_cloud/stream.rb', line 3 def video_fallback @video_fallback end |
Class Method Details
.all ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/wowza_cloud/stream.rb', line 11 def self.all() result = [] headers = {'wsc-api-key' => WowzaCloud.configuration.api_key, 'wsc-access-key' => WowzaCloud.configuration.access_key} raw_result = get('/live_streams', headers: headers) raw_result['live_streams'].each do |data| result << WowzaCloud::Stream.new(data) end return result end |
.get_stream(stream_id) ⇒ Object
21 22 23 24 25 |
# File 'lib/wowza_cloud/stream.rb', line 21 def self.get_stream(stream_id) headers = {'wsc-api-key' => WowzaCloud.configuration.api_key, 'wsc-access-key' => WowzaCloud.configuration.access_key} raw_result = get("/live_streams/#{stream_id}", headers: headers) return WowzaCloud::Stream.new(raw_result['live_stream']) end |
Instance Method Details
#reset ⇒ Object
69 70 71 72 |
# File 'lib/wowza_cloud/stream.rb', line 69 def reset raw_response = self.class.put("/live_streams/#{self.id}/reset", headers: @headers) return raw_response['live_stream']['state'] end |
#schedule ⇒ Object
Returns the first active schedule attached to this stream, if one exists
80 81 82 |
# File 'lib/wowza_cloud/stream.rb', line 80 def schedule Schedule.all.select{|s| s.transcoder_id == @id && s.state == 'enabled' }.first end |
#schedules ⇒ Object
84 85 86 |
# File 'lib/wowza_cloud/stream.rb', line 84 def schedules Schedule.all.select{|s| s.transcoder_id == @id } end |
#start ⇒ Object
64 65 66 67 |
# File 'lib/wowza_cloud/stream.rb', line 64 def start raw_response = self.class.put("/live_streams/#{self.id}/start", headers: @headers) return raw_response['live_stream']['state'] end |
#stats ⇒ Object
54 55 56 57 |
# File 'lib/wowza_cloud/stream.rb', line 54 def stats raw_response = self.class.get("/live_streams/#{self.id}/stats", headers: @headers) return raw_response['live_stream'] end |
#status ⇒ Object Also known as: state
end
47 48 49 50 |
# File 'lib/wowza_cloud/stream.rb', line 47 def status raw_response = self.class.get("/live_streams/#{self.id}/state/", headers: @headers) return raw_response['live_stream']['state'] end |
#stop ⇒ Object
74 75 76 77 |
# File 'lib/wowza_cloud/stream.rb', line 74 def stop raw_response = self.class.put("/live_streams/#{self.id}/stop", headers: @headers) return raw_response['live_stream']['state'] end |
#thumbnail ⇒ Object
59 60 61 62 |
# File 'lib/wowza_cloud/stream.rb', line 59 def thumbnail raw_response = self.class.get("/live_streams/#{self.id}/thumbnail_url", headers: @headers) return raw_response['live_stream']['thumbnail_url'] end |