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,101 @@
|
|
1
|
+
require "opentok/client"
|
2
|
+
require "opentok/render"
|
3
|
+
require "opentok/render_list"
|
4
|
+
|
5
|
+
module OpenTok
|
6
|
+
# A class for working with OpenTok Experience Composer renders.
|
7
|
+
# See {https://tokbox.com/developer/guides/experience-composer/ Experience Composer}.
|
8
|
+
class Renders
|
9
|
+
|
10
|
+
# @private
|
11
|
+
def initialize(client)
|
12
|
+
@client = client
|
13
|
+
end
|
14
|
+
|
15
|
+
# Starts an Experience Composer render for an OpenTok session.
|
16
|
+
#
|
17
|
+
# @param [String] session_id (Required) The session ID of the OpenTok session that will include the Experience Composer stream.
|
18
|
+
#
|
19
|
+
# @param [Hash] options (Required) A hash defining options for the render.
|
20
|
+
#
|
21
|
+
# @option options [String] :token (Required) A valid OpenTok token with a Publisher role and (optionally) connection data to be associated with the output stream.
|
22
|
+
#
|
23
|
+
# @option options [String] :url (Required) A publicly reachable URL controlled by the customer and capable of generating the content to be rendered without user intervention.
|
24
|
+
# The minimum length of the URL is 15 characters and the maximum length is 2048 characters.
|
25
|
+
#
|
26
|
+
# @option options [Integer] :max_duration (Optional) The maximum time allowed for the Experience Composer, in seconds. After this time, it is stopped
|
27
|
+
# automatically, if it is still running. The maximum value is 36000 (10 hours), the minimum value is 60 (1 minute), and the default value is 7200 (2 hours).
|
28
|
+
# When the Experience Composer ends, its stream is unpublished and an event is posted to the callback URL, if configured in the Account Portal.
|
29
|
+
#
|
30
|
+
# @option options [String] :resolution The resolution of the Experience Composer, either "640x480" (SD landscape), "480x640" (SD portrait), "1280x720" (HD landscape),
|
31
|
+
# "720x1280" (HD portrait), "1920x1080" (FHD landscape), or "1080x1920" (FHD portrait). By default, this resolution is "1280x720" (HD landscape, the default).
|
32
|
+
#
|
33
|
+
# @option options [Hash] :properties (Optional) The initial configuration of Publisher properties for the composed output stream. The properties object contains
|
34
|
+
# the key <code>:name</code> (String) which serves as the name of the composed output stream which is published to the session. The name must have a minimum length of 1 and
|
35
|
+
# a maximum length of 200.
|
36
|
+
#
|
37
|
+
# @return [Render] The render object, which includes properties defining the render, including the render ID.
|
38
|
+
#
|
39
|
+
# @raise [OpenTokRenderError] The render could not be started. The request was invalid.
|
40
|
+
# @raise [OpenTokAuthenticationError] Authentication failed while starting a render. Invalid API key.
|
41
|
+
# @raise [OpenTokError] OpenTok server error.
|
42
|
+
def start(session_id, options = {})
|
43
|
+
raise ArgumentError, "session_id not provided" if session_id.to_s.empty?
|
44
|
+
raise ArgumentError, "options cannot be empty" if options.empty?
|
45
|
+
raise ArgumentError, "token property is required in options" unless options.has_key?(:token)
|
46
|
+
raise ArgumentError, "url property is required in options" unless options.has_key?(:url)
|
47
|
+
|
48
|
+
render_json = @client.start_render(session_id, options)
|
49
|
+
Render.new self, render_json
|
50
|
+
end
|
51
|
+
|
52
|
+
# Stops an OpenTok Experience Composer render.
|
53
|
+
#
|
54
|
+
# @param [String] render_id (Required) The render ID.
|
55
|
+
#
|
56
|
+
# @return [Render] The render object, which includes properties defining the render.
|
57
|
+
#
|
58
|
+
# @raise [OpenTokRenderError] The request was invalid.
|
59
|
+
# @raise [OpenTokAuthenticationError] Authentication failed while stopping a render. Invalid API key.
|
60
|
+
# @raise [OpenTokRenderError] No matching render found (with the specified ID) or it is already stopped
|
61
|
+
# @raise [OpenTokError] OpenTok server error.
|
62
|
+
def stop(render_id)
|
63
|
+
raise ArgumentError, "render_id not provided" if render_id.to_s.empty?
|
64
|
+
|
65
|
+
render_json = @client.stop_render(render_id)
|
66
|
+
Render.new self, render_json
|
67
|
+
end
|
68
|
+
|
69
|
+
# Gets a Render object for the given render ID.
|
70
|
+
#
|
71
|
+
# @param [String] render_id (Required) The render ID.
|
72
|
+
#
|
73
|
+
# @return [Render] The render object, which includes properties defining the render.
|
74
|
+
#
|
75
|
+
# @raise [OpenTokRenderError] The request was invalid.
|
76
|
+
# @raise [OpenTokAuthenticationError] Authentication failed while stopping a render. Invalid API key.
|
77
|
+
# @raise [OpenTokRenderError] No matching render found (with the specified ID) or it is already stopped
|
78
|
+
# @raise [OpenTokError] OpenTok server error.
|
79
|
+
def find(render_id)
|
80
|
+
raise ArgumentError, "render_id not provided" if render_id.to_s.empty?
|
81
|
+
|
82
|
+
render_json = @client.get_render(render_id.to_s)
|
83
|
+
Render.new self, render_json
|
84
|
+
end
|
85
|
+
|
86
|
+
# Returns a RenderList, which is an array of Experience Composers renders that are associated with a project.
|
87
|
+
#
|
88
|
+
# @param [Hash] options A hash with keys defining which range of renders to retrieve.
|
89
|
+
# @option options [integer] :offset (Optional). The start offset for the list of Experience Composer renders. The default is 0.
|
90
|
+
# @option options [integer] :count Optional. The number of Experience Composer renders to retrieve starting at the offset. The default value
|
91
|
+
# is 50 and the maximum is 1000.
|
92
|
+
#
|
93
|
+
# @return [RenderList] An RenderList object, which is an array of Render objects.
|
94
|
+
def list(options = {})
|
95
|
+
raise ArgumentError, "Limit is invalid" unless options[:count].nil? || (0..1000).include?(options[:count])
|
96
|
+
|
97
|
+
render_list_json = @client.list_renders(options[:offset], options[:count])
|
98
|
+
RenderList.new self, render_list_json
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
data/lib/opentok/session.rb
CHANGED
@@ -31,10 +31,10 @@ module OpenTok
|
|
31
31
|
# * <code>:publisher</code> -- A publisher can publish streams, subscribe to
|
32
32
|
# streams, and signal. (This is the default value if you do not specify a role.)
|
33
33
|
#
|
34
|
-
# * <code>:moderator</code> --
|
35
|
-
# publisher,
|
36
|
-
#
|
37
|
-
#
|
34
|
+
# * <code>:moderator</code> -- n addition to the privileges granted to a
|
35
|
+
# publisher, a moderator can perform moderation functions, such as forcing clients
|
36
|
+
# to disconnect, to stop publishing streams, or to mute audio in published streams. See the
|
37
|
+
# {https://tokbox.com/developer/guides/moderation/ Moderation developer guide}.
|
38
38
|
# @option options [integer] :expire_time The expiration time, in seconds since the UNIX epoch.
|
39
39
|
# Pass in 0 to use the default expiration time of 24 hours after the token creation time.
|
40
40
|
# The maximum expiration time is 30 days after the creation time.
|
data/lib/opentok/streams.rb
CHANGED
@@ -4,7 +4,7 @@ require 'opentok/stream_list'
|
|
4
4
|
|
5
5
|
module OpenTok
|
6
6
|
# A class for working with OpenTok streams. It includes methods for getting info
|
7
|
-
# about OpenTok streams
|
7
|
+
# about OpenTok streams, for setting layout classes for streams, and for muting streams.
|
8
8
|
class Streams
|
9
9
|
# @private
|
10
10
|
def initialize(client)
|
data/lib/opentok/version.rb
CHANGED
@@ -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"}'
|
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: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 03 Oct 2022 10:19:16 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
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
|
+
"multiArchiveTag":"archive-1"
|
48
|
+
}
|
49
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
50
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,49 @@
|
|
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"}'
|
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: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 03 Oct 2022 10:19:17 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
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
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
49
|
+
recorded_with: VCR 6.0.0
|
data/spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
ADDED
@@ -0,0 +1,52 @@
|
|
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"}'
|
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: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Wed, 07 Sep 2022 14:23:34 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Connection:
|
34
|
+
- keep-alive
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: |-
|
38
|
+
{
|
39
|
+
"createdAt" : 1395183243556,
|
40
|
+
"duration" : 0,
|
41
|
+
"id" : "30b3ebf1-ba36-4f5b-8def-6f70d9986fe9",
|
42
|
+
"name" : "",
|
43
|
+
"partnerId" : 123456,
|
44
|
+
"reason" : "",
|
45
|
+
"sessionId" : "SESSIONID",
|
46
|
+
"size" : 0,
|
47
|
+
"status" : "started",
|
48
|
+
"url" : null,
|
49
|
+
"multiArchiveTag":"archive-1"
|
50
|
+
}
|
51
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
52
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/broadcast
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"sessionId":"SESSIONID","outputs":{"hls":{}},"multiBroadcastTag":"broadcast-1"}'
|
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: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 03 Oct 2022 11:11:31 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: |-
|
36
|
+
{
|
37
|
+
"id":"BROADCASTID",
|
38
|
+
"sessionId":"SESSIONID",
|
39
|
+
"projectId":123456,
|
40
|
+
"createdAt":1538086900154,
|
41
|
+
"broadcastUrls":
|
42
|
+
{
|
43
|
+
"hls":"https://cdn-broadcast001-pdx.tokbox.com/14787/14787_b930bf08-1c9f-4c55-ab04-7d192578c057.smil/playlist.m3u8"
|
44
|
+
},
|
45
|
+
"updatedAt":1538086900489,
|
46
|
+
"status":"started",
|
47
|
+
"maxDuration":7200,
|
48
|
+
"resolution":"640x480",
|
49
|
+
"partnerId":100,
|
50
|
+
"event":"broadcast",
|
51
|
+
"multiBroadcastTag":"broadcast-1"
|
52
|
+
}
|
53
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
54
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/broadcast
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"sessionId":"SESSIONID","outputs":{"hls":{}}}'
|
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: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Mon, 03 Oct 2022 11:11:31 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: |-
|
36
|
+
{
|
37
|
+
"id":"BROADCASTID",
|
38
|
+
"sessionId":"SESSIONID",
|
39
|
+
"projectId":123456,
|
40
|
+
"createdAt":1538086900154,
|
41
|
+
"broadcastUrls":
|
42
|
+
{
|
43
|
+
"hls":"https://cdn-broadcast001-pdx.tokbox.com/14787/14787_b930bf08-1c9f-4c55-ab04-7d192578c057.smil/playlist.m3u8"
|
44
|
+
},
|
45
|
+
"updatedAt":1538086900489,
|
46
|
+
"status":"started",
|
47
|
+
"maxDuration":7200,
|
48
|
+
"resolution":"640x480",
|
49
|
+
"partnerId":100,
|
50
|
+
"event":"broadcast"
|
51
|
+
}
|
52
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
53
|
+
recorded_with: VCR 6.0.0
|
data/spec/cassettes/OpenTok_Broadcasts/starts_a_broadcast_with_a_specified_multiBroadcastTag.yml
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/broadcast
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"sessionId":"SESSIONID","outputs":{"hls":{}},"multiBroadcastTag":"broadcast-1"}'
|
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: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- nginx
|
27
|
+
Date:
|
28
|
+
- Wed, 07 Sep 2022 13:52:17 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: |-
|
36
|
+
{
|
37
|
+
"id":"BROADCASTID",
|
38
|
+
"sessionId":"SESSIONID",
|
39
|
+
"projectId":123456,
|
40
|
+
"createdAt":1538086900154,
|
41
|
+
"broadcastUrls":
|
42
|
+
{
|
43
|
+
"hls":"https://cdn-broadcast001-pdx.tokbox.com/14787/14787_b930bf08-1c9f-4c55-ab04-7d192578c057.smil/playlist.m3u8"
|
44
|
+
},
|
45
|
+
"updatedAt":1538086900489,
|
46
|
+
"status":"started",
|
47
|
+
"maxDuration":7200,
|
48
|
+
"resolution":"640x480",
|
49
|
+
"partnerId":100,
|
50
|
+
"event":"broadcast",
|
51
|
+
"multiBroadcastTag":"broadcast-1"
|
52
|
+
}
|
53
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
54
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
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: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Server:
|
24
|
+
- nginx
|
25
|
+
Date:
|
26
|
+
- Thu, 15 Sep 2022 10:25:36 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: |-
|
34
|
+
{
|
35
|
+
"id": "80abaf0d-25a3-4efc-968f-6268d620668d",
|
36
|
+
"sessionId": "SESSIONID",
|
37
|
+
"projectId": "e2343f23456g34709d2443a234",
|
38
|
+
"createdAt": 1437676551000,
|
39
|
+
"updatedAt": 1437676551000,
|
40
|
+
"url": "https://example.com/my-render",
|
41
|
+
"resolution": "1280x720",
|
42
|
+
"status": "started",
|
43
|
+
"streamId": "e32445b743678c98230f238"
|
44
|
+
}
|
45
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
46
|
+
recorded_with: VCR 6.0.0
|
@@ -0,0 +1,108 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/render
|
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:09:53 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: |-
|
34
|
+
{
|
35
|
+
"count":6,
|
36
|
+
"items":[
|
37
|
+
{
|
38
|
+
"id":"80abaf0d-25a3-4efc-968f-6268d620668d",
|
39
|
+
"sessionId":"1_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": "d2334b35690a92f78945"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"id":"d95f6496-df6e-4f49-86d6-832e00303602",
|
50
|
+
"sessionId":"2_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": "d2334b35690a92f78945",
|
58
|
+
"reason":"Max duration exceeded"
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"id":"96abaf0d-25a3-4efc-968f-6268d620668d",
|
62
|
+
"sessionId":"3_MX4yNzA4NjYxMn5-MTU0NzA4MDUyMTEzNn5sOXU5ZnlWYXplRnZGblV4RUo3dXJpZk1-fg",
|
63
|
+
"projectId":"27086612",
|
64
|
+
"createdAt":1547080532099,
|
65
|
+
"updatedAt":1547080532099,
|
66
|
+
"url": "https://example.com/my-render",
|
67
|
+
"resolution": "1280x720",
|
68
|
+
"status": "started",
|
69
|
+
"streamId": "d2334b35690a92f78946"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"id":"c34f6496-df6e-4f49-86d6-832e00303602",
|
73
|
+
"sessionId":"4_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg",
|
74
|
+
"projectId":"27086612",
|
75
|
+
"createdAt":1547080511760,
|
76
|
+
"updatedAt":1547080518965,
|
77
|
+
"url": "https://example.com/my-render",
|
78
|
+
"resolution": "1280x720",
|
79
|
+
"status":"stopped",
|
80
|
+
"streamId": "d2334b35690a92f78912",
|
81
|
+
"reason":"Stop Requested"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"id":"52abaf0d-25a3-4efc-968f-6268d620668d",
|
85
|
+
"sessionId":"1_MX4yNzA4NjYxMn5-MTU0NzA4MDUyMTEzNn5sOXU5ZnlWYXplRnZGblV4RUo3dXJpZk1-fg",
|
86
|
+
"projectId":"27086612",
|
87
|
+
"createdAt":1547080532099,
|
88
|
+
"updatedAt":1547080532099,
|
89
|
+
"url": "https://example.com/my-render",
|
90
|
+
"resolution": "1280x720",
|
91
|
+
"status": "started",
|
92
|
+
"streamId": "d2334b35690a92f78948"
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"id":"a87f6496-df6e-4f49-86d6-832e00303602",
|
96
|
+
"sessionId":"2_MX4yNzA4NjYxMn5-MTU0NzA4MDUwMDc2MH5STWRiSE1jZjVoV3lBQU9nN2JuNElUV3V-fg",
|
97
|
+
"projectId":"27086612",
|
98
|
+
"createdAt":1547080511760,
|
99
|
+
"updatedAt":1547080518965,
|
100
|
+
"url": "https://example.com/my-render",
|
101
|
+
"resolution": "1280x720",
|
102
|
+
"status":"starting",
|
103
|
+
"streamId": "d2334b35690a92f78947"
|
104
|
+
}
|
105
|
+
]
|
106
|
+
}
|
107
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
108
|
+
recorded_with: VCR 6.0.0
|
data/spec/cassettes/OpenTok_Renders/for_many_renders/should_return_count_number_of_renders.yml
ADDED
@@ -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
|
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:32:24 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":"80abaf0d-25a3-4efc-968f-6268d620668d",
|
39
|
+
"sessionId":"1_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": "d2334b35690a92f78945"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"id":"d95f6496-df6e-4f49-86d6-832e00303602",
|
50
|
+
"sessionId":"2_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": "d2334b35690a92f78945",
|
58
|
+
"reason":"Max duration exceeded"
|
59
|
+
}
|
60
|
+
]
|
61
|
+
}
|
62
|
+
recorded_at: Tue, 18 Apr 2017 10:17:40 GMT
|
63
|
+
recorded_with: VCR 6.0.0
|