Ziggeo 1.8 → 1.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 23022f33986e7eed844f4effab99037c67a61047
4
- data.tar.gz: 022ece5be7c7f59eac43ad31e044f20fc4849004
3
+ metadata.gz: 4b6135192c868dc2e070b50631d95f64aee06f67
4
+ data.tar.gz: 010ebf62bb33a4433284ef8e41ad7d3e4379a549
5
5
  SHA512:
6
- metadata.gz: bb1e0978a69afafa934ddfc1b1bbf438ab2e3a677e31650a192bd372b2733d35ed2284e4da6074718674547cab25326b8d5426a4d1257e59342185311f53ec6b
7
- data.tar.gz: eb3141ec360e3117c67d0d444d9a82c7fa82356d4192444521d954a6f6c15e5487498f83ca25e49dcf83f442845677473b148abe8ca661074cf989ec983cfe9d
6
+ metadata.gz: 6b7429a9a331a481a32c6066a45f280b2770574ee1c9de13ad086c57212df1f84026008eb816fd61550016c67fafc99e005b0a4992e4f049e4ade1052cbd0819
7
+ data.tar.gz: 1fe70933dbb34af8f28f0d3e0e21be56f21c0b6f5f9183a39406dfabae82742b244b4fc96c45572ff1b5486b7c7875ceecdb42e42e341fa379468bbe7ce6da4e
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Ziggeo Ruby Server SDK 1.8
1
+ # Ziggeo Ruby Server SDK 1.14
2
2
 
3
- Ziggeo API (https://ziggeo.com) allows you to integrate video recording and playback with only
3
+ Ziggeo API (http://ziggeo.com) allows you to integrate video recording and playback with only
4
4
  two lines of code in your site, service or app. This is the Ruby Server SDK repository.
5
5
 
6
6
  Pull requests welcome.
@@ -18,33 +18,30 @@ gem "Ziggeo"
18
18
  For the client-side integration, you need to add these assets to your html file:
19
19
 
20
20
  ```html
21
- <link rel="stylesheet" href="//assets-cdn.ziggeo.com/v2-stable/ziggeo.css" />
22
- <script src="//assets-cdn.ziggeo.com/v2-stable/ziggeo.js"></script>
21
+ <link rel="stylesheet" href="//assets-cdn.ziggeo.com/v1-latest/ziggeo.css" />
22
+ <script src="//assets-cdn.ziggeo.com/v1-latest/ziggeo.js"></script>
23
23
  ```
24
24
 
25
25
  Then, you need to specify your api token:
26
26
  ```html
27
27
  <script>
28
- var ziggeoApplication = new ZiggeoApi.V2.Application({
29
- token: "APPLICATION_TOKEN"
30
- });
28
+ ZiggeoApi.token = "APPLICATION_TOKEN";
31
29
  </script>
32
30
  ```
33
31
 
34
- You can specify other global options, [see here](https://ziggeo.com/docs).
32
+ You can specify other global options, [see here](http://ziggeo.com/docs).
35
33
 
36
34
  To fire up a recorder on your page, add:
37
35
  ```html
38
- <ziggeorecorder></ziggeorecorder>
36
+ <ziggeo></ziggeo>
39
37
  ```
40
38
 
41
39
  To embed a player for an existing video, add:
42
40
  ```html
43
- <ziggeoplayer ziggeo-video='video-token'></ziggeoplayer>
41
+ <ziggeo ziggeo-video='video-token'></ziggeo>
44
42
  ```
45
43
 
46
- For the full documentation, please visit [ziggeo.com](https://ziggeo.com/docs).
47
-
44
+ For the full documentation, please visit [ziggeo.com](http://ziggeo.com/docs).
48
45
 
49
46
 
50
47
  ## Server-Side Integration
@@ -59,7 +56,7 @@ You can integrate the Server SDK as follows:
59
56
  ## Server-Side Methods
60
57
 
61
58
  ### Videos
62
-
59
+
63
60
  The videos resource allows you to access all single videos. Each video may contain more than one stream.
64
61
 
65
62
 
@@ -79,19 +76,6 @@ Arguments
79
76
  - tags: *Filter the search result to certain tags, encoded as a comma-separated string*
80
77
 
81
78
 
82
- #### Count
83
-
84
- Get the video count for the application.
85
-
86
- ```ruby
87
- ziggeo.videos().count(arguments = nil)
88
- ```
89
-
90
- Arguments
91
- - states: *Filter videos by state*
92
- - tags: *Filter the search result to certain tags, encoded as a comma-separated string*
93
-
94
-
95
79
  #### Get
96
80
 
97
81
  Get a single video by token or key.
@@ -102,31 +86,6 @@ ziggeo.videos().get(token_or_key)
102
86
 
103
87
 
104
88
 
105
- #### Get Bulk
106
-
107
- Get multiple videos by tokens or keys.
108
-
109
- ```ruby
110
- ziggeo.videos().get_bulk(arguments = nil)
111
- ```
112
-
113
- Arguments
114
- - tokens_or_keys: *Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).*
115
-
116
-
117
- #### Stats Bulk
118
-
119
- Get stats for multiple videos by tokens or keys.
120
-
121
- ```ruby
122
- ziggeo.videos().stats_bulk(arguments = nil)
123
- ```
124
-
125
- Arguments
126
- - tokens_or_keys: *Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).*
127
- - summarize: *Boolean. Set it to TRUE to get the stats summarized. Set it to FALSE to get the stats for each video in a separate array. Default: TRUE.*
128
-
129
-
130
89
  #### Download Video
131
90
 
132
91
  Download the video data file
@@ -147,52 +106,6 @@ ziggeo.videos().download_image(token_or_key)
147
106
 
148
107
 
149
108
 
150
- #### Get Stats
151
-
152
- Get the video's stats
153
-
154
- ```ruby
155
- ziggeo.videos().get_stats(token_or_key)
156
- ```
157
-
158
-
159
-
160
- #### Push To Service
161
-
162
- Push a video to a provided push service.
163
-
164
- ```ruby
165
- ziggeo.videos().push_to_service(token_or_key, arguments = nil)
166
- ```
167
-
168
- Arguments
169
- - pushservicetoken: *Push Services's token (from the Push Services configured for the app)*
170
-
171
-
172
- #### Apply Effect
173
-
174
- Apply an effect profile to a video.
175
-
176
- ```ruby
177
- ziggeo.videos().apply_effect(token_or_key, arguments = nil)
178
- ```
179
-
180
- Arguments
181
- - effectprofiletoken: *Effect Profile token (from the Effect Profiles configured for the app)*
182
-
183
-
184
- #### Apply Meta
185
-
186
- Apply a meta profile to a video.
187
-
188
- ```ruby
189
- ziggeo.videos().apply_meta(token_or_key, arguments = nil)
190
- ```
191
-
192
- Arguments
193
- - metaprofiletoken: *Meta Profile token (from the Meta Profiles configured for the app)*
194
-
195
-
196
109
  #### Update
197
110
 
198
111
  Update single video by token or key.
@@ -210,23 +123,6 @@ Arguments
210
123
  - expiration_days: *After how many days will this video be deleted*
211
124
 
212
125
 
213
- #### Update Bulk
214
-
215
- Update multiple videos by token or key.
216
-
217
- ```ruby
218
- ziggeo.videos().update_bulk(arguments = nil)
219
- ```
220
-
221
- Arguments
222
- - tokens_or_keys: *Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).*
223
- - min_duration: *Minimal duration of video*
224
- - max_duration: *Maximal duration of video*
225
- - tags: *Video Tags*
226
- - volatile: *Automatically removed this video if it remains empty*
227
- - expiration_days: *After how many days will this video be deleted*
228
-
229
-
230
126
  #### Delete
231
127
 
232
128
  Delete a single video by token or key.
@@ -254,23 +150,8 @@ Arguments
254
150
  - volatile: *Automatically removed this video if it remains empty*
255
151
 
256
152
 
257
- #### Analytics
258
-
259
- Get analytics for a specific videos with the given params
260
-
261
- ```ruby
262
- ziggeo.videos().analytics(token_or_key, arguments = nil)
263
- ```
264
-
265
- Arguments
266
- - from: *A UNIX timestamp in microseconds used as the start date of the query*
267
- - to: *A UNIX timestamp in microseconds used as the end date of the query*
268
- - date: *A UNIX timestamp in microseconds to retrieve data from a single date. If set, it overwrites the from and to params.*
269
- - query: *The query you want to run. It can be one of the following: device_views_by_os, device_views_by_date, total_plays_by_country, full_plays_by_country, total_plays_by_hour, full_plays_by_hour, total_plays_by_browser, full_plays_by_browser*
270
-
271
-
272
153
  ### Streams
273
-
154
+
274
155
  The streams resource allows you to directly access all streams associated with a single video.
275
156
 
276
157
 
@@ -316,18 +197,6 @@ ziggeo.streams().download_image(video_token_or_key, token_or_key)
316
197
 
317
198
 
318
199
 
319
- #### Push To Service
320
-
321
- Push a stream to a provided push service.
322
-
323
- ```ruby
324
- ziggeo.streams().push_to_service(video_token_or_key, token_or_key, arguments = nil)
325
- ```
326
-
327
- Arguments
328
- - pushservicetoken: *Push Services's token (from the Push Services configured for the app)*
329
-
330
-
331
200
  #### Delete
332
201
 
333
202
  Delete the stream
@@ -385,7 +254,7 @@ ziggeo.streams().bind(video_token_or_key, token_or_key, arguments = nil)
385
254
 
386
255
 
387
256
  ### Authtokens
388
-
257
+
389
258
  The auth token resource allows you to manage authorization settings for video objects.
390
259
 
391
260
 
@@ -443,358 +312,11 @@ Arguments
443
312
  - grants: *Permissions this tokens grants*
444
313
 
445
314
 
446
- ### Application
447
-
448
- The application token resource allows you to manage your application.
449
-
450
-
451
- #### Get
452
-
453
- Read application.
454
-
455
- ```ruby
456
- ziggeo.application().get()
457
- ```
458
-
459
-
460
-
461
- #### Update
462
-
463
- Update application.
464
-
465
- ```ruby
466
- ziggeo.application().update(arguments = nil)
467
- ```
468
-
469
- Arguments
470
- - volatile: *Will this object automatically be deleted if it remains empty?*
471
- - name: *Name of the application*
472
- - auth_token_required_for_create: *Require auth token for creating videos*
473
- - auth_token_required_for_update: *Require auth token for updating videos*
474
- - auth_token_required_for_read: *Require auth token for reading videos*
475
- - auth_token_required_for_destroy: *Require auth token for deleting videos*
476
- - client_can_index_videos: *Client is allowed to perform the index operation*
477
- - client_cannot_access_unaccepted_videos: *Client cannot view unaccepted videos*
478
- - enable_video_subpages: *Enable hosted video pages*
479
- - enable_facebook: *Enable Facebook Support for hosted video pages*
480
-
481
-
482
- #### Get Stats
483
-
484
- Read application stats
485
-
486
- ```ruby
487
- ziggeo.application().get_stats(arguments = nil)
488
- ```
489
-
490
- Arguments
491
- - period: *Optional. Can be 'year' or 'month'.*
492
-
493
-
494
- ### EffectProfiles
495
-
496
- The effect profiles resource allows you to access and create effect profiles for your app. Each effect profile may contain one process or more.
497
-
498
-
499
- #### Create
500
-
501
- Create a new effect profile.
502
-
503
- ```ruby
504
- ziggeo.effectProfiles().create(arguments = nil)
505
- ```
506
-
507
- Arguments
508
- - key: *Effect profile key.*
509
- - title: *Effect profile title.*
510
- - default_effect: *Boolean. If TRUE, sets an effect profile as default. If FALSE, removes the default status for the given effect*
511
-
512
-
513
- #### Index
514
-
515
- Get list of effect profiles.
516
-
517
- ```ruby
518
- ziggeo.effectProfiles().index(arguments = nil)
519
- ```
520
-
521
- Arguments
522
- - limit: *Limit the number of returned effect profiles. Can be set up to 100.*
523
- - skip: *Skip the first [n] entries.*
524
- - reverse: *Reverse the order in which effect profiles are returned.*
525
-
526
-
527
- #### Get
528
-
529
- Get a single effect profile
530
-
531
- ```ruby
532
- ziggeo.effectProfiles().get(token_or_key)
533
- ```
534
-
535
-
536
-
537
- #### Delete
538
-
539
- Delete the effect profile
540
-
541
- ```ruby
542
- ziggeo.effectProfiles().delete(token_or_key)
543
- ```
544
-
545
-
546
-
547
- #### Update
548
-
549
- Updates an effect profile.
550
-
551
- ```ruby
552
- ziggeo.effectProfiles().update(token_or_key, arguments = nil)
553
- ```
554
-
555
- Arguments
556
- - default_effect: *Boolean. If TRUE, sets an effect profile as default. If FALSE, removes the default status for the given effect*
557
-
558
-
559
- ### EffectProfileProcess
560
-
561
- The process resource allows you to directly access all process associated with a single effect profile.
562
-
563
-
564
- #### Index
565
-
566
- Return all processes associated with a effect profile
567
-
568
- ```ruby
569
- ziggeo.effectProfileProcess().index(effect_token_or_key, arguments = nil)
570
- ```
571
-
572
- Arguments
573
- - states: *Filter streams by state*
574
-
575
-
576
- #### Get
577
-
578
- Get a single process
579
-
580
- ```ruby
581
- ziggeo.effectProfileProcess().get(effect_token_or_key, token_or_key)
582
- ```
583
-
584
-
585
-
586
- #### Delete
587
-
588
- Delete the process
589
-
590
- ```ruby
591
- ziggeo.effectProfileProcess().delete(effect_token_or_key, token_or_key)
592
- ```
593
-
594
-
595
-
596
- #### Create Filter Process
597
-
598
- Create a new filter effect process
599
-
600
- ```ruby
601
- ziggeo.effectProfileProcess().create_filter_process(effect_token_or_key, arguments = nil)
602
- ```
603
-
604
- Arguments
605
- - effect: *Effect to be applied in the process*
606
-
607
-
608
- #### Create Watermark Process
609
-
610
- Attaches an image to a new stream
611
-
612
- ```ruby
613
- ziggeo.effectProfileProcess().create_watermark_process(effect_token_or_key, arguments = nil, file = nil)
614
- ```
615
-
616
- Arguments
617
- - file: *Image file to be attached*
618
- - vertical_position: *Specify the vertical position of your watermark (a value between 0.0 and 1.0)*
619
- - horizontal_position: *Specify the horizontal position of your watermark (a value between 0.0 and 1.0)*
620
- - video_scale: *Specify the image scale of your watermark (a value between 0.0 and 1.0)*
621
-
622
-
623
- ### MetaProfiles
624
-
625
- The meta profiles resource allows you to access and create meta profiles for your app. Each meta profile may contain one process or more.
626
-
627
-
628
- #### Create
629
-
630
- Create a new meta profile.
631
-
632
- ```ruby
633
- ziggeo.metaProfiles().create(arguments = nil)
634
- ```
635
-
636
- Arguments
637
- - key: *Meta Profile profile key.*
638
- - title: *Meta Profile profile title.*
639
-
640
-
641
- #### Index
642
-
643
- Get list of meta profiles.
644
-
645
- ```ruby
646
- ziggeo.metaProfiles().index(arguments = nil)
647
- ```
648
-
649
- Arguments
650
- - limit: *Limit the number of returned meta profiles. Can be set up to 100.*
651
- - skip: *Skip the first [n] entries.*
652
- - reverse: *Reverse the order in which meta profiles are returned.*
653
-
654
-
655
- #### Get
656
-
657
- Get a single meta profile
658
-
659
- ```ruby
660
- ziggeo.metaProfiles().get(token_or_key)
661
- ```
662
-
663
-
664
-
665
- #### Delete
666
-
667
- Delete the meta profile
668
-
669
- ```ruby
670
- ziggeo.metaProfiles().delete(token_or_key)
671
- ```
672
-
673
-
674
-
675
- ### MetaProfileProcess
676
-
677
- The process resource allows you to directly access all process associated with a single meta profile.
678
-
679
-
680
- #### Index
681
-
682
- Return all processes associated with a meta profile
683
-
684
- ```ruby
685
- ziggeo.metaProfileProcess().index(meta_token_or_key)
686
- ```
687
-
688
-
689
-
690
- #### Get
691
-
692
- Get a single process
693
-
694
- ```ruby
695
- ziggeo.metaProfileProcess().get(meta_token_or_key, token_or_key)
696
- ```
697
-
698
-
699
-
700
- #### Delete
701
-
702
- Delete the process
703
-
704
- ```ruby
705
- ziggeo.metaProfileProcess().delete(meta_token_or_key, token_or_key)
706
- ```
707
-
708
-
709
-
710
- #### Create Video Analysis Process
711
-
712
- Create a new video analysis meta process
713
-
714
- ```ruby
715
- ziggeo.metaProfileProcess().create_video_analysis_process(meta_token_or_key)
716
- ```
717
-
718
-
719
-
720
- #### Create Audio Transcription Process
721
-
722
- Create a new audio transcription meta process
723
-
724
- ```ruby
725
- ziggeo.metaProfileProcess().create_audio_transcription_process(meta_token_or_key)
726
- ```
727
-
728
-
729
-
730
- #### Create Nsfw Process
731
-
732
- Create a new nsfw filter meta process
733
-
734
- ```ruby
735
- ziggeo.metaProfileProcess().create_nsfw_process(meta_token_or_key, arguments = nil)
736
- ```
737
-
738
- Arguments
739
- - nsfw_action: *One of the following three: approve, reject, nothing.*
740
-
741
-
742
- ### Webhooks
743
-
744
- The webhooks resource allows you to create or delete webhooks related to a given application.
745
-
746
-
747
- #### Create
748
-
749
- Create a new webhook for the given url to catch the given events.
750
-
751
- ```ruby
752
- ziggeo.webhooks().create(arguments = nil)
753
- ```
754
-
755
- Arguments
756
- - target_url: *The url that will catch the events*
757
- - encoding: *Data encoding to be used by the webhook to send the events.*
758
- - events: *Comma-separated list of the events the webhook will catch. They must be valid webhook type events.*
759
-
760
-
761
- #### Delete
762
-
763
- Delete a webhook using its URL.
764
-
765
- ```ruby
766
- ziggeo.webhooks().delete(arguments = nil)
767
- ```
768
-
769
- Arguments
770
- - target_url: *The url that will catch the events*
771
-
772
-
773
- ### Analytics
774
-
775
- The analytics resource allows you to access the analytics for the given application
776
-
777
-
778
- #### Get
779
-
780
- Get analytics for the given params
781
-
782
- ```ruby
783
- ziggeo.analytics().get(arguments = nil)
784
- ```
785
-
786
- Arguments
787
- - from: *A UNIX timestamp in microseconds used as the start date of the query*
788
- - to: *A UNIX timestamp in microseconds used as the end date of the query*
789
- - date: *A UNIX timestamp in microseconds to retrieve data from a single date. If set, it overwrites the from and to params.*
790
- - query: *The query you want to run. It can be one of the following: device_views_by_os, device_views_by_date, total_plays_by_country, full_plays_by_country, total_plays_by_hour, full_plays_by_hour, total_plays_by_browser, full_plays_by_browser*
791
-
792
-
793
315
 
794
316
 
795
317
 
796
318
  ## License
797
319
 
798
- Copyright (c) 2013-2018 Ziggeo
320
+ Copyright (c) 2013-2016 Ziggeo
799
321
 
800
- Apache 2.0 License
322
+ Apache 2.0 License
@@ -5,129 +5,60 @@ require 'cgi'
5
5
 
6
6
  require_relative "classes/ZiggeoConfig"
7
7
  require_relative "classes/ZiggeoConnect"
8
- require_relative "classes/ZiggeoAuth"
9
8
  require_relative "classes/ZiggeoVideos"
10
9
  require_relative "classes/ZiggeoStreams"
11
10
  require_relative "classes/ZiggeoAuthtokens"
12
- require_relative "classes/ZiggeoApplication"
13
- require_relative "classes/ZiggeoEffectProfiles"
14
- require_relative "classes/ZiggeoEffectProfileProcess"
15
- require_relative "classes/ZiggeoMetaProfiles"
16
- require_relative "classes/ZiggeoMetaProfileProcess"
17
- require_relative "classes/ZiggeoWebhooks"
18
- require_relative "classes/ZiggeoAnalytics"
11
+ require_relative "classes/ZiggeoAuth"
19
12
 
20
13
  class Ziggeo
21
14
 
22
- attr_accessor :token, :private_key, :encryption_key, :config, :connect, :api_connect
23
-
24
- def initialize(token = nil, private_key = nil, encryption_key = nil)
25
- @token = token
26
- @private_key = private_key
27
- @encryption_key = encryption_key
28
- @config = ZiggeoConfig.new()
29
- server_api_url = @config.server_api_url
30
- regions = @config.regions
31
- regions.each do |key, value|
32
- if (@token.start_with?(key))
33
- server_api_url = value
34
- end
35
- end
36
- @connect = ZiggeoConnect.new(self, server_api_url)
37
- api_url = @config.api_url
38
- api_regions = @config.api_regions
39
- api_regions.each do |key, value|
40
- if (@token.start_with?(key))
41
- api_url = value
42
- end
43
- end
44
- @api_connect = ZiggeoConnect.new(self, api_url)
45
- @auth = nil
46
- @videos = nil
47
- @streams = nil
48
- @authtokens = nil
49
- @application = nil
50
- @effectProfiles = nil
51
- @effectProfileProcess = nil
52
- @metaProfiles = nil
53
- @metaProfileProcess = nil
54
- @webhooks = nil
55
- @analytics = nil
56
- if (ENV["ZIGGEO_URL"] != nil)
57
- uri = URI.parse(ENV["ZIGGEO_URL"])
58
- @config.server_api_url = uri.scheme + "://" + uri.host + ":" + uri.port.to_s
59
- @token = uri.user
60
- @private_key = uri.password
61
- query = CGI::parse(uri.query)
62
- @encryption_key = query["encryption_key"]
63
- end
15
+ attr_accessor :token, :private_key, :encryption_key, :config, :connect
16
+ def initialize(token = nil, private_key = nil, encryption_key = nil)
17
+ @token = token
18
+ @private_key = private_key
19
+ @encryption_key = encryption_key
20
+ @config = ZiggeoConfig.new()
21
+ @connect = ZiggeoConnect.new(self)
22
+ @videos = nil
23
+ @streams = nil
24
+ @authtokens = nil
25
+ @auth = nil
26
+ if (ENV["ZIGGEO_URL"] != nil)
27
+ uri = URI.parse(ENV["ZIGGEO_URL"])
28
+ @config.server_api_url = uri.scheme + "://" + uri.host + ":" + uri.port.to_s
29
+ @token = uri.user
30
+ @private_key = uri.password
31
+ query = CGI::parse(uri.query)
32
+ @encryption_key = query["encryption_key"]
64
33
  end
34
+ end
65
35
 
66
- def auth()
67
- if (@auth == nil)
68
- @auth = ZiggeoAuth.new(self)
69
- end
70
- return @auth end
71
-
72
- def videos()
73
- if (@videos == nil)
74
- @videos = ZiggeoVideos.new(self)
75
- end
76
- return @videos end
77
-
78
- def streams()
79
- if (@streams == nil)
80
- @streams = ZiggeoStreams.new(self)
81
- end
82
- return @streams end
83
-
84
- def authtokens()
85
- if (@authtokens == nil)
86
- @authtokens = ZiggeoAuthtokens.new(self)
87
- end
88
- return @authtokens end
89
-
90
- def application()
91
- if (@application == nil)
92
- @application = ZiggeoApplication.new(self)
93
- end
94
- return @application end
95
-
96
- def effectProfiles()
97
- if (@effectProfiles == nil)
98
- @effectProfiles = ZiggeoEffectProfiles.new(self)
99
- end
100
- return @effectProfiles end
101
-
102
- def effectProfileProcess()
103
- if (@effectProfileProcess == nil)
104
- @effectProfileProcess = ZiggeoEffectProfileProcess.new(self)
105
- end
106
- return @effectProfileProcess end
107
-
108
- def metaProfiles()
109
- if (@metaProfiles == nil)
110
- @metaProfiles = ZiggeoMetaProfiles.new(self)
111
- end
112
- return @metaProfiles end
113
-
114
- def metaProfileProcess()
115
- if (@metaProfileProcess == nil)
116
- @metaProfileProcess = ZiggeoMetaProfileProcess.new(self)
117
- end
118
- return @metaProfileProcess end
36
+ def videos()
37
+ if (@videos == nil)
38
+ @videos = ZiggeoVideos.new(self)
39
+ end
40
+ return @videos
41
+ end
119
42
 
120
- def webhooks()
121
- if (@webhooks == nil)
122
- @webhooks = ZiggeoWebhooks.new(self)
123
- end
124
- return @webhooks end
43
+ def streams()
44
+ if (@streams == nil)
45
+ @streams = ZiggeoStreams.new(self)
46
+ end
47
+ return @streams
48
+ end
125
49
 
126
- def analytics()
127
- if (@analytics == nil)
128
- @analytics = ZiggeoAnalytics.new(self)
129
- end
130
- return @analytics end
50
+ def authtokens()
51
+ if (@authtokens == nil)
52
+ @authtokens = ZiggeoAuthtokens.new(self)
53
+ end
54
+ return @authtokens
55
+ end
131
56
 
57
+ def auth()
58
+ if (@auth == nil)
59
+ @auth = ZiggeoAuth.new(self)
60
+ end
61
+ return @auth
62
+ end
132
63
 
133
64
  end
@@ -5,19 +5,19 @@ class ZiggeoAuthtokens
5
5
  end
6
6
 
7
7
  def get(token)
8
- return @application.connect.getJSON('/v1/authtokens/' + token + '')
8
+ return @application.connect.getJSON('/authtokens/' + token + '')
9
9
  end
10
10
 
11
11
  def update(token_or_key, data = nil)
12
- return @application.connect.postJSON('/v1/authtokens/' + token_or_key + '', data)
12
+ return @application.connect.postJSON('/authtokens/' + token_or_key + '', data)
13
13
  end
14
14
 
15
15
  def delete(token_or_key)
16
- return @application.connect.delete('/v1/authtokens/' + token_or_key + '')
16
+ return @application.connect.delete('/authtokens/' + token_or_key + '')
17
17
  end
18
18
 
19
19
  def create(data = nil)
20
- return @application.connect.postJSON('/v1/authtokens/', data)
20
+ return @application.connect.postJSON('/authtokens/', data)
21
21
  end
22
22
 
23
23
  end
@@ -1,13 +1,7 @@
1
-
2
1
  class ZiggeoConfig
3
- attr_accessor :server_api_url, :api_url, :request_timeout, :request_timeout_per_mb, :regions, :api_regions
2
+ attr_accessor :server_api_url
4
3
 
5
4
  def initialize()
6
- @request_timeout = 30 # seconds
7
- @request_timeout_per_mb = 20 # seconds per MB of uploaded file
8
5
  @server_api_url = "https://srvapi.ziggeo.com"
9
- @api_url = "https://api-us-east-1.ziggeo.com"
10
- @regions = {"r1" => "https://srvapi-eu-west-1.ziggeo.com", }
11
- @api_regions = {"r1" => "https://api-eu-west-1.ziggeo.com", }
12
6
  end
13
7
  end
@@ -4,44 +4,27 @@ require 'httparty'
4
4
  require 'httmultiparty'
5
5
 
6
6
  class ZiggeoConnect
7
- def initialize(application, baseuri)
7
+ def initialize(application)
8
8
  @application = application
9
- @baseuri = baseuri
10
9
  end
11
10
 
12
11
  def request(method, path, data = nil, file = nil)
13
- url = URI.parse(@baseuri + path)
12
+ url = URI.parse(@application.config.server_api_url + '/v1' + path)
14
13
  auth = { username: @application.token, password: @application.private_key }
15
- timeout_in_seconds = @application.config.request_timeout.to_i
16
-
17
14
  method.downcase!
18
15
  allowed_methods = %w(get post delete)
19
16
  return unless allowed_methods.include?(method)
20
17
  if (file.nil?)
21
18
  if (method == "get")
22
- begin
23
- HTTParty.send(method, url.to_s, query: data, basic_auth: auth, timeout: timeout_in_seconds).body
24
- rescue Net::ReadTimeout => error
25
- self.timeout_error_message timeout_in_seconds, error
26
- end
19
+ HTTParty.send(method, url.to_s, query: data, basic_auth: auth).body
27
20
  else
28
- begin
29
- HTTParty.send(method, url.to_s, body: data, basic_auth: auth, timeout: timeout_in_seconds).body
30
- rescue Net::ReadTimeout => error
31
- self.timeout_error_message timeout_in_seconds, error
32
- end
21
+ HTTParty.send(method, url.to_s, body: data, basic_auth: auth).body
33
22
  end
34
23
  else
35
24
  data = data.nil? ? {} : data;
36
25
  data["file"] = File.new(file)
37
- timeout_in_seconds = ( ( File.size(file).to_f / 2**20 ).round(0) * @application.config.request_timeout_per_mb.to_i ).to_i;
38
-
39
- begin
40
- HTTMultiParty.send(method, url.to_s, body: data, basic_auth: auth, timeout: timeout_in_seconds).body
41
- rescue Net::ReadTimeout => error
42
- self.timeout_error_message timeout_in_seconds, error
43
- end
44
- end
26
+ HTTMultiParty.send(method, url.to_s, body: data, basic_auth: auth).body
27
+ end
45
28
  end
46
29
 
47
30
  def requestJSON(method, path, data = nil, file = nil)
@@ -72,12 +55,4 @@ class ZiggeoConnect
72
55
  return self.requestJSON("DELETE", path, data, file)
73
56
  end
74
57
 
75
- protected
76
-
77
- def timeout_error_message( timeout_in_seconds, error )
78
- puts "Error source: " + error.message
79
- puts "Server not responding. Host: #{@application.config.server_api_url} not responded in #{timeout_in_seconds} seconds."
80
- exit(1)
81
- end
82
-
83
58
  end
@@ -5,43 +5,39 @@ class ZiggeoStreams
5
5
  end
6
6
 
7
7
  def index(video_token_or_key, data = nil)
8
- return @application.connect.getJSON('/v1/videos/' + video_token_or_key + '/streams', data)
8
+ return @application.connect.getJSON('/videos/' + video_token_or_key + '/streams', data)
9
9
  end
10
10
 
11
11
  def get(video_token_or_key, token_or_key)
12
- return @application.connect.getJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '')
12
+ return @application.connect.getJSON('/videos/' + video_token_or_key + '/streams/' + token_or_key + '')
13
13
  end
14
14
 
15
15
  def download_video(video_token_or_key, token_or_key)
16
- return @application.connect.get('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/video')
16
+ return @application.connect.get('/videos/' + video_token_or_key + '/streams/' + token_or_key + '/video')
17
17
  end
18
18
 
19
19
  def download_image(video_token_or_key, token_or_key)
20
- return @application.connect.get('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/image')
21
- end
22
-
23
- def push_to_service(video_token_or_key, token_or_key, data = nil)
24
- return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/push', data)
20
+ return @application.connect.get('/videos/' + video_token_or_key + '/streams/' + token_or_key + '/image')
25
21
  end
26
22
 
27
23
  def delete(video_token_or_key, token_or_key)
28
- return @application.connect.delete('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '')
24
+ return @application.connect.delete('/videos/' + video_token_or_key + '/streams/' + token_or_key + '')
29
25
  end
30
26
 
31
27
  def create(video_token_or_key, data = nil, file = nil)
32
- return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams', data, file)
28
+ return @application.connect.postJSON('/videos/' + video_token_or_key + '/streams', data, file)
33
29
  end
34
30
 
35
31
  def attach_image(video_token_or_key, token_or_key, data = nil, file = nil)
36
- return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/image', data, file)
32
+ return @application.connect.postJSON('/videos/' + video_token_or_key + '/streams/' + token_or_key + '/image', data, file)
37
33
  end
38
34
 
39
35
  def attach_video(video_token_or_key, token_or_key, data = nil, file = nil)
40
- return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/video', data, file)
36
+ return @application.connect.postJSON('/videos/' + video_token_or_key + '/streams/' + token_or_key + '/video', data, file)
41
37
  end
42
38
 
43
39
  def bind(video_token_or_key, token_or_key)
44
- return @application.connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/bind')
40
+ return @application.connect.postJSON('/videos/' + video_token_or_key + '/streams/' + token_or_key + '/bind')
45
41
  end
46
42
 
47
43
  end
@@ -5,67 +5,31 @@ class ZiggeoVideos
5
5
  end
6
6
 
7
7
  def index(data = nil)
8
- return @application.connect.getJSON('/v1/videos/', data)
9
- end
10
-
11
- def count(data = nil)
12
- return @application.connect.getJSON('/v1/videos/count', data)
8
+ return @application.connect.getJSON('/videos/', data)
13
9
  end
14
10
 
15
11
  def get(token_or_key)
16
- return @application.connect.getJSON('/v1/videos/' + token_or_key + '')
17
- end
18
-
19
- def get_bulk(data = nil)
20
- return @application.connect.postJSON('/v1/videos/get_bulk', data)
21
- end
22
-
23
- def stats_bulk(data = nil)
24
- return @application.connect.postJSON('/v1/videos/stats_bulk', data)
12
+ return @application.connect.getJSON('/videos/' + token_or_key + '')
25
13
  end
26
14
 
27
15
  def download_video(token_or_key)
28
- return @application.connect.get('/v1/videos/' + token_or_key + '/video')
16
+ return @application.connect.get('/videos/' + token_or_key + '/video')
29
17
  end
30
18
 
31
19
  def download_image(token_or_key)
32
- return @application.connect.get('/v1/videos/' + token_or_key + '/image')
33
- end
34
-
35
- def get_stats(token_or_key)
36
- return @application.connect.getJSON('/v1/videos/' + token_or_key + '/stats')
37
- end
38
-
39
- def push_to_service(token_or_key, data = nil)
40
- return @application.connect.postJSON('/v1/videos/' + token_or_key + '/push', data)
41
- end
42
-
43
- def apply_effect(token_or_key, data = nil)
44
- return @application.connect.postJSON('/v1/videos/' + token_or_key + '/effect', data)
45
- end
46
-
47
- def apply_meta(token_or_key, data = nil)
48
- return @application.connect.postJSON('/v1/videos/' + token_or_key + '/metaprofile', data)
20
+ return @application.connect.get('/videos/' + token_or_key + '/image')
49
21
  end
50
22
 
51
23
  def update(token_or_key, data = nil)
52
- return @application.connect.postJSON('/v1/videos/' + token_or_key + '', data)
53
- end
54
-
55
- def update_bulk(data = nil)
56
- return @application.connect.postJSON('/v1/videos/update_bulk', data)
24
+ return @application.connect.postJSON('/videos/' + token_or_key + '', data)
57
25
  end
58
26
 
59
27
  def delete(token_or_key)
60
- return @application.connect.delete('/v1/videos/' + token_or_key + '')
28
+ return @application.connect.delete('/videos/' + token_or_key + '')
61
29
  end
62
30
 
63
31
  def create(data = nil, file = nil)
64
- return @application.connect.postJSON('/v1/videos/', data, file)
65
- end
66
-
67
- def analytics(token_or_key, data = nil)
68
- return @application.connect.postJSON('/v1/videos/' + token_or_key + '/analytics', data)
32
+ return @application.connect.postJSON('/videos/', data, file)
69
33
  end
70
34
 
71
35
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Ziggeo
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.8'
4
+ version: '1.14'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziggeo, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-17 00:00:00.000000000 Z
11
+ date: 2016-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.13.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.13.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: httmultiparty
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: The Ziggeo Ruby and Rails Server SDK.
@@ -45,24 +45,17 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - README.md
49
- - lib/Ziggeo.rb
50
- - lib/classes/ZiggeoAnalytics.rb
51
- - lib/classes/ZiggeoApplication.rb
52
48
  - lib/classes/ZiggeoAuth.rb
53
49
  - lib/classes/ZiggeoAuthtokens.rb
54
50
  - lib/classes/ZiggeoConfig.rb
55
51
  - lib/classes/ZiggeoConnect.rb
56
- - lib/classes/ZiggeoEffectProfileProcess.rb
57
- - lib/classes/ZiggeoEffectProfiles.rb
58
- - lib/classes/ZiggeoMetaProfileProcess.rb
59
- - lib/classes/ZiggeoMetaProfiles.rb
60
52
  - lib/classes/ZiggeoStreams.rb
61
53
  - lib/classes/ZiggeoVideos.rb
62
- - lib/classes/ZiggeoWebhooks.rb
63
- homepage: https://ziggeo.com
54
+ - lib/Ziggeo.rb
55
+ - README.md
56
+ homepage: http://ziggeo.com
64
57
  licenses:
65
- - Apache-2.0
58
+ - Apache 2.0
66
59
  metadata: {}
67
60
  post_install_message:
68
61
  rdoc_options: []
@@ -70,17 +63,17 @@ require_paths:
70
63
  - lib
71
64
  required_ruby_version: !ruby/object:Gem::Requirement
72
65
  requirements:
73
- - - ">="
66
+ - - '>='
74
67
  - !ruby/object:Gem::Version
75
68
  version: '0'
76
69
  required_rubygems_version: !ruby/object:Gem::Requirement
77
70
  requirements:
78
- - - ">="
71
+ - - '>='
79
72
  - !ruby/object:Gem::Version
80
73
  version: '0'
81
74
  requirements: []
82
75
  rubyforge_project:
83
- rubygems_version: 2.5.2.3
76
+ rubygems_version: 2.0.14.1
84
77
  signing_key:
85
78
  specification_version: 4
86
79
  summary: The Ziggeo ServerSDK gem.
@@ -1,11 +0,0 @@
1
- class ZiggeoAnalytics
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def get(data = nil)
8
- return @application.connect.postJSON('/v1/analytics/get', data)
9
- end
10
-
11
- end
@@ -1,19 +0,0 @@
1
- class ZiggeoApplication
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def get()
8
- return @application.connect.getJSON('/v1/application')
9
- end
10
-
11
- def update(data = nil)
12
- return @application.connect.postJSON('/v1/application', data)
13
- end
14
-
15
- def get_stats(data = nil)
16
- return @application.api_connect.getJSON('/server/v1/application/stats', data)
17
- end
18
-
19
- end
@@ -1,27 +0,0 @@
1
- class ZiggeoEffectProfileProcess
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def index(effect_token_or_key, data = nil)
8
- return @application.connect.getJSON('/v1/effects/' + effect_token_or_key + '/process', data)
9
- end
10
-
11
- def get(effect_token_or_key, token_or_key)
12
- return @application.connect.getJSON('/v1/effects/' + effect_token_or_key + '/process/' + token_or_key + '')
13
- end
14
-
15
- def delete(effect_token_or_key, token_or_key)
16
- return @application.connect.delete('/v1/effects/' + effect_token_or_key + '/process/' + token_or_key + '')
17
- end
18
-
19
- def create_filter_process(effect_token_or_key, data = nil)
20
- return @application.connect.postJSON('/v1/effects/' + effect_token_or_key + '/process/filter', data)
21
- end
22
-
23
- def create_watermark_process(effect_token_or_key, data = nil, file = nil)
24
- return @application.connect.postJSON('/v1/effects/' + effect_token_or_key + '/process/watermark', data, file)
25
- end
26
-
27
- end
@@ -1,27 +0,0 @@
1
- class ZiggeoEffectProfiles
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def create(data = nil)
8
- return @application.connect.postJSON('/v1/effects/', data)
9
- end
10
-
11
- def index(data = nil)
12
- return @application.connect.getJSON('/v1/effects/', data)
13
- end
14
-
15
- def get(token_or_key)
16
- return @application.connect.getJSON('/v1/effects/' + token_or_key + '')
17
- end
18
-
19
- def delete(token_or_key)
20
- return @application.connect.delete('/v1/effects/' + token_or_key + '')
21
- end
22
-
23
- def update(token_or_key, data = nil)
24
- return @application.connect.postJSON('/v1/effects/' + token_or_key + '', data)
25
- end
26
-
27
- end
@@ -1,31 +0,0 @@
1
- class ZiggeoMetaProfileProcess
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def index(meta_token_or_key)
8
- return @application.connect.getJSON('/v1/metaprofiles/' + meta_token_or_key + '/process')
9
- end
10
-
11
- def get(meta_token_or_key, token_or_key)
12
- return @application.connect.getJSON('/v1/metaprofiles/' + meta_token_or_key + '/process/' + token_or_key + '')
13
- end
14
-
15
- def delete(meta_token_or_key, token_or_key)
16
- return @application.connect.delete('/v1/metaprofiles/' + meta_token_or_key + '/process/' + token_or_key + '')
17
- end
18
-
19
- def create_video_analysis_process(meta_token_or_key)
20
- return @application.connect.postJSON('/v1/metaprofiles/' + meta_token_or_key + '/process/analysis')
21
- end
22
-
23
- def create_audio_transcription_process(meta_token_or_key)
24
- return @application.connect.postJSON('/v1/metaprofiles/' + meta_token_or_key + '/process/transcription')
25
- end
26
-
27
- def create_nsfw_process(meta_token_or_key, data = nil)
28
- return @application.connect.postJSON('/v1/metaprofiles/' + meta_token_or_key + '/process/nsfw', data)
29
- end
30
-
31
- end
@@ -1,23 +0,0 @@
1
- class ZiggeoMetaProfiles
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def create(data = nil)
8
- return @application.connect.postJSON('/v1/metaprofiles/', data)
9
- end
10
-
11
- def index(data = nil)
12
- return @application.connect.getJSON('/v1/metaprofiles/', data)
13
- end
14
-
15
- def get(token_or_key)
16
- return @application.connect.getJSON('/v1/metaprofiles/' + token_or_key + '')
17
- end
18
-
19
- def delete(token_or_key)
20
- return @application.connect.delete('/v1/metaprofiles/' + token_or_key + '')
21
- end
22
-
23
- end
@@ -1,15 +0,0 @@
1
- class ZiggeoWebhooks
2
-
3
- def initialize(application)
4
- @application = application
5
- end
6
-
7
- def create(data = nil)
8
- return @application.connect.post('/v1/api/hook', data)
9
- end
10
-
11
- def delete(data = nil)
12
- return @application.connect.post('/v1/api/removehook', data)
13
- end
14
-
15
- end