ziggeo
Advanced tools
Comparing version 0.1.27 to 0.1.28
/*! | ||
ziggeo - v0.1.27 - 2022-01-16 | ||
ziggeo - v0.1.28 - 2022-02-13 | ||
Copyright (c) | ||
@@ -14,4 +14,4 @@ Apache-2.0 Software License. | ||
"guid": "dc4166d4-b177-4212-abd5-ab255907a7d8", | ||
"version": "0.1.27", | ||
"datetime": 1642352727782 | ||
"version": "0.1.28", | ||
"datetime": 1644781229582 | ||
}; | ||
@@ -68,2 +68,128 @@ }); | ||
Scoped.define('module:Audio_streams', ['base:Class'], function (Class, scoped) { | ||
return Class.extend({scoped: scoped}, function (inherited) { | ||
return { | ||
constructor: function (Connect, ApiConnect, CdnConnect) { | ||
inherited.constructor.call(this); | ||
this.Connect = Connect; | ||
this.ApiConnect = ApiConnect; | ||
this.CdnConnect = CdnConnect; | ||
}, | ||
index: function (audio_token_or_key, data, callbacks) { | ||
this.ApiConnect.getJSON('/server/v1/audios/bytoken/' + audio_token_or_key + '/streams', callbacks, data); | ||
}, | ||
get: function (audio_token_or_key, token_or_key, callbacks) { | ||
this.ApiConnect.getJSON('/server/v1/audios/bytoken/' + audio_token_or_key + '/streams/bytoken/' + token_or_key + '', callbacks); | ||
}, | ||
download_audio: function (audio_token_or_key, token_or_key, callbacks) { | ||
this.Connect.getBinary('/v1/server/v1/audios/bytoken/' + audio_token_or_key + '/streams/bytoken/' + token_or_key + '/audio', callbacks); | ||
}, | ||
destroy: function (audio_token_or_key, token_or_key, callbacks) { | ||
this.ApiConnect.destroy('/server/v1/audios/bytoken/' + audio_token_or_key + '/streams/bytoken/' + token_or_key + '', callbacks); | ||
}, | ||
create: function (audio_token_or_key, data, callbacks) { | ||
var file = null; | ||
if (data && data.file) { | ||
file = data.file; | ||
delete data.file; | ||
} | ||
if (file) { | ||
self = this; | ||
this.Connect.postUploadJSON('/server/v1/audios/' + video_token_or_key + '/streams-upload-url', { | ||
failure: callbacks ? callbacks.failure : null, | ||
success: function (result) { | ||
self.Connect.postJSON('/server/v1/audios/' + video_token_or_key + '/streams/' + result['token'] + '/confirm-video', { | ||
failure: callbacks ? callbacks.failure : null, | ||
success: function (resultInner) { | ||
result = resultInner; | ||
if (callbacks && callbacks.success) callbacks.success(result); | ||
} | ||
}); | ||
} | ||
}, 'stream', data, file, 'video_type'); | ||
} else | ||
this.ApiConnect.postJSON('/server/v1/audios/bytoken/' + audio_token_or_key + '/streams', callbacks, data, file); | ||
} | ||
}; | ||
}); | ||
}); | ||
Scoped.define('module:Audios', ['base:Class'], function (Class, scoped) { | ||
return Class.extend({scoped: scoped}, function (inherited) { | ||
return { | ||
constructor: function (Connect, ApiConnect, CdnConnect) { | ||
inherited.constructor.call(this); | ||
this.Connect = Connect; | ||
this.ApiConnect = ApiConnect; | ||
this.CdnConnect = CdnConnect; | ||
}, | ||
index: function (data, callbacks) { | ||
this.ApiConnect.getJSON('/server/v1/audios/', callbacks, data); | ||
}, | ||
count: function (data, callbacks) { | ||
this.ApiConnect.getJSON('/server/v1/audios/count', callbacks, data); | ||
}, | ||
get: function (token_or_key, callbacks) { | ||
this.ApiConnect.getJSON('/server/v1/audios/bytoken/' + token_or_key + '', callbacks); | ||
}, | ||
get_bulk: function (data, callbacks) { | ||
this.ApiConnect.postJSON('/server/v1/audios/get-bulk', callbacks, data); | ||
}, | ||
download_audio: function (token_or_key, callbacks) { | ||
this.Connect.getBinary('/v1/server/v1/audios/bytoken/' + token_or_key + '/video', callbacks); | ||
}, | ||
update: function (token_or_key, data, callbacks) { | ||
this.ApiConnect.postJSON('/server/v1/audios/bytoken/' + token_or_key + '', callbacks, data); | ||
}, | ||
update_bulk: function (data, callbacks) { | ||
this.ApiConnect.postJSON('/server/v1/audios/update-bulk', callbacks, data); | ||
}, | ||
destroy: function (token_or_key, callbacks) { | ||
this.ApiConnect.destroy('/server/v1/audios/bytoken/' + token_or_key + '', callbacks); | ||
}, | ||
create: function (data, callbacks) { | ||
var file = null; | ||
if (data && data.file) { | ||
file = data.file; | ||
delete data.file; | ||
} | ||
if (file) { | ||
self = this; | ||
this.Connect.postUploadJSON('/server/v1/audios/audios-upload-url', { | ||
failure: callbacks ? callbacks.failure : null, | ||
success: function (result) { | ||
self.Connect.postJSON('/server/v1/audios/' + result['token'] + '/streams/' + result['default_stream']['token'] + '/confirm-audio', { | ||
failure: callbacks ? callbacks.failure : null, | ||
success: function (resultInner) { | ||
result['default_stream'] = resultInner; | ||
if (callbacks && callbacks.success) callbacks.success(result); | ||
} | ||
}); | ||
} | ||
}, 'audio', data, file, 'audio_type'); | ||
} else | ||
this.ApiConnect.postJSON('/server/v1/audios/', callbacks, data, file); | ||
} | ||
}; | ||
}); | ||
}); | ||
Scoped.define("module:Auth", [ | ||
@@ -634,6 +760,2 @@ "base:Class", | ||
this.Connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/subtitle', callbacks, data); | ||
}, | ||
bind: function (video_token_or_key, token_or_key, callbacks) { | ||
this.Connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/bind', callbacks); | ||
} | ||
@@ -640,0 +762,0 @@ |
{ | ||
"name": "ziggeo", | ||
"description": "Ziggeo API (https://ziggeo.com) allows you to integrate video recording and playback with only two lines of code in your site, service or app. This is the NodeJS Server SDK.", | ||
"version": "0.1.27", | ||
"version": "0.1.28", | ||
"author": "Ziggeo", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/Ziggeo/ZiggeoNodeSdk.git", |
219
README.md
# Ziggeo's Node.js Server SDK | ||
latest version: **0.1.27** | ||
latest version: **0.1.28** | ||
@@ -44,4 +44,19 @@ ## Index | ||
10. [Streams Attach Subtitle](#method-streams-attach-subtitle) | ||
11. [Streams Bind](#method-streams-bind) | ||
5. [Methods for Authtokens](#method-authtokens) | ||
5. [Methods for Audios](#method-audios) | ||
1. [Audios Index](#method-audios-index) | ||
2. [Audios Count](#method-audios-count) | ||
3. [Audios Get](#method-audios-get) | ||
4. [Audios Get Bulk](#method-audios-get-bulk) | ||
5. [Audios Download Audio](#method-audios-download-audio) | ||
6. [Audios Update](#method-audios-update) | ||
7. [Audios Update Bulk](#method-audios-update-bulk) | ||
8. [Audios Destroy](#method-audios-destroy) | ||
9. [Audios Create](#method-audios-create) | ||
6. [Methods for Audio_streams](#method-audio-streams) | ||
1. [Audio_streams Index](#method-audio-streams-index) | ||
2. [Audio_streams Get](#method-audio-streams-get) | ||
3. [Audio_streams Download Audio](#method-audio-streams-download-audio) | ||
4. [Audio_streams Destroy](#method-audio-streams-destroy) | ||
5. [Audio_streams Create](#method-audio-streams-create) | ||
7. [Methods for Authtokens](#method-authtokens) | ||
1. [Authtokens Get](#method-authtokens-get) | ||
@@ -51,7 +66,7 @@ 2. [Authtokens Update](#method-authtokens-update) | ||
4. [Authtokens Create](#method-authtokens-create) | ||
6. [Methods for Application](#method-application) | ||
8. [Methods for Application](#method-application) | ||
1. [Application Get](#method-application-get) | ||
2. [Application Update](#method-application-update) | ||
3. [Application Get Stats](#method-application-get-stats) | ||
7. [Methods for Effect Profiles](#method-effect-profiles) | ||
9. [Methods for Effect Profiles](#method-effect-profiles) | ||
1. [Effect Profiles Create](#method-effect-profiles-create) | ||
@@ -62,3 +77,3 @@ 2. [Effect Profiles Index](#method-effect-profiles-index) | ||
5. [Effect Profiles Update](#method-effect-profiles-update) | ||
8. [Methods for Effect Profile Process](#method-effect-profile-process) | ||
10. [Methods for Effect Profile Process](#method-effect-profile-process) | ||
1. [Effect Profile Process Index](#method-effect-profile-process-index) | ||
@@ -70,3 +85,3 @@ 2. [Effect Profile Process Get](#method-effect-profile-process-get) | ||
6. [Effect Profile Process Edit Watermark Process](#method-effect-profile-process-edit-watermark-process) | ||
9. [Methods for Meta Profiles](#method-meta-profiles) | ||
11. [Methods for Meta Profiles](#method-meta-profiles) | ||
1. [Meta Profiles Create](#method-meta-profiles-create) | ||
@@ -76,3 +91,3 @@ 2. [Meta Profiles Index](#method-meta-profiles-index) | ||
4. [Meta Profiles Destroy](#method-meta-profiles-destroy) | ||
10. [Methods for Meta Profile Process](#method-meta-profile-process) | ||
12. [Methods for Meta Profile Process](#method-meta-profile-process) | ||
1. [Meta Profile Process Index](#method-meta-profile-process-index) | ||
@@ -85,7 +100,7 @@ 2. [Meta Profile Process Get](#method-meta-profile-process-get) | ||
7. [Meta Profile Process Create Profanity Process](#method-meta-profile-process-create-profanity-process) | ||
11. [Methods for Webhooks](#method-webhooks) | ||
13. [Methods for Webhooks](#method-webhooks) | ||
1. [Webhooks Create](#method-webhooks-create) | ||
2. [Webhooks Confirm](#method-webhooks-confirm) | ||
3. [Webhooks Destroy](#method-webhooks-destroy) | ||
12. [Methods for Analytics](#method-analytics) | ||
14. [Methods for Analytics](#method-analytics) | ||
1. [Analytics Get](#method-analytics-get) | ||
@@ -183,10 +198,12 @@ 5. [License](#license) | ||
2. Streams | ||
3. Authtokens | ||
4. Application | ||
5. Effect Profiles | ||
6. Effect Profile Process | ||
7. Meta Profiles | ||
8. Meta Profile Process | ||
9. Webhooks | ||
10. Analytics | ||
3. Audios | ||
4. Audio_streams | ||
5. Authtokens | ||
6. Application | ||
7. Effect Profiles | ||
8. Effect Profile Process | ||
9. Meta Profiles | ||
10. Meta Profile Process | ||
11. Webhooks | ||
12. Analytics | ||
@@ -464,3 +481,3 @@ Each of this sections has their own actions and they are explained bellow | ||
Attaches an image to a new stream | ||
Attaches an image to a new stream. Must be attached before video, since video upload triggers the transcoding job and binds the stream | ||
@@ -498,12 +515,170 @@ ```node | ||
#### Bind<a name="method-streams-bind"></a> | ||
### Audios<a name="method-audios"></a> | ||
Closes and submits the stream | ||
The audios resource allows you to access all single audios. Each video may contain more than one stream. | ||
#### Index<a name="method-audios-index"></a> | ||
Query an array of audios (will return at most 50 audios by default). Newest audios come first. | ||
```node | ||
ZiggeoSdk.Streams.bind(video_token_or_key, token_or_key, arguments, [callbacks]) | ||
ZiggeoSdk.Audios.index(arguments, [callbacks]) | ||
``` | ||
Arguments | ||
- limit: *Limit the number of returned audios. Can be set up to 100.* | ||
- skip: *Skip the first [n] entries.* | ||
- reverse: *Reverse the order in which audios are returned.* | ||
- states: *Filter audios by state* | ||
- tags: *Filter the search result to certain tags, encoded as a comma-separated string* | ||
#### Count<a name="method-audios-count"></a> | ||
Get the audio count for the application. | ||
```node | ||
ZiggeoSdk.Audios.count(arguments, [callbacks]) | ||
``` | ||
Arguments | ||
- states: *Filter audios by state* | ||
- tags: *Filter the search result to certain tags, encoded as a comma-separated string* | ||
#### Get<a name="method-audios-get"></a> | ||
Get a single audio by token or key. | ||
```node | ||
ZiggeoSdk.Audios.get(token_or_key, [callbacks]) | ||
``` | ||
#### Get Bulk<a name="method-audios-get-bulk"></a> | ||
Get multiple audios by tokens or keys. | ||
```node | ||
ZiggeoSdk.Audios.get_bulk(arguments, [callbacks]) | ||
``` | ||
Arguments | ||
- tokens_or_keys: *Comma-separated list with the desired audios tokens or keys (Limit: 100 tokens or keys).* | ||
#### Download Audio<a name="method-audios-download-audio"></a> | ||
Download the audio data file | ||
```node | ||
ZiggeoSdk.Audios.download_audio(token_or_key, [callbacks]) | ||
``` | ||
#### Update<a name="method-audios-update"></a> | ||
Update single audio by token or key. | ||
```node | ||
ZiggeoSdk.Audios.update(token_or_key, arguments, [callbacks]) | ||
``` | ||
Arguments | ||
- min_duration: *Minimal duration of audio* | ||
- max_duration: *Maximal duration of audio* | ||
- tags: *Audio Tags* | ||
- key: *Unique (optional) name of audio* | ||
- volatile: *Automatically removed this audio if it remains empty* | ||
- expiration_days: *After how many days will this audio be deleted* | ||
- expire_on: *On which date will this audio be deleted. String in ISO 8601 format: YYYY-MM-DD* | ||
#### Update Bulk<a name="method-audios-update-bulk"></a> | ||
Update multiple audios by token or key. | ||
```node | ||
ZiggeoSdk.Audios.update_bulk(arguments, [callbacks]) | ||
``` | ||
Arguments | ||
- tokens_or_keys: *Comma-separated list with the desired audios tokens or keys (Limit: 100 tokens or keys).* | ||
- min_duration: *Minimal duration of audio* | ||
- max_duration: *Maximal duration of audio* | ||
- tags: *Audio Tags* | ||
- volatile: *Automatically removed this audio if it remains empty* | ||
- expiration_days: *After how many days will this audio be deleted* | ||
- expire_on: *On which date will this audio be deleted. String in ISO 8601 format: YYYY-MM-DD* | ||
#### Delete<a name="method-audios-delete"></a> | ||
Delete a single audio by token or key. | ||
```node | ||
ZiggeoSdk.Audios.destroy(token_or_key, [callbacks]) | ||
``` | ||
#### Create<a name="method-audios-create"></a> | ||
Create a new audio. | ||
```node | ||
ZiggeoSdk.Audios.create(arguments, [callbacks]) | ||
``` | ||
Arguments | ||
- file: *Audio file to be uploaded* | ||
- min_duration: *Minimal duration of audio* | ||
- max_duration: *Maximal duration of audio* | ||
- tags: *Audio Tags* | ||
- key: *Unique (optional) name of audio* | ||
- volatile: *Automatically removed this video if it remains empty* | ||
### Audio_streams<a name="method-audio-streams"></a> | ||
The streams resource allows you to directly access all streams associated with a single audio. | ||
#### Index<a name="method-audio-streams-index"></a> | ||
Return all streams associated with a audio | ||
```node | ||
ZiggeoSdk.Audio_streams.index(audio_token_or_key, arguments, [callbacks]) | ||
``` | ||
Arguments | ||
- states: *Filter streams by state* | ||
#### Get<a name="method-audio-streams-get"></a> | ||
Get a single stream | ||
```node | ||
ZiggeoSdk.Audio_streams.get(audio_token_or_key, token_or_key, [callbacks]) | ||
``` | ||
#### Download Audio<a name="method-audio-streams-download-audio"></a> | ||
Download the audio data associated with the stream | ||
```node | ||
ZiggeoSdk.Audio_streams.download_audio(audio_token_or_key, token_or_key, [callbacks]) | ||
``` | ||
#### Delete<a name="method-audio-streams-delete"></a> | ||
Delete the stream | ||
```node | ||
ZiggeoSdk.Audio_streams.destroy(audio_token_or_key, token_or_key, [callbacks]) | ||
``` | ||
#### Create<a name="method-audio-streams-create"></a> | ||
Create a new stream | ||
```node | ||
ZiggeoSdk.Audio_streams.create(audio_token_or_key, arguments, [callbacks]) | ||
``` | ||
Arguments | ||
- file: *Audio file to be uploaded* | ||
### Authtokens<a name="method-authtokens"></a> | ||
@@ -510,0 +685,0 @@ |
@@ -110,6 +110,2 @@ Scoped.define('module:Streams', ['base:Class'], function (Class, scoped) { | ||
this.Connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/subtitle', callbacks, data); | ||
}, | ||
bind: function (video_token_or_key, token_or_key, callbacks) { | ||
this.Connect.postJSON('/v1/videos/' + video_token_or_key + '/streams/' + token_or_key + '/bind', callbacks); | ||
} | ||
@@ -116,0 +112,0 @@ |
152672
80
2675
1082