The node package for cine.io.
npm install --save cine-io
CineIO = require('cine-io');
client = CineIO.init({secretKey: 'my secret'});
client = CineIO.init({secretKey: 'my secret', masterKey: 'the account master key'}); //needed for fetching all projects
To get data about your projects:
client.projects.index(function(err, projects){});
// projects is an array of simple javascript objects: [{id: 'project id', name: 'project name', …}, …]
To get data about your project:
client.project.get(function(err, project){});
// project is a simple javascript object: {id: 'project id', name: 'project name', …}
To update your project attributes:
// params
// name: 'a new project name'
client.project.update(params, function(err, project){});
// project is a simple javascript object: {id: 'project id', name: 'a new project name', …}
To delete your project and all associated streams:
client.project.destroy(function(err, project){});
// project is a simple javascript object that will include deletedAt: {id: 'project id', name: 'project name', deletedAt: 'ISO date' …}
To get all your streams:
client.streams.index(function(err, streams){});
client.streams.index({name: 'my custom name'}, function(err, streams){});
// streams is an array of javascript objects: [{id: 'stream id', play: {rtmp: 'the rtmp url', hls: 'the hls url'}, publish: {stream: 'the stream name', url: 'the publish url'}, …}, …]
To get a specific stream:
client.streams.get('STREAM_ID', function(err, stream){});
// stream is a simple javascript object: {id: 'stream id', …}
To create a new stream:
client.streams.create(function(err, stream){});
// stream is a simple javascript object: {id: 'stream id', …}
// can optionally take params
// params:
// name: 'an optional stream name'
// record: true|false (default false). record: true will save recordings of all streaming sessions
client.streams.create(params, function(err, stream){});
// stream is a simple javascript object: {id: 'stream id', name: 'an optional stream name', …}
To update a stream:
// params:
// name: 'a new stream name'
// record: true|false (updating a stream from true to false will not delete old stream recordings)
client.streams.update(params, function(err, stream){});
// stream is a simple javascript object: {id: 'stream id', name: 'a new stream name', …}
To delete a specific new stream:
client.streams.destroy('STREAM_ID', function(err, stream){});
// stream is a simple javascript object that will include deletedAt: {id: 'stream id', deletedAt: 'ISO Date', …}
To fetch the Flash Media Live Encoder profile for a stream:
client.streams.fmleProfile('STREAM_ID', function(err, profile){});
// profile is a string of the contents of the Flash Media Live Encoder profile.
To get all your stream recordings:
client.streams.recordings('STREAM_ID', function(err, streamRecordings){});
// streamRecordings is an array of javascript objects: [{name: 'stream id', url: 'the playable url', size: size in bytes as integer, date: 'ISO Date of recording'}, …}, …]
To delete a specific new stream:
client.streams.recordings.destroy('STREAM_ID', 'RECORDING_NAME', function(err, stream){});
// streamRecording is a simple javascript object that will include deletedAt: {deletedAt: 'ISO Date'}
var identity = "Unique user name to your app";
response = client.peer.generateIdentitySignature(identity);
// response looks like {signature: "sha1-hash", timestamp: 1420258111, identity: "Unique user name to your app"}
Use these api endpoints to fetch the monthly usage for a project or a stream.
var options = {month: new Date, report: ['bandwidth, 'peer']};
client.usage.project(options, function(err, response){});
// response looks like {bandwidth: 12345, storage: 54321, month: "month (ISO 8601 format)", secretKey: "YOUR SECRET KEY"}
// bandwidth and storage are represented in bytes
var id = 'STREAM_ID';
var options = {month: new Date, report: ['bandwidth, 'peer']};
client.usage.stream(id, options, function(err, response){});
// response looks like {bandwidth: 12345, storage: 54321, month: "month (ISO 8601 format)", secretKey: "YOUR SECRET KEY", id: "STREAM_ID"}
// bandwidth and storage are represented in bytes
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request