opentok 4.3.0 → 4.5.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.
- checksums.yaml +4 -4
- data/CHANGES.md +11 -0
- data/README.md +60 -38
- data/lib/opentok/archive.rb +5 -2
- data/lib/opentok/archives.rb +15 -8
- data/lib/opentok/broadcast.rb +6 -2
- data/lib/opentok/broadcasts.rb +50 -9
- data/lib/opentok/client.rb +90 -0
- data/lib/opentok/exceptions.rb +3 -1
- data/lib/opentok/opentok.rb +10 -5
- 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 +8 -10
- 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 +54 -0
- data/spec/opentok/renders_spec.rb +142 -0
- metadata +34 -3
@@ -0,0 +1,78 @@
|
|
1
|
+
require "active_support/inflector"
|
2
|
+
|
3
|
+
module OpenTok
|
4
|
+
# Represents an Experience Composer render of an OpenTok session.
|
5
|
+
# See {https://tokbox.com/developer/guides/experience-composer/ Experience Composer}.
|
6
|
+
#
|
7
|
+
# @attr [string] id
|
8
|
+
# The unique ID for the Experience Composer.
|
9
|
+
#
|
10
|
+
# @attr [string] session_id
|
11
|
+
# The session ID of the OpenTok session associated with this render.
|
12
|
+
#
|
13
|
+
# @attr [string] project_id
|
14
|
+
# The API key associated with the render.
|
15
|
+
#
|
16
|
+
# @attr [int] created_at
|
17
|
+
# The time the Experience Composer started, expressed in milliseconds since the Unix epoch.
|
18
|
+
#
|
19
|
+
# @attr [int] updated_at
|
20
|
+
# The UNIX timestamp when the Experience Composer status was last updated.
|
21
|
+
#
|
22
|
+
# @attr [string] url
|
23
|
+
# A publicly reachable URL controlled by the customer and capable of generating the content to be rendered without user intervention.
|
24
|
+
#
|
25
|
+
# @attr [string] resolution
|
26
|
+
# The resolution of the Experience Composer (either "640x480", "480x640", "1280x720", "720x1280", "1920x1080", or "1080x1920").
|
27
|
+
#
|
28
|
+
# @attr [string] status
|
29
|
+
# The status of the Experience Composer. Poll frequently to check status updates. This property set to one of the following:
|
30
|
+
# - "starting" — The Vonage Video API platform is in the process of connecting to the remote application at the URL provided. This is the initial state.
|
31
|
+
# - "started" — The Vonage Video API platform has successfully connected to the remote application server, and is publishing the web view to an OpenTok stream.
|
32
|
+
# - "stopped" — The Experience Composer has stopped.
|
33
|
+
# - "failed" — An error occurred and the Experience Composer could not proceed. It may occur at startup if the OpenTok server cannot connect to the remote
|
34
|
+
# application server or republish the stream. It may also occur at any point during the process due to an error in the Vonage Video API platform.
|
35
|
+
#
|
36
|
+
# @attr [string] reason
|
37
|
+
# The reason field is only available when the status is either "stopped" or "failed". If the status is stopped, the reason field will contain either
|
38
|
+
# "Max Duration Exceeded" or "Stop Requested." If the status is failed, the reason will contain a more specific error message.
|
39
|
+
#
|
40
|
+
# @attr [string] streamId
|
41
|
+
# The ID of the composed stream being published. The streamId is not available when the status is "starting" and may not be available when the status is "failed".
|
42
|
+
class Render
|
43
|
+
|
44
|
+
# @private
|
45
|
+
def initialize(interface, json)
|
46
|
+
@interface = interface
|
47
|
+
# TODO: validate json fits schema
|
48
|
+
@json = json
|
49
|
+
end
|
50
|
+
|
51
|
+
# A JSON-encoded string representation of the Experience Composer render.
|
52
|
+
def to_json
|
53
|
+
@json.to_json
|
54
|
+
end
|
55
|
+
|
56
|
+
# Stops the OpenTok Experience Composer render.
|
57
|
+
def stop
|
58
|
+
# TODO: validate returned json fits schema
|
59
|
+
@json = @interface.stop @json['id']
|
60
|
+
end
|
61
|
+
|
62
|
+
# Gets info about the OpenTok Experience Composer render.
|
63
|
+
def info
|
64
|
+
# TODO: validate returned json fits schema
|
65
|
+
@json = @interface.find @json['id']
|
66
|
+
end
|
67
|
+
|
68
|
+
# @private ignore
|
69
|
+
def method_missing(method, *args, &block)
|
70
|
+
camelized_method = method.to_s.camelize(:lower)
|
71
|
+
if @json.has_key? camelized_method and args.empty?
|
72
|
+
@json[camelized_method]
|
73
|
+
else
|
74
|
+
super method, *args, &block
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "opentok/render"
|
2
|
+
|
3
|
+
module OpenTok
|
4
|
+
# A class for accessing an array of Experience Composer Render objects.
|
5
|
+
class RenderList < Array
|
6
|
+
# The total number of Experience Composer renders.
|
7
|
+
attr_reader :total
|
8
|
+
|
9
|
+
def initialize(interface, json)
|
10
|
+
@total = json["count"]
|
11
|
+
super json["items"].map { |item| ::OpenTok::Render.new interface, item }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -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)
|
@@ -92,18 +92,16 @@ module OpenTok
|
|
92
92
|
# by calling the disable_force_mute() method.
|
93
93
|
#
|
94
94
|
# @param [String] session_id The session ID.
|
95
|
-
# @param [Hash] opts An optional hash defining options for muting action. For example:
|
95
|
+
# @param [Hash] opts An optional hash defining options for the muting action. For example:
|
96
|
+
# {
|
97
|
+
# "excluded_streams" => [
|
98
|
+
# "excludedStreamId1",
|
99
|
+
# "excludedStreamId2"
|
100
|
+
# ]
|
101
|
+
# }
|
96
102
|
# @option opts [Array] :excluded_streams The stream IDs for streams that should not be muted.
|
97
103
|
# This is an optional property. If you omit this property, all streams in the session will be muted.
|
98
104
|
#
|
99
|
-
# @example
|
100
|
-
# {
|
101
|
-
# "excluded_streams" => [
|
102
|
-
# "excludedStreamId1",
|
103
|
-
# "excludedStreamId2"
|
104
|
-
# ]
|
105
|
-
# }
|
106
|
-
#
|
107
105
|
def force_mute_all(session_id, opts = {})
|
108
106
|
opts['active'] = 'true'
|
109
107
|
response = @client.force_mute_session(session_id, opts)
|
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
|