Class: ZiggeoVideos
- Inherits:
-
Object
- Object
- ZiggeoVideos
- Defined in:
- lib/classes/ZiggeoVideos.rb
Instance Method Summary collapse
- #analytics(token_or_key, data = nil) ⇒ Object
- #apply_effect(token_or_key, data = nil) ⇒ Object
- #apply_meta(token_or_key, data = nil) ⇒ Object
- #count(data = nil) ⇒ Object
- #create(data = nil, file = nil) ⇒ Object
- #delete(token_or_key) ⇒ Object
- #download_image(token_or_key) ⇒ Object
- #download_video(token_or_key) ⇒ Object
- #get(token_or_key) ⇒ Object
- #get_bulk(data = nil) ⇒ Object
- #get_stats(token_or_key) ⇒ Object
- #index(data = nil) ⇒ Object
-
#initialize(application) ⇒ ZiggeoVideos
constructor
A new instance of ZiggeoVideos.
- #push_to_service(token_or_key, data = nil) ⇒ Object
- #stats_bulk(data = nil) ⇒ Object
- #update(token_or_key, data = nil) ⇒ Object
- #update_bulk(data = nil) ⇒ Object
Constructor Details
#initialize(application) ⇒ ZiggeoVideos
Returns a new instance of ZiggeoVideos.
3 4 5 |
# File 'lib/classes/ZiggeoVideos.rb', line 3 def initialize(application) @application = application end |
Instance Method Details
#analytics(token_or_key, data = nil) ⇒ Object
73 74 75 |
# File 'lib/classes/ZiggeoVideos.rb', line 73 def analytics(token_or_key, data = nil) return @application.connect.postJSON('/v1/videos/' + token_or_key + '/analytics', data) end |
#apply_effect(token_or_key, data = nil) ⇒ Object
43 44 45 |
# File 'lib/classes/ZiggeoVideos.rb', line 43 def apply_effect(token_or_key, data = nil) return @application.connect.postJSON('/v1/videos/' + token_or_key + '/effect', data) end |
#apply_meta(token_or_key, data = nil) ⇒ Object
47 48 49 |
# File 'lib/classes/ZiggeoVideos.rb', line 47 def (token_or_key, data = nil) return @application.connect.postJSON('/v1/videos/' + token_or_key + '/metaprofile', data) end |
#count(data = nil) ⇒ Object
11 12 13 |
# File 'lib/classes/ZiggeoVideos.rb', line 11 def count(data = nil) return @application.connect.getJSON('/v1/videos/count', data) end |
#create(data = nil, file = nil) ⇒ Object
63 64 65 66 67 68 69 70 71 |
# File 'lib/classes/ZiggeoVideos.rb', line 63 def create(data = nil, file = nil) unless file.nil? result = @application.connect.postUploadJSON('/v1/videos-upload-url', 'video', data, file, 'video_type') result["default_stream"] = @application.connect.postJSON('/v1/videos/' + result["token"] + '/streams/' + result["default_stream"]["token"] + '/confirm-video'); return result else return @application.connect.postJSON('/v1/videos/', data, file) end end |
#delete(token_or_key) ⇒ Object
59 60 61 |
# File 'lib/classes/ZiggeoVideos.rb', line 59 def delete(token_or_key) return @application.connect.delete('/v1/videos/' + token_or_key + '') end |
#download_image(token_or_key) ⇒ Object
31 32 33 |
# File 'lib/classes/ZiggeoVideos.rb', line 31 def download_image(token_or_key) return @application.cdn_connect.get('/v1/videos/' + token_or_key + '/image') end |
#download_video(token_or_key) ⇒ Object
27 28 29 |
# File 'lib/classes/ZiggeoVideos.rb', line 27 def download_video(token_or_key) return @application.cdn_connect.get('/v1/videos/' + token_or_key + '/video') end |
#get(token_or_key) ⇒ Object
15 16 17 |
# File 'lib/classes/ZiggeoVideos.rb', line 15 def get(token_or_key) return @application.connect.getJSON('/v1/videos/' + token_or_key + '') end |
#get_bulk(data = nil) ⇒ Object
19 20 21 |
# File 'lib/classes/ZiggeoVideos.rb', line 19 def get_bulk(data = nil) return @application.connect.postJSON('/v1/videos/get_bulk', data) end |
#get_stats(token_or_key) ⇒ Object
35 36 37 |
# File 'lib/classes/ZiggeoVideos.rb', line 35 def get_stats(token_or_key) return @application.connect.getJSON('/v1/videos/' + token_or_key + '/stats') end |
#index(data = nil) ⇒ Object
7 8 9 |
# File 'lib/classes/ZiggeoVideos.rb', line 7 def index(data = nil) return @application.connect.getJSON('/v1/videos/', data) end |
#push_to_service(token_or_key, data = nil) ⇒ Object
39 40 41 |
# File 'lib/classes/ZiggeoVideos.rb', line 39 def push_to_service(token_or_key, data = nil) return @application.connect.postJSON('/v1/videos/' + token_or_key + '/push', data) end |
#stats_bulk(data = nil) ⇒ Object
23 24 25 |
# File 'lib/classes/ZiggeoVideos.rb', line 23 def stats_bulk(data = nil) return @application.connect.postJSON('/v1/videos/stats_bulk', data) end |
#update(token_or_key, data = nil) ⇒ Object
51 52 53 |
# File 'lib/classes/ZiggeoVideos.rb', line 51 def update(token_or_key, data = nil) return @application.connect.postJSON('/v1/videos/' + token_or_key + '', data) end |
#update_bulk(data = nil) ⇒ Object
55 56 57 |
# File 'lib/classes/ZiggeoVideos.rb', line 55 def update_bulk(data = nil) return @application.connect.postJSON('/v1/videos/update_bulk', data) end |