class WowzaCloud::Stream

Attributes

access_key[RW]
api_key[RW]
aspect_ratio_height[RW]
aspect_ratio_width[RW]
billing_mode[RW]
broadcast_location[RW]
closed_caption_type[RW]
connection_code[RW]
connection_code_expires_at[RW]
delivery_method[RW]
delivery_protocol[RW]
delivery_protocols[RW]
delivery_type[RW]
disable_authentication[RW]
encoder[RW]
hosted_page[RW]
hosted_page_description[RW]
hosted_page_logo_image[RW]
hosted_page_sharing_icons[RW]
hosted_page_title[RW]
id[RW]
low_latency[RW]
name[RW]
password[RW]
player_countdown[RW]
player_countdown_at[RW]
player_embed_code[RW]
player_id[RW]
player_logo_image[RW]
player_resposive[RW]
player_type[RW]
player_video_poster_image[RW]
player_width[RW]
recording[RW]
remove_hosted_page_logo_image[RW]
remove_player_video_poster_image[RW]
source_connection_information[RW]
source_url[RW]
stream_name[RW]
streaming_server[RW]
target_delivery_protocol[RW]
transcoder_type[RW]
use_stream_source[RW]
username[RW]
video_fallback[RW]

Public Class Methods

all() click to toggle source
# 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) click to toggle source
# 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
new(params = {}) click to toggle source
Calls superclass method WowzaCloud::Client::new
# 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

Public Instance Methods

reset() click to toggle source
# 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() click to toggle source

Returns the first active schedule attached to this stream, if one exists

# File lib/wowza_cloud/stream.rb, line 80
def schedule
  Schedule.all.select{|s| s.transcoder_id == @id && s.state == 'enabled' }.first
end
schedules() click to toggle source
# File lib/wowza_cloud/stream.rb, line 84
def schedules
  Schedule.all.select{|s| s.transcoder_id == @id } 
end
start() click to toggle source
# 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
state()
Alias for: status
stats() click to toggle source
# 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() click to toggle source

def destroy raw_response = self.class.delete(“/live_streams/#{self.id}”, headers: @headers) return raw_response.code == 204 end

# 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
Also aliased as: state
stop() click to toggle source
# 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() click to toggle source
# 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