cine_io 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 129fa81cea126c8c282860014af9c8996c17b517
4
- data.tar.gz: 82c95d117260a42fcff3dccbaf965375a0fb5259
3
+ metadata.gz: 747d7de22f38c1a9b45c91afeeeed1916f47005b
4
+ data.tar.gz: f74d85f027e76e51078229532879c8b01eb9e387
5
5
  SHA512:
6
- metadata.gz: f1a6e3da38a5075e6eab338e39b1d8e336807c4acc666649f01622b449dc16e8b58f1b96a32487ed4d868f05e7d743f0d0c40e46754a8ccbe6e514b60a52fad9
7
- data.tar.gz: 762f2912e3b05d100d473e91167175ce4ee34bde1bc4fee435b90d2706cd526df039260aa60bae0f076970568ec8da3cd0335f8ac03678803531c91c65737a87
6
+ metadata.gz: 246d6898cbf2b648f5cf673ab5e0fe3cb3d7eefb652e20aeebd33f12ea58919f4b25e9f682159b2869ed301d76f86a0531fdb7c811c53acd8a5bb8f05d696864
7
+ data.tar.gz: 2148c802dd1222c65926d831419090d73705bd9bc0a7f4b18a0df324a9c7a002ab52fa820726a3d83d3db849a3f60a951d346b41670244d2641b99fd5407dccd
data/README.md CHANGED
@@ -75,6 +75,7 @@ To update a specific stream:
75
75
  ```ruby
76
76
  # params:
77
77
  # name: 'a helpful stream name'
78
+ # record: true|false (updating a stream from true to false will delete old stream recordings)
78
79
  stream = client.streams.update('STREAM_ID', params)
79
80
  # => CineIo::Stream
80
81
  ```
@@ -91,6 +92,7 @@ To create a new stream:
91
92
  ```ruby
92
93
  # params (optional):
93
94
  # name (optional): 'a helpful stream name'
95
+ # record: true|false (default false). Record: true will save recordings of all streaming sessions
94
96
  stream = client.streams.create(params)
95
97
  # => CineIo::Stream
96
98
  ```
@@ -1,6 +1,6 @@
1
1
  class CineIo::Project
2
2
 
3
- attr_reader :id, :publicKey, :secretKey, :name, :streamsCount, :updatedAt
3
+ attr_reader :id, :publicKey, :secretKey, :name, :streamsCount, :updatedAt, :deletedAt
4
4
 
5
5
  def initialize(attributes)
6
6
  attributes.each do |attribute, value|
@@ -1,6 +1,6 @@
1
1
  class CineIo::Stream
2
2
 
3
- attr_reader :id, :name, :play, :publish, :password, :expiration, :assignedAt
3
+ attr_reader :id, :name, :play, :publish, :password, :expiration, :assignedAt, :record, :deletedAt
4
4
 
5
5
  def initialize(attributes)
6
6
  attributes.each do |attribute, value|
@@ -1,6 +1,6 @@
1
1
  class CineIo::StreamRecording
2
2
 
3
- attr_reader :name, :url, :size, :date
3
+ attr_reader :name, :url, :size, :date, :deletedAt
4
4
 
5
5
  def initialize(attributes)
6
6
  attributes.each do |attribute, value|
@@ -18,12 +18,14 @@ class CineIo::StreamsHandler < CineIo::ResourceHandler
18
18
 
19
19
  # params
20
20
  # name: 'some stream name'
21
+ # record: true|false (default false)
21
22
  def create(params={})
22
23
  CineIo::Stream.new post_resource("/stream", params)
23
24
  end
24
25
 
25
26
  # params:
26
27
  # name: some project name
28
+ # record: true|false (updating a stream from true to false will delete old stream recordings)
27
29
  def update(stream_id, params)
28
30
  CineIo::Stream.new update_resource("/stream", {id: stream_id}.merge(params))
29
31
  end
@@ -1,3 +1,3 @@
1
1
  module CineIo
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -51,7 +51,7 @@ describe CineIo::StreamsHandler do
51
51
  end
52
52
  end
53
53
 
54
- describe '#streams' do
54
+ describe '#index' do
55
55
  it "returns the streams" do
56
56
  VCR.use_cassette('get_streams') do
57
57
  streams = subject.index
@@ -78,7 +78,9 @@ describe CineIo::StreamsHandler do
78
78
  stream = subject.create
79
79
  expect(stream).to be_a(CineIo::Stream)
80
80
  expect(stream.id).to eq("537b7f48bc03be080085a389")
81
+ expect(stream.name).to eq(nil)
81
82
  expect(stream.password).to eq("PASSWORD")
83
+ expect(stream.record).to eq(false)
82
84
  expect(stream.play.keys.sort).to eq(['hls', 'rtmp'])
83
85
  expect(stream.publish.keys.sort).to eq(['stream', 'url'])
84
86
  end
@@ -91,6 +93,20 @@ describe CineIo::StreamsHandler do
91
93
  expect(stream.id).to eq("537b7f48bc03be080085a389")
92
94
  expect(stream.name).to eq("new stream")
93
95
  expect(stream.password).to eq("PASSWORD")
96
+ expect(stream.record).to eq(false)
97
+ expect(stream.play.keys.sort).to eq(['hls', 'rtmp'])
98
+ expect(stream.publish.keys.sort).to eq(['stream', 'url'])
99
+ end
100
+ end
101
+
102
+ it "can take a record parameter" do
103
+ VCR.use_cassette('create_stream_with_record') do
104
+ stream = subject.create(record: true)
105
+ expect(stream).to be_a(CineIo::Stream)
106
+ expect(stream.id).to eq("537b7f48bc03be080085a389")
107
+ expect(stream.name).to eq(nil)
108
+ expect(stream.password).to eq("PASSWORD")
109
+ expect(stream.record).to eq(true)
94
110
  expect(stream.play.keys.sort).to eq(['hls', 'rtmp'])
95
111
  expect(stream.publish.keys.sort).to eq(['stream', 'url'])
96
112
  end
@@ -35,7 +35,7 @@ http_interactions:
35
35
  - keep-alive
36
36
  body:
37
37
  encoding: US-ASCII
38
- string: ! '{"id":"537b7f48bc03be080085a389","streamName":"cine1","play":{"hls":"http://hls.cine.io/cines/cine1/cine1.m3u8","rtmp":"rtmp://fml.cine.io/20C45E/cines/cine1?adbe-live-event=cine1"},"publish":{"url":"rtmp://stream.lax.cine.io/20C45E/cines","stream":"cine1?PASSWORD&amp;adbe-live-event=cine1"},"password":"PASSWORD","expiration":"2034-05-20T00:00:00.000Z","assignedAt":"2014-06-01T07:53:38.613Z"}'
38
+ string: ! '{"id":"537b7f48bc03be080085a389","streamName":"cine1","play":{"hls":"http://hls.cine.io/cines/cine1/cine1.m3u8","rtmp":"rtmp://fml.cine.io/20C45E/cines/cine1?adbe-live-event=cine1"},"publish":{"url":"rtmp://stream.lax.cine.io/20C45E/cines","stream":"cine1?PASSWORD&amp;adbe-live-event=cine1"},"password":"PASSWORD","expiration":"2034-05-20T00:00:00.000Z","assignedAt":"2014-06-01T07:53:38.613Z", "record": false}'
39
39
  http_version:
40
40
  recorded_at: Sun, 01 Jun 2014 07:53:39 GMT
41
41
  recorded_with: VCR 2.3.0
@@ -35,7 +35,7 @@ http_interactions:
35
35
  - keep-alive
36
36
  body:
37
37
  encoding: US-ASCII
38
- string: ! '{"id":"537b7f48bc03be080085a389","name":"new stream","play":{"hls":"http://hls.cine.io/cines/cine1/cine1.m3u8","rtmp":"rtmp://fml.cine.io/20C45E/cines/cine1?adbe-live-event=cine1"},"publish":{"url":"rtmp://stream.lax.cine.io/20C45E/cines","stream":"cine1?PASSWORD&amp;adbe-live-event=cine1"},"password":"PASSWORD","expiration":"2034-05-20T00:00:00.000Z","assignedAt":"2014-06-01T07:53:38.613Z"}'
38
+ string: ! '{"id":"537b7f48bc03be080085a389","name":"new stream","play":{"hls":"http://hls.cine.io/cines/cine1/cine1.m3u8","rtmp":"rtmp://fml.cine.io/20C45E/cines/cine1?adbe-live-event=cine1"},"publish":{"url":"rtmp://stream.lax.cine.io/20C45E/cines","stream":"cine1?PASSWORD&amp;adbe-live-event=cine1"},"password":"PASSWORD","expiration":"2034-05-20T00:00:00.000Z","assignedAt":"2014-06-01T07:53:38.613Z", "record": false}'
39
39
  http_version:
40
40
  recorded_at: Wed, 11 Jun 2014 20:19:12 GMT
41
41
  recorded_with: VCR 2.9.2
@@ -0,0 +1,41 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://www.cine.io/api/1/-/stream
6
+ body:
7
+ encoding: US-ASCII
8
+ string: secretKey=MY SECRET&record=true
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ Date:
24
+ - Sun, 01 Jun 2014 07:53:39 GMT
25
+ Set-Cookie:
26
+ - connect.sid=s%3AbDx8VzPxTkATiEsSARSIEEcA.ZmA%2BpTvFJvSE7rE%2BpzP9a2iCRQOeLHhId2RHmSJLN1Y;
27
+ Path=/; HttpOnly
28
+ Vary:
29
+ - Accept-Encoding
30
+ X-Powered-By:
31
+ - Express
32
+ Content-Length:
33
+ - '396'
34
+ Connection:
35
+ - keep-alive
36
+ body:
37
+ encoding: US-ASCII
38
+ string: ! '{"id":"537b7f48bc03be080085a389","streamName":"cine1","play":{"hls":"http://hls.cine.io/cines/cine1/cine1.m3u8","rtmp":"rtmp://fml.cine.io/20C45E/cines/cine1?adbe-live-event=cine1"},"publish":{"url":"rtmp://stream.lax.cine.io/20C45E/cines","stream":"cine1?PASSWORD&amp;adbe-live-event=cine1"},"password":"PASSWORD","expiration":"2034-05-20T00:00:00.000Z","assignedAt":"2014-06-01T07:53:38.613Z", "record": true}'
39
+ http_version:
40
+ recorded_at: Sun, 01 Jun 2014 07:53:39 GMT
41
+ recorded_with: VCR 2.3.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cine_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - cine.io
@@ -114,6 +114,7 @@ files:
114
114
  - spec/fixtures/vcr_cassettes/create_stream.yml
115
115
  - spec/fixtures/vcr_cassettes/create_stream_error.yml
116
116
  - spec/fixtures/vcr_cassettes/create_stream_with_name.yml
117
+ - spec/fixtures/vcr_cassettes/create_stream_with_record.yml
117
118
  - spec/fixtures/vcr_cassettes/delete_project.yml
118
119
  - spec/fixtures/vcr_cassettes/delete_project_error.yml
119
120
  - spec/fixtures/vcr_cassettes/delete_stream.yml
@@ -170,6 +171,7 @@ test_files:
170
171
  - spec/fixtures/vcr_cassettes/create_stream.yml
171
172
  - spec/fixtures/vcr_cassettes/create_stream_error.yml
172
173
  - spec/fixtures/vcr_cassettes/create_stream_with_name.yml
174
+ - spec/fixtures/vcr_cassettes/create_stream_with_record.yml
173
175
  - spec/fixtures/vcr_cassettes/delete_project.yml
174
176
  - spec/fixtures/vcr_cassettes/delete_project_error.yml
175
177
  - spec/fixtures/vcr_cassettes/delete_stream.yml