cine.io ruby gem
Installation
Add this line to your application's Gemfile:
gem 'cine_io'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cine_io
Usage
Initialization
require('cine_io')
client = CineIo::Client.new(secretKey: 'YOUR_SECRET_KEY')
client = CineIo::Client.new(secretKey: 'YOUR_SECRET_KEY', masterKey: 'YOUR_MASTER_KEY')Methods
Projects
To get data about your projects:
project = client.projects.index
# => [CineIo::Project, …]Project
To get data about your project:
project = client.project.get
# => CineIo::ProjectTo update your project:
# params:
# name: 'a helpful project name'
project = client.project.update(params)
# => CineIo::ProjectTo delete your project:
deleted_date = client.project.destroy
# => Date StringStreams
To get all your streams:
streams = client.streams.index
streams = client.streams.index(name: 'my custom name')
# => [CineIo::Stream, …]To get a specific stream:
stream = client.streams.get('STREAM_ID')
# => CineIo::StreamTo update a specific stream:
# params:
# name: 'a helpful stream name'
# record: true|false (updating a stream from true to false will not delete old stream recordings)
stream = client.streams.update('STREAM_ID', params)
# => CineIo::StreamTo delete a specific stream:
deleted_date = client.streams.destroy('STREAM_ID')
# => Date StringTo create a new stream:
# params (optional):
# name (optional): 'a helpful stream name'
# record: true|false (default false). record: true will save recordings of all streaming sessions
stream = client.streams.create(params)
# => CineIo::StreamTo fetch the Flash Media Live Encoder profile for a stream:
stream = client.streams.fmle_profile('STREAM_ID')
# => String of profile contentsStream Recordings
To get all the recordings of stream:
recordings = client.streams.recordings.index('STREAM_ID')
# => [CineIo::StreamRecording, …]To delete a the recordings of stream:
recordings = client.streams.recordings.delete('STREAM_ID', 'recordingName')
# => Date StringPeer
Identity Signature Generation
identity = "Unique user name to your app"
response = client.peer.generate_identity_signature(identity)
# response looks like {signature: "sha1-hash", timestamp: 1420258111, identity: "Unique user name to your app"}Usage
Use these api endpoints to fetch the monthly usage for a project or a stream.
Project Usage
options = {:month => new Date, :report => ['bandwidth, 'peer']}
response = client.usage.project(options)
// response looks like {bandwidth: 12345, storage: 54321, month: "month (ISO 8601 format)", secretKey: "YOUR SECRET KEY"}
// bandwidth and storage are represented in bytesStream Usage
id = 'STREAM_ID'
options = {:month => new Date, :report => ['bandwidth, 'peer']}
response = client.usage.stream(id, options);
// 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 bytesContributing
- 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