opentok 4.4.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/README.md +59 -37
- data/lib/opentok/archive.rb +5 -2
- data/lib/opentok/archives.rb +13 -5
- data/lib/opentok/broadcast.rb +6 -2
- data/lib/opentok/broadcasts.rb +9 -1
- data/lib/opentok/client.rb +90 -0
- data/lib/opentok/exceptions.rb +3 -1
- data/lib/opentok/opentok.rb +5 -0
- data/lib/opentok/render.rb +78 -0
- data/lib/opentok/render_list.rb +14 -0
- data/lib/opentok/renders.rb +101 -0
- data/lib/opentok/session.rb +4 -4
- data/lib/opentok/streams.rb +1 -1
- data/lib/opentok/version.rb +1 -1
- data/spec/cassettes/OpenTok_Archives/should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml +50 -0
- data/spec/cassettes/OpenTok_Archives/should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml +49 -0
- data/spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml +52 -0
- data/spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_matching_multi_broadcast_tag_value_when_multiBroadcastTag_is_specified.yml +54 -0
- data/spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_multi_broadcast_tag_value_of_nil_when_multiBroadcastTag_not_specified.yml +53 -0
- data/spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_specified_multiBroadcastTag.yml +54 -0
- data/spec/cassettes/OpenTok_Renders/finds_an_Experience_Composer_render.yml +46 -0
- data/spec/cassettes/OpenTok_Renders/for_many_renders/should_return_all_renders.yml +108 -0
- data/spec/cassettes/OpenTok_Renders/for_many_renders/should_return_count_number_of_renders.yml +63 -0
- data/spec/cassettes/OpenTok_Renders/for_many_renders/should_return_part_of_the_renders_when_using_offset_and_count.yml +63 -0
- data/spec/cassettes/OpenTok_Renders/for_many_renders/should_return_renders_with_an_offset.yml +74 -0
- data/spec/cassettes/OpenTok_Renders/starts_an_Experience_Composer_render.yml +48 -0
- data/spec/cassettes/OpenTok_Renders/stops_an_Experience_Composer_render.yml +28 -0
- data/spec/opentok/archives_spec.rb +21 -0
- data/spec/opentok/broadcasts_spec.rb +38 -0
- data/spec/opentok/renders_spec.rb +142 -0
- metadata +34 -3
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/render?count=2&offset=2
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- OpenTok-Ruby-SDK/<%= version %>
|
12
|
+
X-Opentok-Auth:
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Thu, 15 Sep 2022 11:34:05 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: |-
|
34
|
+
{
|
35
|
+
"count":2,
|
36
|
+
"items":[
|
37
|
+
{
|
38
|
+
"id":"96abaf0d-25a3-4efc-968f-6268d620668d",
|
39
|
+
"sessionId":"3_MX4yNzA4NjYxMn5-MTU0NzA4MDUyMTEzNn5sOXU5ZnlWYXplRnZGblV4RUo3dXJpZk1-fg",
|
40
|
+
"projectId":"27086612",
|
41
|
+
"createdAt":1547080532099,
|
42
|
+
"updatedAt":1547080532099,
|
43
|
+
"url": "https://example.com/my-render",
|
44
|
+
"resolution": "1280x720",
|
45
|
+
"status": "started",
|
46
|
+
"streamId": "d2334b35690a92f78946"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"id":"c34f6496-df6e-4f49-86d6-832e00303602",
|
50
|
+
"sessionId":"4_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg",
|
51
|
+
"projectId":"27086612",
|
52
|
+
"createdAt":1547080511760,
|
53
|
+
"updatedAt":1547080518965,
|
54
|
+
"url": "https://example.com/my-render",
|
55
|
+
"resolution": "1280x720",
|
56
|
+
"status":"stopped",
|
57
|
+
"streamId": "d2334b35690a92f78912",
|
58
|
+
"reason":"Stop Requested"
|
59
|
+
}
|
60
|
+
]
|
61
|
+
}
|
62
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
63
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,74 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/render?offset=3
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- OpenTok-Ruby-SDK/<%= version %>
|
12
|
+
X-Opentok-Auth:
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Thu, 15 Sep 2022 11:29:00 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: |-
|
34
|
+
{
|
35
|
+
"count":3,
|
36
|
+
"items":[
|
37
|
+
{
|
38
|
+
"id":"c34f6496-df6e-4f49-86d6-832e00303602",
|
39
|
+
"sessionId":"4_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg",
|
40
|
+
"projectId":"27086612",
|
41
|
+
"createdAt":1547080511760,
|
42
|
+
"updatedAt":1547080518965,
|
43
|
+
"url": "https://example.com/my-render",
|
44
|
+
"resolution": "1280x720",
|
45
|
+
"status":"stopped",
|
46
|
+
"streamId": "d2334b35690a92f78912",
|
47
|
+
"reason":"Stop Requested"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"id":"52abaf0d-25a3-4efc-968f-6268d620668d",
|
51
|
+
"sessionId":"1_MX4yNzA4NjYxMn5-MTU0NzA4MDUyMTEzNn5sOXU5ZnlWYXplRnZGblV4RUo3dXJpZk1-fg",
|
52
|
+
"projectId":"27086612",
|
53
|
+
"createdAt":1547080532099,
|
54
|
+
"updatedAt":1547080532099,
|
55
|
+
"url": "https://example.com/my-render",
|
56
|
+
"resolution": "1280x720",
|
57
|
+
"status": "started",
|
58
|
+
"streamId": "d2334b35690a92f78948"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"id":"a87f6496-df6e-4f49-86d6-832e00303602",
|
62
|
+
"sessionId":"2_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg",
|
63
|
+
"projectId":"27086612",
|
64
|
+
"createdAt":1547080511760,
|
65
|
+
"updatedAt":1547080518965,
|
66
|
+
"url": "https://example.com/my-render",
|
67
|
+
"resolution": "1280x720",
|
68
|
+
"status":"starting",
|
69
|
+
"streamId": "d2334b35690a92f78947"
|
70
|
+
}
|
71
|
+
]
|
72
|
+
}
|
73
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
74
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/render
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"sessionId":"SESSIONID","token":"TOKEN","url":"https://example.com/my-render"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- OpenTok-Ruby-SDK/<%= version %>
|
12
|
+
X-Opentok-Auth:
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 202
|
23
|
+
message: Accepted
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Thu, 15 Sep 2022 10:25:36 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: |-
|
36
|
+
{
|
37
|
+
"id": "80abaf0d-25a3-4efc-968f-6268d620668d",
|
38
|
+
"sessionId": "SESSIONID",
|
39
|
+
"projectId": "e2343f23456g34709d2443a234",
|
40
|
+
"createdAt": 1437676551000,
|
41
|
+
"updatedAt": 1437676551000,
|
42
|
+
"url": "https://example.com/my-render",
|
43
|
+
"resolution": "1280x720",
|
44
|
+
"status": "starting",
|
45
|
+
"streamId": "e32445b743678c98230f238"
|
46
|
+
}
|
47
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
48
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: delete
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/render/80abaf0d-25a3-4efc-968f-6268d620668d
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- OpenTok-Ruby-SDK/<%= version %>
|
12
|
+
X-Opentok-Auth:
|
13
|
+
- eyJpc3QiOiJwcm9qZWN0IiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiIxMjM0NTYiLCJpYXQiOjE0OTI1MTA2NjAsImV4cCI6MTQ5MjUxMDk2MH0.BplMVhJWx4ld7KLKXqEmow6MjNPPFw9W8IHCMfeb120
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 204
|
21
|
+
message: No Content
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Thu, 15 Sep 2022 10:51:54 GMT
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
28
|
+
recorded_with: VCR 6.0.0
|
@@ -42,6 +42,27 @@ describe OpenTok::Archives do
|
|
42
42
|
expect(archive.name).to eq archive_name
|
43
43
|
end
|
44
44
|
|
45
|
+
it "should create an archives with a specified multiArchiveTag", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
46
|
+
archive_tag = 'archive-1'
|
47
|
+
archive = archives.create session_id, :multiArchiveTag => archive_tag
|
48
|
+
expect(archive).to be_an_instance_of OpenTok::Archive
|
49
|
+
expect(archive.session_id).to eq session_id
|
50
|
+
expect(archive.multiArchiveTag).to eq archive_tag
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should create an archive with matching multi_archive_tag when multiArchiveTag is specified", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
54
|
+
archive_tag = 'archive-1'
|
55
|
+
archive = archives.create session_id, :multiArchiveTag => archive_tag
|
56
|
+
expect(archive).to be_an_instance_of OpenTok::Archive
|
57
|
+
expect(archive.multi_archive_tag).to eq archive_tag
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should create an archive with multi_archive_tag value of nil when multiArchiveTag not specified", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
61
|
+
archive = archives.create session_id
|
62
|
+
expect(archive).to be_an_instance_of OpenTok::Archive
|
63
|
+
expect(archive.multi_archive_tag).to be_nil
|
64
|
+
end
|
65
|
+
|
45
66
|
it "should create audio only archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
46
67
|
archive = archives.create session_id, :has_video => false
|
47
68
|
expect(archive).to be_an_instance_of OpenTok::Archive
|
@@ -93,6 +93,44 @@ describe OpenTok::Broadcasts do
|
|
93
93
|
expect(b_rtmp.broadcastUrls["rtmp"].count).to eq 1
|
94
94
|
end
|
95
95
|
|
96
|
+
it 'starts a broadcast with a specified multiBroadcastTag', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
97
|
+
broadcast_tag = 'broadcast-1'
|
98
|
+
opts = {
|
99
|
+
:outputs => {
|
100
|
+
:hls => {}
|
101
|
+
},
|
102
|
+
:multiBroadcastTag => broadcast_tag
|
103
|
+
}
|
104
|
+
broadcast_1 = broadcast.create(session_id, opts)
|
105
|
+
expect(broadcast_1).to be_an_instance_of OpenTok::Broadcast
|
106
|
+
expect(broadcast_1.id).to eq broadcast_id
|
107
|
+
expect(broadcast_1.multiBroadcastTag).to eq broadcast_tag
|
108
|
+
end
|
109
|
+
|
110
|
+
it 'starts a broadcast with a matching multi_broadcast_tag value when multiBroadcastTag is specified', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
111
|
+
broadcast_tag = 'broadcast-1'
|
112
|
+
opts = {
|
113
|
+
:outputs => {
|
114
|
+
:hls => {}
|
115
|
+
},
|
116
|
+
:multiBroadcastTag => broadcast_tag
|
117
|
+
}
|
118
|
+
broadcast_1 = broadcast.create(session_id, opts)
|
119
|
+
expect(broadcast_1).to be_an_instance_of OpenTok::Broadcast
|
120
|
+
expect(broadcast_1.multi_broadcast_tag).to eq broadcast_tag
|
121
|
+
end
|
122
|
+
|
123
|
+
it 'starts a broadcast with a multi_broadcast_tag value of nil when multiBroadcastTag not specified', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
124
|
+
opts = {
|
125
|
+
:outputs => {
|
126
|
+
:hls => {}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
broadcast_1 = broadcast.create(session_id, opts)
|
130
|
+
expect(broadcast_1).to be_an_instance_of OpenTok::Broadcast
|
131
|
+
expect(broadcast_1.multi_broadcast_tag).to be_nil
|
132
|
+
end
|
133
|
+
|
96
134
|
it 'finds a broadcast', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
97
135
|
b = broadcast.find started_broadcast_id
|
98
136
|
expect(b).to be_an_instance_of OpenTok::Broadcast
|
@@ -0,0 +1,142 @@
|
|
1
|
+
require "opentok/render"
|
2
|
+
require "opentok/renders"
|
3
|
+
require "opentok/opentok"
|
4
|
+
require "opentok/version"
|
5
|
+
require "spec_helper"
|
6
|
+
|
7
|
+
describe OpenTok::Renders do
|
8
|
+
before(:each) do
|
9
|
+
now = Time.parse("2017-04-18 20:17:40 +1000")
|
10
|
+
allow(Time).to receive(:now) { now }
|
11
|
+
end
|
12
|
+
|
13
|
+
let(:api_key) { "123456" }
|
14
|
+
let(:api_secret) { "1234567890abcdef1234567890abcdef1234567890" }
|
15
|
+
let(:session_id) { "SESSIONID" }
|
16
|
+
let(:render_id) { "80abaf0d-25a3-4efc-968f-6268d620668d" }
|
17
|
+
let(:opentok) { OpenTok::OpenTok.new api_key, api_secret }
|
18
|
+
let(:token) { "TOKEN" }
|
19
|
+
let(:render) { opentok.renders }
|
20
|
+
let(:render_url) { 'https://example.com/my-render'}
|
21
|
+
|
22
|
+
subject { render }
|
23
|
+
|
24
|
+
it 'raises an error on empty sessionId' do
|
25
|
+
opts = {
|
26
|
+
:token => token,
|
27
|
+
:url => render_url
|
28
|
+
}
|
29
|
+
expect {
|
30
|
+
render.start('', opts)
|
31
|
+
}.to raise_error(ArgumentError)
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'raises an error on nil sessionId' do
|
35
|
+
opts = {
|
36
|
+
:token => token,
|
37
|
+
:url => render_url
|
38
|
+
}
|
39
|
+
expect {
|
40
|
+
render.start(nil, opts)
|
41
|
+
}.to raise_error(ArgumentError)
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'raises an error on empty options' do
|
45
|
+
expect {
|
46
|
+
render.start(session_id, {})
|
47
|
+
}.to raise_error(ArgumentError)
|
48
|
+
end
|
49
|
+
|
50
|
+
it 'raises an error if token is not set in options' do
|
51
|
+
opts = { :url => render_url }
|
52
|
+
expect { render.start(session_id, opts) }.to raise_error(ArgumentError)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'raises an error if url is not set in options' do
|
56
|
+
opts = { :token => token }
|
57
|
+
expect { render.start(session_id, opts) }.to raise_error(ArgumentError)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'starts an Experience Composer render', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
61
|
+
opts = {
|
62
|
+
:token => token,
|
63
|
+
:url => render_url
|
64
|
+
}
|
65
|
+
r = render.start(session_id, opts)
|
66
|
+
expect(r).to be_an_instance_of OpenTok::Render
|
67
|
+
expect(r.sessionId).to eq session_id
|
68
|
+
expect(r.url).to eq render_url
|
69
|
+
expect(r.status).to eq "starting"
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'raises an error on empty renderId in find' do
|
73
|
+
expect {
|
74
|
+
render.find("")
|
75
|
+
}.to raise_error(ArgumentError)
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'raises an error on nil renderId in find' do
|
79
|
+
expect {
|
80
|
+
render.find(nil)
|
81
|
+
}.to raise_error(ArgumentError)
|
82
|
+
end
|
83
|
+
|
84
|
+
it 'finds an Experience Composer render', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
85
|
+
r = render.find render_id
|
86
|
+
expect(r).to be_an_instance_of OpenTok::Render
|
87
|
+
expect(r.id).to eq render_id
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'raises an error on empty renderId in stop' do
|
91
|
+
expect {
|
92
|
+
render.stop("")
|
93
|
+
}.to raise_error(ArgumentError)
|
94
|
+
end
|
95
|
+
|
96
|
+
it 'raises an error on nil renderId in stop' do
|
97
|
+
expect {
|
98
|
+
render.stop(nil)
|
99
|
+
}.to raise_error(ArgumentError)
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'stops an Experience Composer render', :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
103
|
+
r = render.stop(render_id)
|
104
|
+
expect(r).to be_an_instance_of OpenTok::Render
|
105
|
+
end
|
106
|
+
|
107
|
+
context "for many renders" do
|
108
|
+
it 'raises an error for an invalid limit in list' do
|
109
|
+
expect {
|
110
|
+
render.list(count: 1001)
|
111
|
+
}.to raise_error(ArgumentError)
|
112
|
+
end
|
113
|
+
|
114
|
+
it "should return all renders", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
115
|
+
render_list = render.list
|
116
|
+
expect(render_list).to be_an_instance_of OpenTok::RenderList
|
117
|
+
expect(render_list.count).to eq 6
|
118
|
+
expect(render_list.total).to eq 6
|
119
|
+
end
|
120
|
+
|
121
|
+
it "should return renders with an offset", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
122
|
+
render_list = render.list :offset => 3
|
123
|
+
expect(render_list).to be_an_instance_of OpenTok::RenderList
|
124
|
+
expect(render_list.count).to eq 3
|
125
|
+
expect(render_list.total).to eq 3
|
126
|
+
end
|
127
|
+
|
128
|
+
it "should return count number of renders", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
129
|
+
render_list = render.list :count => 2
|
130
|
+
expect(render_list).to be_an_instance_of OpenTok::RenderList
|
131
|
+
expect(render_list.count).to eq 2
|
132
|
+
expect(render_list.total).to eq 2
|
133
|
+
end
|
134
|
+
|
135
|
+
it "should return part of the renders when using offset and count", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
136
|
+
render_list = render.list :count => 2, :offset => 2
|
137
|
+
expect(render_list).to be_an_instance_of OpenTok::RenderList
|
138
|
+
expect(render_list.count).to eq 2
|
139
|
+
expect(render_list.total).to eq 2
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentok
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stijn Mathysen
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2022-
|
15
|
+
date: 2022-10-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
@@ -195,6 +195,9 @@ files:
|
|
195
195
|
- lib/opentok/exceptions.rb
|
196
196
|
- lib/opentok/extensions/hash.rb
|
197
197
|
- lib/opentok/opentok.rb
|
198
|
+
- lib/opentok/render.rb
|
199
|
+
- lib/opentok/render_list.rb
|
200
|
+
- lib/opentok/renders.rb
|
198
201
|
- lib/opentok/session.rb
|
199
202
|
- lib/opentok/signals.rb
|
200
203
|
- lib/opentok/sip.rb
|
@@ -239,6 +242,9 @@ files:
|
|
239
242
|
- spec/cassettes/OpenTok_Archives/changes_the_layout_of_an_archive.yml
|
240
243
|
- spec/cassettes/OpenTok_Archives/http_client_errors/.yml
|
241
244
|
- spec/cassettes/OpenTok_Archives/removes_a_stream_from_an_archive.yml
|
245
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml
|
246
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml
|
247
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
|
242
248
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
243
249
|
- spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml
|
244
250
|
- spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml
|
@@ -268,6 +274,9 @@ files:
|
|
268
274
|
- spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_part_of_the_broadcasts_when_using_offset_and_count.yml
|
269
275
|
- spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_session_broadcasts.yml
|
270
276
|
- spec/cassettes/OpenTok_Broadcasts/removes_a_stream_from_a_broadcast.yml
|
277
|
+
- spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_matching_multi_broadcast_tag_value_when_multiBroadcastTag_is_specified.yml
|
278
|
+
- spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_multi_broadcast_tag_value_of_nil_when_multiBroadcastTag_not_specified.yml
|
279
|
+
- spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_specified_multiBroadcastTag.yml
|
271
280
|
- spec/cassettes/OpenTok_Broadcasts/starts_a_rtmp_broadcast.yml
|
272
281
|
- spec/cassettes/OpenTok_Broadcasts/stops_a_broadcast.yml
|
273
282
|
- spec/cassettes/OpenTok_Connections/forces_a_connection_to_be_terminated.yml
|
@@ -280,6 +289,13 @@ files:
|
|
280
289
|
- spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_routed_media_sessions_with_a_location_hint.yml
|
281
290
|
- spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_sessions_with_a_location_hint.yml
|
282
291
|
- spec/cassettes/OpenTok_OpenTok/when_initialized_properly/with_an_addendum_to_the_user_agent_string/should_append_the_addendum_to_the_user_agent_header.yml
|
292
|
+
- spec/cassettes/OpenTok_Renders/finds_an_Experience_Composer_render.yml
|
293
|
+
- spec/cassettes/OpenTok_Renders/for_many_renders/should_return_all_renders.yml
|
294
|
+
- spec/cassettes/OpenTok_Renders/for_many_renders/should_return_count_number_of_renders.yml
|
295
|
+
- spec/cassettes/OpenTok_Renders/for_many_renders/should_return_part_of_the_renders_when_using_offset_and_count.yml
|
296
|
+
- spec/cassettes/OpenTok_Renders/for_many_renders/should_return_renders_with_an_offset.yml
|
297
|
+
- spec/cassettes/OpenTok_Renders/starts_an_Experience_Composer_render.yml
|
298
|
+
- spec/cassettes/OpenTok_Renders/stops_an_Experience_Composer_render.yml
|
283
299
|
- spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_a_connection.yml
|
284
300
|
- spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_all_connections.yml
|
285
301
|
- spec/cassettes/OpenTok_Sip/_play_dtmf_to_connection/returns_a_200_response_code_when_passed_a_valid_dtmf_digit_string.yml
|
@@ -298,6 +314,7 @@ files:
|
|
298
314
|
- spec/opentok/client_spec.rb
|
299
315
|
- spec/opentok/connection_spec.rb
|
300
316
|
- spec/opentok/opentok_spec.rb
|
317
|
+
- spec/opentok/renders_spec.rb
|
301
318
|
- spec/opentok/session_spec.rb
|
302
319
|
- spec/opentok/signal_spec.rb
|
303
320
|
- spec/opentok/sip_spec.rb
|
@@ -324,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
324
341
|
- !ruby/object:Gem::Version
|
325
342
|
version: '0'
|
326
343
|
requirements: []
|
327
|
-
rubygems_version: 3.3
|
344
|
+
rubygems_version: 3.2.3
|
328
345
|
signing_key:
|
329
346
|
specification_version: 4
|
330
347
|
summary: Ruby gem for the OpenTok API
|
@@ -334,6 +351,9 @@ test_files:
|
|
334
351
|
- spec/cassettes/OpenTok_Archives/changes_the_layout_of_an_archive.yml
|
335
352
|
- spec/cassettes/OpenTok_Archives/http_client_errors/.yml
|
336
353
|
- spec/cassettes/OpenTok_Archives/removes_a_stream_from_an_archive.yml
|
354
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml
|
355
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml
|
356
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
|
337
357
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
338
358
|
- spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml
|
339
359
|
- spec/cassettes/OpenTok_Archives/should_create_custom_layout_archives.yml
|
@@ -363,6 +383,9 @@ test_files:
|
|
363
383
|
- spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_part_of_the_broadcasts_when_using_offset_and_count.yml
|
364
384
|
- spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_session_broadcasts.yml
|
365
385
|
- spec/cassettes/OpenTok_Broadcasts/removes_a_stream_from_a_broadcast.yml
|
386
|
+
- spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_matching_multi_broadcast_tag_value_when_multiBroadcastTag_is_specified.yml
|
387
|
+
- spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_multi_broadcast_tag_value_of_nil_when_multiBroadcastTag_not_specified.yml
|
388
|
+
- spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_specified_multiBroadcastTag.yml
|
366
389
|
- spec/cassettes/OpenTok_Broadcasts/starts_a_rtmp_broadcast.yml
|
367
390
|
- spec/cassettes/OpenTok_Broadcasts/stops_a_broadcast.yml
|
368
391
|
- spec/cassettes/OpenTok_Connections/forces_a_connection_to_be_terminated.yml
|
@@ -375,6 +398,13 @@ test_files:
|
|
375
398
|
- spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_routed_media_sessions_with_a_location_hint.yml
|
376
399
|
- spec/cassettes/OpenTok_OpenTok/when_initialized_properly/_create_session/creates_sessions_with_a_location_hint.yml
|
377
400
|
- spec/cassettes/OpenTok_OpenTok/when_initialized_properly/with_an_addendum_to_the_user_agent_string/should_append_the_addendum_to_the_user_agent_header.yml
|
401
|
+
- spec/cassettes/OpenTok_Renders/finds_an_Experience_Composer_render.yml
|
402
|
+
- spec/cassettes/OpenTok_Renders/for_many_renders/should_return_all_renders.yml
|
403
|
+
- spec/cassettes/OpenTok_Renders/for_many_renders/should_return_count_number_of_renders.yml
|
404
|
+
- spec/cassettes/OpenTok_Renders/for_many_renders/should_return_part_of_the_renders_when_using_offset_and_count.yml
|
405
|
+
- spec/cassettes/OpenTok_Renders/for_many_renders/should_return_renders_with_an_offset.yml
|
406
|
+
- spec/cassettes/OpenTok_Renders/starts_an_Experience_Composer_render.yml
|
407
|
+
- spec/cassettes/OpenTok_Renders/stops_an_Experience_Composer_render.yml
|
378
408
|
- spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_a_connection.yml
|
379
409
|
- spec/cassettes/OpenTok_Signals/receives_a_valid_response_for_all_connections.yml
|
380
410
|
- spec/cassettes/OpenTok_Sip/_play_dtmf_to_connection/returns_a_200_response_code_when_passed_a_valid_dtmf_digit_string.yml
|
@@ -393,6 +423,7 @@ test_files:
|
|
393
423
|
- spec/opentok/client_spec.rb
|
394
424
|
- spec/opentok/connection_spec.rb
|
395
425
|
- spec/opentok/opentok_spec.rb
|
426
|
+
- spec/opentok/renders_spec.rb
|
396
427
|
- spec/opentok/session_spec.rb
|
397
428
|
- spec/opentok/signal_spec.rb
|
398
429
|
- spec/opentok/sip_spec.rb
|