npm install --save tupu-node-sdk
- Please contact our customer support, to specify your requirements, and apply account / secretId;
- After logined, follow these steps to generate your authorization private / public keys.
- test/image.test.js
- test/text.test.js
- test/video.test.js
var tupu = new TUPU(secretId, privateKeyPath, options)
secretId
your secretId, contact us to apply your own secretIdprivateKeyPath
/path/to/your/private/key.pemoptions
default: { timeout: 30 * 1000 domain: 'api.open.tuputech.com' # contact us for the other valid values }
tupu.byURLs(urls, options, cb) → {*}
urls
[ 'http://sample.com/path/image.png', 'http://sample.com/path/images.zip' ]options
[optional], {tag: Array | String, uid: String}cb
function(data) 'data' is a json, detail specification can be found here.
tupu.byFiles(files, options, cb) → {*}
files
[ '/path/to/file1.jpg', '/path/to/file2.zip' ]options
[optional], {tag: Array | String, uid: String}cb
function(data) 'data' is a json, detail specification can be found here.
tupu.byStreams(streams, options, cb) → {*}
streams
[ read stream1 , read stream2 ]options
[optional], {tag: Array | String, uid: String}cb
function(data) 'data' is a json, detail specification can be found here.
tupu.byTexts(texts, options, cb) → {*}
texts
[ {content: 'some text', contentId: 'your_contentId', ...others}]cb
function(data) 'data' is a json, detail specification can be found here.
tupu.videoSyncByUrl(url, options, cb) → {*}
url
'http://sample.com/path/video.mp4'options
[optional], {interval: Number | maxFrames: Number | tag: String}cb
function(data) 'data' is a json, detail specification can be found here.
tupu.videoSyncByFile(file, options, cb) → {*}
file
'/path/to/video.mp4'options
[optional], {interval: Number | maxFrames: Number | tag: String}cb
function(data) 'data' is a json, detail specification can be found here.
tupu.videoSyncByStream(stream, options, cb) → {*}
stream
read streamoptions
[optional], {interval: Number | maxFrames: Number | tag: String}cb
function(data) 'data' is a json, detail specification can be found here.
tupu.videoAsyncByUrl(url, options, cb) → {*}
url
'http://sample.com/path/video.mp4'options
{customInfo: Object | interval: Number | callbackUrl: String | callbackRules: Object | realTimeCallback: Boolean}cb
function(data) 'data' is a json, detail specification can be found here.
tupu.videoStreamByUrl(url, options, cb) → {*}
url
'rtmp://sample.com/path/stream'options
{customInfo: Object | interval: Number | callbackUrl: String | callbackRules: Object}cb
function(data) 'data' is a json, detail specification can be found here.
tupu.videoClose(videoId, cb) → {*}
videoId
'5d4c074058b6cbdbfecaaea4'cb
function(data) 'data' is a json, detail specification can be found here.