class ZiggeoStreams

Public Class Methods

new(application) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 3
def initialize(application)
  @application = application
end

Public Instance Methods

attach_image(video_token_or_key, token_or_key, data = nil, file = nil) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 41
def attach_image(video_token_or_key, token_or_key, data = nil, file = nil)
  unless file.nil?
    result = @application.connect.postUploadJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/image-upload-url', 'stream', data, file)
    result = @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/confirm-image');
    return result
  else
    return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/image', data, file)
  end
end
attach_subtitle(video_token_or_key, token_or_key, data = nil) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 61
def attach_subtitle(video_token_or_key, token_or_key, data = nil)
  return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/subtitle', data)
end
attach_video(video_token_or_key, token_or_key, data = nil, file = nil) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 51
def attach_video(video_token_or_key, token_or_key, data = nil, file = nil)
  unless file.nil?
    result = @application.connect.postUploadJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/video-upload-url', 'stream', data, file, 'video_type')
    result = @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/confirm-video');
    return result
  else
    return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/video', data, file)
  end
end
bind(video_token_or_key, token_or_key) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 65
def bind(video_token_or_key, token_or_key)
  return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/bind')
end
create(video_token_or_key, data = nil, file = nil) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 31
def create(video_token_or_key, data = nil, file = nil)
  unless file.nil?
    result = @application.connect.postUploadJSON('/v1/videos/' + video_token_or_key + '/streams-upload-url', 'stream', data, file, 'video_type')
    result = @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + result["token"] + '/confirm-video');
    return result
  else
    return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams', data, file)
  end
end
delete(video_token_or_key, token_or_key) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 27
def delete(video_token_or_key, token_or_key)
  return @application.connect.delete('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '')
end
download_image(video_token_or_key, token_or_key) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 19
def download_image(video_token_or_key, token_or_key)
  return @application.cdn_connect.get('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/image')
end
download_video(video_token_or_key, token_or_key) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 15
def download_video(video_token_or_key, token_or_key)
  return @application.cdn_connect.get('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/video')
end
get(video_token_or_key, token_or_key) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 11
def get(video_token_or_key, token_or_key)
  return @application.connect.getJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '')
end
index(video_token_or_key, data = nil) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 7
def index(video_token_or_key, data = nil)
  return @application.connect.getJSON('/v1/videos/' + video_token_or_key + '/streams', data)
end
push_to_service(video_token_or_key, token_or_key, data = nil) click to toggle source
# File lib/classes/ZiggeoStreams.rb, line 23
def push_to_service(video_token_or_key, token_or_key, data = nil)
  return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/push', data)
end