opentok 4.1.2 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +30 -0
  3. data/CHANGES.md +157 -0
  4. data/README.md +4 -2
  5. data/lib/opentok/archive.rb +50 -3
  6. data/lib/opentok/archives.rb +102 -6
  7. data/lib/opentok/broadcast.rb +44 -1
  8. data/lib/opentok/broadcast_list.rb +14 -0
  9. data/lib/opentok/broadcasts.rb +168 -17
  10. data/lib/opentok/client.rb +161 -0
  11. data/lib/opentok/connections.rb +1 -1
  12. data/lib/opentok/constants.rb +1 -0
  13. data/lib/opentok/opentok.rb +9 -9
  14. data/lib/opentok/sip.rb +40 -2
  15. data/lib/opentok/streams.rb +48 -1
  16. data/lib/opentok/token_generator.rb +1 -0
  17. data/lib/opentok/version.rb +1 -1
  18. data/opentok.gemspec +1 -1
  19. data/sample/Broadcast/README.md +42 -0
  20. data/sample/Broadcast/broadcast_sample.rb +15 -0
  21. data/sample/Broadcast/views/all.erb +46 -0
  22. data/sample/Broadcast/views/index.erb +16 -1
  23. data/spec/cassettes/OpenTok_Archives/adds_a_stream_to_an_archive.yml +37 -0
  24. data/spec/cassettes/OpenTok_Archives/removes_a_stream_from_an_archive.yml +37 -0
  25. data/spec/cassettes/OpenTok_Archives/should_create_layout_archives_with_screenshare_layout_types.yml +50 -0
  26. data/spec/cassettes/OpenTok_Broadcasts/adds_a_stream_to_a_broadcast.yml +37 -0
  27. data/spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_all_broadcasts.yml +192 -0
  28. data/spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_broadcasts_with_an_offset.yml +117 -0
  29. data/spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_count_number_of_broadcasts.yml +92 -0
  30. data/spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_part_of_the_broadcasts_when_using_offset_and_count.yml +142 -0
  31. data/spec/cassettes/OpenTok_Broadcasts/for_many_broadcasts/should_return_session_broadcasts.yml +117 -0
  32. data/spec/cassettes/OpenTok_Broadcasts/removes_a_stream_from_a_broadcast.yml +37 -0
  33. data/spec/cassettes/OpenTok_Sip/_play_dtmf_to_connection/returns_a_200_response_code_when_passed_a_valid_dtmf_digit_string.yml +39 -0
  34. data/spec/cassettes/OpenTok_Sip/_play_dtmf_to_session/returns_a_200_response_code_when_passed_a_valid_dtmf_digit_string.yml +39 -0
  35. data/spec/cassettes/OpenTok_Sip/receives_a_valid_response.yml +2 -2
  36. data/spec/cassettes/OpenTok_Streams/disables_the_mute_state_of_a_session.yml +37 -0
  37. data/spec/cassettes/OpenTok_Streams/forces_all_current_and_future_streams_in_a_session_to_be_muted.yml +39 -0
  38. data/spec/cassettes/OpenTok_Streams/forces_all_current_and_future_streams_in_a_session_to_be_muted_except_specified_excluded_streams.yml +39 -0
  39. data/spec/cassettes/OpenTok_Streams/forces_the_specified_stream_to_be_muted.yml +39 -0
  40. data/spec/opentok/archives_spec.rb +40 -0
  41. data/spec/opentok/broadcasts_spec.rb +96 -2
  42. data/spec/opentok/connection_spec.rb +1 -1
  43. data/spec/opentok/sip_spec.rb +32 -1
  44. data/spec/opentok/streams_spec.rb +21 -1
  45. metadata +41 -6
  46. data/.travis.yml +0 -17
@@ -168,6 +168,48 @@ You will now see the participant in the broadcast.
168
168
  end
169
169
  ```
170
170
 
171
+ ### All broadcasts
172
+
173
+ Start by visiting the list page at <http://localhost:4567/all>. You will see a table that
174
+ displays all the broadcasts created with your API Key. If there are more than five, the next ones
175
+ can be seen by clicking the "Next →" link. Some basic information like
176
+ when the broadcast was created, how long it is, and its status is also shown. You should see the
177
+ broadcasts you created in the previous sections here.
178
+
179
+ We begin to see how this page is created by looking at the route handler for this URL:
180
+
181
+ ```ruby
182
+ get '/all' do
183
+ page = (params[:page] || "1").to_i
184
+ offset = (page - 1) * 5
185
+ broadcasts = settings.opentok.broadcasts.all(:offset => offset, :count => 5)
186
+
187
+ show_previous = page > 1 ? '/all?page=' + (page-1).to_s : nil
188
+ show_next = broadcasts.total > (offset + 5) ? '/all?page=' + (page+1).to_s : nil
189
+
190
+ erb :all, :locals => {
191
+ :broadcasts => broadcasts,
192
+ :show_previous => show_previous,
193
+ :show_next => show_next
194
+ }
195
+ end
196
+ ```
197
+
198
+ This view is paginated so that we don't potentially show hundreds of rows on the table, which would
199
+ be difficult for the user to navigate. So this code starts by figuring out which page needs to be
200
+ shown, where each page is a set of 5 broadcasts. The `page` number is read from the request's query
201
+ string parameters as a string and then converted into an Integer. The `offset`, which represents how
202
+ many broadcasts are being skipped is always calculated as five times as many pages that are less than
203
+ the current page, which is `(page - 1) * 5`. Now there is enough information to ask for a list of
204
+ broadcasts from OpenTok, which we do by calling the `broadcasts.all()` method of the `opentok` instance.
205
+ The parameter is an optional Hash that contains the offset, the count (which is always 5 in this
206
+ view). If we are not at the first page, we can pass the view a string that contains the relative URL
207
+ for the previous page. Similarly, we can also include one for the next page. Now the application
208
+ renders the view using that information and the partial list of broadcasts.
209
+
210
+ At this point the template file `views/all.erb` handles looping over the array of broadcasts and
211
+ outputting the proper information for each column in the table.
212
+
171
213
  ### Changing the layout classes for streams
172
214
 
173
215
  In the host page, if you click on either the host or a participant video, that video gets
@@ -46,6 +46,21 @@ class BroadcastSample < Sinatra::Base
46
46
  }
47
47
  end
48
48
 
49
+ get '/all' do
50
+ page = (params[:page] || "1").to_i
51
+ offset = (page - 1) * 5
52
+ broadcasts = settings.opentok.broadcasts.all(:offset => offset, :count => 5)
53
+
54
+ show_previous = page > 1 ? '/all?page=' + (page-1).to_s : nil
55
+ show_next = broadcasts.total > (offset + 5) ? '/all?page=' + (page+1).to_s : nil
56
+
57
+ erb :all, :locals => {
58
+ :broadcasts => broadcasts,
59
+ :show_previous => show_previous,
60
+ :show_next => show_next
61
+ }
62
+ end
63
+
49
64
  post '/start' do
50
65
  opts = {
51
66
  :maxDuration => params.key?("maxDuration") ? params[:maxDuration] : 7200,
@@ -0,0 +1,46 @@
1
+ <div class="container bump-me">
2
+
3
+ <div class="body-content">
4
+
5
+ <div class="panel panel-default">
6
+ <div class="panel-heading">
7
+ <h3 class="panel-title">Broadcasts List</h3>
8
+ </div>
9
+ <div class="panel-body">
10
+ <% if broadcasts.count > 0 %>
11
+ <table class="table">
12
+ <thead>
13
+ <tr>
14
+ <th>Created</th>
15
+ <th>Status</th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <% for item in broadcasts %>
20
+
21
+ <tr data-item-id="<%= item.id %>">
22
+ <td><%= Time.at(item.created_at/1000).strftime("%B %e, %Y at %I:%M %p") %></td>
23
+ <td><%= item.status %></td>
24
+ </tr>
25
+
26
+ <% end %>
27
+ </tbody>
28
+ </table>
29
+ <% else %>
30
+ <p>
31
+ There are no broadcasts currently. Try making one in the <a href="/host">host view</a>.
32
+ </p>
33
+ <% end %>
34
+ </div>
35
+ <div class="panel-footer">
36
+ <% if show_previous %>
37
+ <a href="<%= show_previous %>" class="pull-left">&larr; Previous</a>
38
+ <% end %>
39
+ &nbsp;
40
+ <% if show_next %>
41
+ <a href="<%= show_next %>" class="pull-right">Next &rarr;</a>
42
+ <% end %>
43
+ </div>
44
+ </div>
45
+ </div>
46
+ </div>
@@ -25,8 +25,23 @@
25
25
  </div>
26
26
 
27
27
  </div>
28
+ <div class="col-lg-6 col-offset-1">
29
+
30
+ <div class="panel panel-default">
31
+ <div class="panel-heading">List of Broadcasts</div>
32
+ <div class="panel-body">
33
+ <p>
34
+ Click through to List of Broadcasts to see examples of using the
35
+ Broadcasting REST API to list broadcasts showing status (started,
36
+ stopped, available) and created at timestamp.
37
+ </p>
38
+ </div>
39
+ <div class="panel-footer">
40
+ <a class="btn btn-success" href="all">List of Broadcasts</a>
41
+ </div>
42
+ </div>
28
43
 
29
44
  </div>
30
45
 
31
46
  </div>
32
- </div>
47
+ </div>
@@ -0,0 +1,37 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: patch
5
+ uri: https://api.opentok.com/v2/project/123456/archive/30b3ebf1-ba36-4f5b-8def-6f70d9986fe9/streams
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"addStream":"12312312-3811-4726-b508-e41a0f96c68f"}'
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: 204
23
+ message: No Content
24
+ headers:
25
+ Server:
26
+ - nginx
27
+ Date:
28
+ - Tue, 23 Nov 2021 20:55:02 GMT
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - AWSALBTG=DuFUMmWLYpV+WXygU/vIF2GeEgO0ltb32OLXKREBQ059UXSGx826MWScm3+Iba9R/DrIu8wi8puQQB6HMDNNA5twML8KpmSno/CfRqigVEW7z7njwLdBeIjKowkK2oDiRCpWwn35G08EcNtdzJZUUO+Cqt/7MLfakD0RjBHzn0k0H6uk8Y4=;
33
+ Expires=Tue, 30 Nov 2021 20:55:02 GMT; Path=/
34
+ - AWSALBTGCORS=DuFUMmWLYpV+WXygU/vIF2GeEgO0ltb32OLXKREBQ059UXSGx826MWScm3+Iba9R/DrIu8wi8puQQB6HMDNNA5twML8KpmSno/CfRqigVEW7z7njwLdBeIjKowkK2oDiRCpWwn35G08EcNtdzJZUUO+Cqt/7MLfakD0RjBHzn0k0H6uk8Y4=;
35
+ Expires=Tue, 30 Nov 2021 20:55:02 GMT; Path=/; SameSite=None; Secure
36
+ recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
37
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,37 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: patch
5
+ uri: https://api.opentok.com/v2/project/123456/archive/30b3ebf1-ba36-4f5b-8def-6f70d9986fe9/streams
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"removeStream":"12312312-3811-4726-b508-e41a0f96c68f"}'
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: 204
23
+ message: No Content
24
+ headers:
25
+ Server:
26
+ - nginx
27
+ Date:
28
+ - Tue, 23 Nov 2021 20:55:03 GMT
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - AWSALBTG=C8HtbnHIrXFPcTucK+6zVh2r0MMrr/1Jb/WUzPKk5rAEw3LbnvwxrsMlwebeHFPZUj+lcnVMLZU91OiujdiYEUH5eBovMivdAk9Gd/O9f4iPju70zwCPrRaoMZnH3sFK6a8lG3Q966pXth4vEsvTA12tADiC2emPHC51Z75R51aQMKUxFPc=;
33
+ Expires=Tue, 30 Nov 2021 20:55:03 GMT; Path=/
34
+ - AWSALBTGCORS=C8HtbnHIrXFPcTucK+6zVh2r0MMrr/1Jb/WUzPKk5rAEw3LbnvwxrsMlwebeHFPZUj+lcnVMLZU91OiujdiYEUH5eBovMivdAk9Gd/O9f4iPju70zwCPrRaoMZnH3sFK6a8lG3Q966pXth4vEsvTA12tADiC2emPHC51Z75R51aQMKUxFPc=;
35
+ Expires=Tue, 30 Nov 2021 20:55:03 GMT; Path=/; SameSite=None; Secure
36
+ recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
37
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.opentok.com/v2/project/123456/archive
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"sessionId":"SESSIONID","layout":{"type":"bestFit","screenshare_type":"verticalPresentation"}}'
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: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
17
+ Accept: "*/*"
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Fri, 17 Jan 2020 21:15:36 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: |-
36
+ {
37
+ "createdAt" : 1395183243556,
38
+ "duration" : 0,
39
+ "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9",
40
+ "name" : "",
41
+ "partnerId" : 123456,
42
+ "reason" : "",
43
+ "sessionId" : "SESSIONID",
44
+ "size" : 0,
45
+ "status" : "started",
46
+ "url" : null
47
+ }
48
+ http_version:
49
+ recorded_at: Tue, 26 Jan 2021 09:01:36 GMT
50
+ recorded_with: VCR 5.0.0
@@ -0,0 +1,37 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: patch
5
+ uri: https://api.opentok.com/v2/project/123456/broadcast/13dbcc23-af92-4862-9184-74b21815a814/streams
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"addStream":"12312312-3811-4726-b508-e41a0f96c68f"}'
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: 204
23
+ message: No Content
24
+ headers:
25
+ Server:
26
+ - nginx
27
+ Date:
28
+ - Tue, 23 Nov 2021 20:44:18 GMT
29
+ Connection:
30
+ - keep-alive
31
+ Set-Cookie:
32
+ - AWSALBTG=Nj5lPQS/JnLA1JkA1AcUDSrn5vUxVtJ5srP+UHP/scSFLccYUClejVswu+NTMqGisdJi/7X/qdPMWBEq6ReBXCALUGz+NKunxs/WrIBFxBOz6EYgWkHXh8DY9Rtx2xEQmDzdCDqXIgr1aUzTv8J3taybWQm4yBpzHjFJFoUjpNYxS6+1zlI=;
33
+ Expires=Tue, 30 Nov 2021 20:44:18 GMT; Path=/
34
+ - AWSALBTGCORS=Nj5lPQS/JnLA1JkA1AcUDSrn5vUxVtJ5srP+UHP/scSFLccYUClejVswu+NTMqGisdJi/7X/qdPMWBEq6ReBXCALUGz+NKunxs/WrIBFxBOz6EYgWkHXh8DY9Rtx2xEQmDzdCDqXIgr1aUzTv8J3taybWQm4yBpzHjFJFoUjpNYxS6+1zlI=;
35
+ Expires=Tue, 30 Nov 2021 20:44:18 GMT; Path=/; SameSite=None; Secure
36
+ recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
37
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,192 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.opentok.com/v2/project/123456/broadcast
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
+ - Fri, 21 Jan 2022 12:05:21 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: |-
36
+ {
37
+ "count" : 6,
38
+ "items" : [ {
39
+ "id" : "ef546c5a-4fd7-4e59-ab3d-f1cfb4148d1d",
40
+ "sessionId" : "SESSIONID",
41
+ "projectId": 123456,
42
+ "createdAt" : 1395187930000,
43
+ "updatedAt": 1395187930000,
44
+ "resolution": "640x480",
45
+ "broadcastUrls": {
46
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F5350f06f-0166-402e-bc27-09ba54948512.m3u8",
47
+ "rtmp": {
48
+ "foo": {
49
+ "serverUrl": "rtmps://myfooserver/myfooapp",
50
+ "streamName": "myfoostream1",
51
+ "status": "started"
52
+ },
53
+ "bar": {
54
+ "serverUrl": "rtmp://mybarserver/mybarapp",
55
+ "streamName": "mybarstream1",
56
+ "status": "live"
57
+ }
58
+ }
59
+ },
60
+ "status": "started",
61
+ "streamMode" : "manual",
62
+ "streams" : []
63
+ }, {
64
+ "id" : "f6e7ee58-d6cf-4a59-896b-6d56b158ec71",
65
+ "sessionId" : "SESSIONID",
66
+ "projectId": 123456,
67
+ "createdAt" : 1395187910000,
68
+ "updatedAt": 1395187910000,
69
+ "resolution": "640x480",
70
+ "broadcastUrls": {
71
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F5350f06f-0166-402e-bc27-09ba54948512.m3u8",
72
+ "rtmp": {
73
+ "foo": {
74
+ "serverUrl": "rtmps://myfooserver/myfooapp",
75
+ "streamName": "myfoostream2",
76
+ "status": "started"
77
+ },
78
+ "bar": {
79
+ "serverUrl": "rtmp://mybarserver/mybarapp",
80
+ "streamName": "mybarstream2",
81
+ "status": "live"
82
+ }
83
+ }
84
+ },
85
+ "status": "started",
86
+ "streamMode" : "manual",
87
+ "streams" : []
88
+ }, {
89
+ "id" : "ef546c5a-4fd7-4e59-ab3d-f1cfb4148d1d",
90
+ "sessionId" : "SESSIONID",
91
+ "projectId": 123456,
92
+ "createdAt" : 1395187836000,
93
+ "updatedAt": 1395187836000,
94
+ "resolution": "640x480",
95
+ "broadcastUrls": {
96
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2Ff6e7ee58-d6cf-4a59-896b-6d56b158ec71.m3u8",
97
+ "rtmp": {
98
+ "foo": {
99
+ "serverUrl": "rtmps://myfooserver/myfooapp",
100
+ "streamName": "myfoostream3",
101
+ "status": "started"
102
+ },
103
+ "bar": {
104
+ "serverUrl": "rtmp://mybarserver/mybarapp",
105
+ "streamName": "mybarstream3",
106
+ "status": "live"
107
+ }
108
+ }
109
+ },
110
+ "status": "started",
111
+ "streamMode" : "manual",
112
+ "streams" : []
113
+ }, {
114
+ "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9",
115
+ "sessionId" : "SESSIONID",
116
+ "projectId": 123456,
117
+ "createdAt" : 1395183243000,
118
+ "updatedAt": 1395183243000,
119
+ "resolution": "640x480",
120
+ "broadcastUrls": {
121
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F30b3ebf1-ba36-4f5b-8def-6f70d9986fe9.m3u8",
122
+ "rtmp": {
123
+ "foo": {
124
+ "serverUrl": "rtmps://myfooserver/myfooapp",
125
+ "streamName": "myfoostream4",
126
+ "status": "started"
127
+ },
128
+ "bar": {
129
+ "serverUrl": "rtmp://mybarserver/mybarapp",
130
+ "streamName": "mybarstream4",
131
+ "status": "live"
132
+ }
133
+ }
134
+ },
135
+ "status": "started",
136
+ "streamMode" : "manual",
137
+ "streams" : []
138
+ }, {
139
+ "id" : "b8f64de1-e218-4091-9544-4cbf369fc238",
140
+ "sessionId" : "SESSIONID",
141
+ "projectId": 123456,
142
+ "createdAt" : 1394396753000,
143
+ "updatedAt": 1394396753000,
144
+ "resolution": "640x480",
145
+ "broadcastUrls": {
146
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2Fb8f64de1-e218-4091-9544-4cbf369fc238.m3u8",
147
+ "rtmp": {
148
+ "foo": {
149
+ "serverUrl": "rtmps://myfooserver/myfooapp",
150
+ "streamName": "myfoostream5",
151
+ "status": "started"
152
+ },
153
+ "bar": {
154
+ "serverUrl": "rtmp://mybarserver/mybarapp",
155
+ "streamName": "mybarstream5",
156
+ "status": "live"
157
+ }
158
+ }
159
+ },
160
+ "status": "started",
161
+ "streamMode" : "manual",
162
+ "streams" : []
163
+ }, {
164
+ "id" : "832641bf-5dbf-41a1-ad94-fea213e59a92",
165
+ "sessionId" : "SESSIONID",
166
+ "projectId": 123456,
167
+ "createdAt" : 1394321113000,
168
+ "updatedAt": 1394321113000,
169
+ "resolution": "640x480",
170
+ "broadcastUrls": {
171
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F832641bf-5dbf-41a1-ad94-fea213e59a92.m3u8",
172
+ "rtmp": {
173
+ "foo": {
174
+ "serverUrl": "rtmps://myfooserver/myfooapp",
175
+ "streamName": "myfoostream6",
176
+ "status": "started"
177
+ },
178
+ "bar": {
179
+ "serverUrl": "rtmp://mybarserver/mybarapp",
180
+ "streamName": "mybarstream6",
181
+ "status": "live"
182
+ }
183
+ }
184
+ },
185
+ "status": "started",
186
+ "streamMode" : "manual",
187
+ "streams" : []
188
+ } ]
189
+ }
190
+ http_version:
191
+ recorded_at: Fri, 21 Jan 2022 12:05:21 GMT
192
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,117 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.opentok.com/v2/project/123456/broadcast?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
+ - Fri, 21 Jan 2022 12:05:21 GMT
27
+ Content-Type:
28
+ - application/json
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ body:
34
+ encoding: UTF-8
35
+ string: |-
36
+ {
37
+ "count" : 3,
38
+ "items" : [ {
39
+ "id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9",
40
+ "sessionId" : "SESSIONID",
41
+ "projectId": 123456,
42
+ "createdAt" : 1395183243000,
43
+ "updatedAt": 1395183243000,
44
+ "resolution": "640x480",
45
+ "broadcastUrls": {
46
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F30b3ebf1-ba36-4f5b-8def-6f70d9986fe9.m3u8",
47
+ "rtmp": {
48
+ "foo": {
49
+ "serverUrl": "rtmps://myfooserver/myfooapp",
50
+ "streamName": "myfoostream4",
51
+ "status": "started"
52
+ },
53
+ "bar": {
54
+ "serverUrl": "rtmp://mybarserver/mybarapp",
55
+ "streamName": "mybarstream4",
56
+ "status": "live"
57
+ }
58
+ }
59
+ },
60
+ "status": "started",
61
+ "streamMode" : "manual",
62
+ "streams" : []
63
+ }, {
64
+ "id" : "b8f64de1-e218-4091-9544-4cbf369fc238",
65
+ "sessionId" : "SESSIONID",
66
+ "projectId": 123456,
67
+ "createdAt" : 1394396753000,
68
+ "updatedAt": 1394396753000,
69
+ "resolution": "640x480",
70
+ "broadcastUrls": {
71
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2Fb8f64de1-e218-4091-9544-4cbf369fc238.m3u8",
72
+ "rtmp": {
73
+ "foo": {
74
+ "serverUrl": "rtmps://myfooserver/myfooapp",
75
+ "streamName": "myfoostream5",
76
+ "status": "started"
77
+ },
78
+ "bar": {
79
+ "serverUrl": "rtmp://mybarserver/mybarapp",
80
+ "streamName": "mybarstream5",
81
+ "status": "live"
82
+ }
83
+ }
84
+ },
85
+ "status": "started",
86
+ "streamMode" : "manual",
87
+ "streams" : []
88
+ }, {
89
+ "id" : "832641bf-5dbf-41a1-ad94-fea213e59a92",
90
+ "sessionId" : "SESSIONID",
91
+ "projectId": 123456,
92
+ "createdAt" : 1394321113000,
93
+ "updatedAt": 1394321113000,
94
+ "resolution": "640x480",
95
+ "broadcastUrls": {
96
+ "hls" : "http://tokbox.com.broadcast2.s3.amazonaws.com/123456%2F832641bf-5dbf-41a1-ad94-fea213e59a92.m3u8",
97
+ "rtmp": {
98
+ "foo": {
99
+ "serverUrl": "rtmps://myfooserver/myfooapp",
100
+ "streamName": "myfoostream6",
101
+ "status": "started"
102
+ },
103
+ "bar": {
104
+ "serverUrl": "rtmp://mybarserver/mybarapp",
105
+ "streamName": "mybarstream6",
106
+ "status": "live"
107
+ }
108
+ }
109
+ },
110
+ "status": "started",
111
+ "streamMode" : "manual",
112
+ "streams" : []
113
+ } ]
114
+ }
115
+ http_version:
116
+ recorded_at: Fri, 21 Jan 2022 12:05:21 GMT
117
+ recorded_with: VCR 6.0.0