1.0.6 • Published 7 years ago
aliyun-mts v1.0.6
aliyun-mts
aliyun mts sdk
阿里云 MTS媒体转码服务 SDK
Installation
$ npm install aliyun-mts
Usage
const { SubmitJobs, queryJobList, listJob, cancelJob } = require('aliyun-mts')({
AccessKeyId, // your access key id
AccessKeySecret // your access secret
});
// new submit job
// arguments: https://help.aliyun.com/document_detail/29253.html?spm=5176.doc29227.6.603.AX3nBo
const job = new SubmitJobs({
Input: { // Input Object
Bucket, // input bucket name
Location: "oss-cn-hangzhou", // input bucket location
Object: 'test.mp4' // file path
},
OutputBucket, // output bucket name
Outputs: [{
OutputObject: "temp", // output file name (with out postfix if m3u8)
TemplateId: "S00000001-100030" // output template
}],
OutputLocation: "oss-cn-hangzhou", // output bucket location
PipelineId // pipeline id
});
// start job (return promise)
job.start();
// cancel job
cancelJob({
jobId // a job id
});
// query jobs
queryJobList({
jobIds: ['id1', 'id2']
});
// get jobs list
listJob();