opentok 4.11.0 → 4.13.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 +8 -0
- data/lib/opentok/archives.rb +12 -1
- data/lib/opentok/opentok.rb +1 -1
- data/lib/opentok/session.rb +3 -0
- data/lib/opentok/version.rb +1 -1
- data/lib/opentok/websocket.rb +1 -0
- data/spec/cassettes/OpenTok_Archives/should_create_an_archive_with_maxBitrate_set_to_specified_max_bitrate_value.yml +52 -0
- data/spec/cassettes/OpenTok_Archives/should_create_an_archive_with_quantizationParameter_set_to_specified_value.yml +52 -0
- data/spec/cassettes/OpenTok_WebSocket/receives_a_valid_response_with_opts.yml +39 -0
- data/spec/opentok/archives_spec.rb +14 -0
- data/spec/opentok/websocket_spec.rb +11 -0
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8856de6eda311f8036e05575702122ba484553a7899cbeecc5246be2551fe1bf
|
4
|
+
data.tar.gz: 6c9caa43050de91eaf2fc4fa1cc2793844cb0c81f90400de4add8037ace88f86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 174cced0d88b55c47b5d2e478ad4b77d9ae0905a3f48470b59f203f982395a83eb9e29e8bcf2ec9fa0f6e9cc15c49babd2371ca27b69052e60d1de2d053de46f
|
7
|
+
data.tar.gz: 640c7dabed0a31e9e32194fe99914e3ab296fe04f4009cc561ef764d5c4b28e1a53c935fc2bf2ceff2d4f68def44527c75a919fc527bcf30efa7828cc884106b
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# 4.13.0
|
2
|
+
|
3
|
+
* Updating the `Archives#create` method to allow `quantization_parameter` as an option, and the `WebSocket#connect` method to allow `bidirectional` as an option. See [#290](https://github.com/opentok/OpenTok-Ruby-SDK/pull/290)
|
4
|
+
|
5
|
+
# 4.12.0
|
6
|
+
|
7
|
+
* Updating the `Archives#create` method to allow `max_bitrate` as an option. See [#288](https://github.com/opentok/OpenTok-Ruby-SDK/pull/288)
|
8
|
+
|
1
9
|
# 4.11.0
|
2
10
|
|
3
11
|
* Updating client token creation to use JWTs by default. See [#287](https://github.com/opentok/OpenTok-Ruby-SDK/pull/274)
|
data/lib/opentok/archives.rb
CHANGED
@@ -79,6 +79,15 @@ module OpenTok
|
|
79
79
|
# layout type. For more information, see
|
80
80
|
# {https://tokbox.com/developer/guides/archiving/layout-control.html Customizing
|
81
81
|
# the video layout for composed archives}.
|
82
|
+
# @option options [Integer] :max_bitrate (Optional) The maximum video bitrate for the archive, in bits per second. The minimum
|
83
|
+
# value is 100,000 and the maximum is 6,000,000. This option is only valid for composed archives. Set the maximum video bitrate
|
84
|
+
# to control the size of the composed archive. This maximum bitrate applies to the video bitrate only. If the output archive has
|
85
|
+
# audio, those bits will be excluded from the limit.
|
86
|
+
#
|
87
|
+
# @option options [Integer] :quantization_parameter (Optional) The quantization parameter (QP) is an optional video encoding value allowed for composed archiving,
|
88
|
+
# smaller values generate higher quality and larger archives, larger values generate lower quality and smaller archives, QP uses variable bitrate (VBR). The minimum
|
89
|
+
# value is 15 and the maximum is 40.
|
90
|
+
# This parameter is mutually exclusive with the max_bitrate parameter.
|
82
91
|
#
|
83
92
|
# @return [Archive] The Archive object, which includes properties defining the archive,
|
84
93
|
# including the archive ID.
|
@@ -105,7 +114,9 @@ module OpenTok
|
|
105
114
|
:resolution,
|
106
115
|
:layout,
|
107
116
|
:multi_archive_tag,
|
108
|
-
:stream_mode
|
117
|
+
:stream_mode,
|
118
|
+
:max_bitrate,
|
119
|
+
:quantization_parameter
|
109
120
|
]
|
110
121
|
opts = options.inject({}) do |m,(k,v)|
|
111
122
|
if valid_opts.include? k.to_sym
|
data/lib/opentok/opentok.rb
CHANGED
@@ -36,7 +36,6 @@ module OpenTok
|
|
36
36
|
# the token.
|
37
37
|
#
|
38
38
|
# @param [Hash] options A hash defining options for the token.
|
39
|
-
# @option options [String] :token_type The type of token to generate. Must be one of 'T1' or 'JWT'. 'JWT' is the default.
|
40
39
|
# @option options [Symbol] :role The role for the token. Set this to one of the following
|
41
40
|
# values:
|
42
41
|
# * <code>:subscriber</code> -- A subscriber can only subscribe to streams.
|
@@ -60,6 +59,7 @@ module OpenTok
|
|
60
59
|
# published by the client. Layout classes are used in customizing the layout of videos in
|
61
60
|
# {https://tokbox.com/developer/guides/broadcast/live-streaming/ live streaming broadcasts}
|
62
61
|
# and {https://tokbox.com/developer/guides/archiving/layout-control.html composed archives}.
|
62
|
+
# @option options [String] :token_type The type of token to generate. Must be one of 'T1' or 'JWT'. 'JWT' is the default.
|
63
63
|
# @return [String] The token string.
|
64
64
|
class OpenTok
|
65
65
|
|
data/lib/opentok/session.rb
CHANGED
@@ -36,6 +36,9 @@ module OpenTok
|
|
36
36
|
# * <code>:publisher</code> -- A publisher can publish streams, subscribe to
|
37
37
|
# streams, and signal. (This is the default value if you do not specify a role.)
|
38
38
|
#
|
39
|
+
# * <code>:publisheronly</code> -- A client connected with a publisheronly token
|
40
|
+
# can publish streams but cannot subscribe to streams.
|
41
|
+
#
|
39
42
|
# * <code>:moderator</code> -- n addition to the privileges granted to a
|
40
43
|
# publisher, a moderator can perform moderation functions, such as forcing clients
|
41
44
|
# to disconnect, to stop publishing streams, or to mute audio in published streams. See the
|
data/lib/opentok/version.rb
CHANGED
data/lib/opentok/websocket.rb
CHANGED
@@ -26,6 +26,7 @@ module OpenTok
|
|
26
26
|
# If you omit this property, all streams in the session will be included.
|
27
27
|
# @option opts [Hash] :headers (optional) A hash of key-value pairs of headers to be sent to your WebSocket server with each message,
|
28
28
|
# with a maximum length of 512 bytes.
|
29
|
+
# @option opts [Boolean] :bidirectional (optional) Whether the WebSocket connection should be bidirectional.
|
29
30
|
def connect(session_id, token, websocket_uri, opts = {})
|
30
31
|
response = @client.connect_websocket(session_id, token, websocket_uri, opts)
|
31
32
|
end
|
@@ -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","maxBitrate":200000}'
|
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
|
+
- Fri, 07 Feb 2025 12:17:20 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
|
+
"maxBitrate": 200000
|
50
|
+
}
|
51
|
+
recorded_at: Fri, 07 Feb 2025 12:17:20 GMT
|
52
|
+
recorded_with: VCR 6.0.0
|
@@ -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","quantizationParameter":40}'
|
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, 06 Oct 2025 08:48:17 GMT
|
29
|
+
Content-Type:
|
30
|
+
- application/json; charset=utf-8
|
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
|
+
"quantizationParameter": 40
|
50
|
+
}
|
51
|
+
recorded_at: Mon, 06 Oct 2025 08:48:17 GMT
|
52
|
+
recorded_with: VCR 6.3.1
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.opentok.com/v2/project/123456/connect
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"sessionId":"SESSIONID","token":"TOKENID","websocket":{"uri":"ws://service.com/wsendpoint","streams":["123456"],"headers":{"foo":"bar"},"bidirectional":true}}'
|
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
|
+
Date:
|
26
|
+
- Mon, 06 Oct 2025 09:42:20 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
X-Opentok-Trace:
|
34
|
+
- f=unknown&s=cerberus&u=3E467A7C-6130-469D-BD7B-10308CD0D395
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"id":"2299ba24-a6de-417c-88f7-28da54a441cf","connectionId":"833a7182-61a5-49d4-baae-c324b09953af"}'
|
38
|
+
recorded_at: Mon, 06 Oct 2025 09:42:20 GMT
|
39
|
+
recorded_with: VCR 6.3.1
|
@@ -70,6 +70,20 @@ describe OpenTok::Archives do
|
|
70
70
|
expect(archive.stream_mode).to eq stream_mode
|
71
71
|
end
|
72
72
|
|
73
|
+
it "should create an archive with maxBitrate set to specified max_bitrate value", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
74
|
+
max_bitrate = 200000
|
75
|
+
archive = archives.create session_id, :max_bitrate => max_bitrate
|
76
|
+
expect(archive).to be_an_instance_of OpenTok::Archive
|
77
|
+
expect(archive.max_bitrate).to eq max_bitrate
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should create an archive with quantizationParameter set to specified value", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
81
|
+
quantization_parameter = 40
|
82
|
+
archive = archives.create session_id, :quantization_parameter => quantization_parameter
|
83
|
+
expect(archive).to be_an_instance_of OpenTok::Archive
|
84
|
+
expect(archive.quantization_parameter).to eq quantization_parameter
|
85
|
+
end
|
86
|
+
|
73
87
|
it "should create audio only archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
74
88
|
archive = archives.create session_id, :has_video => false
|
75
89
|
expect(archive).to be_an_instance_of OpenTok::Archive
|
@@ -23,4 +23,15 @@ describe OpenTok::WebSocket do
|
|
23
23
|
response = websocket.connect(session_id, expiring_token, websocket_uri)
|
24
24
|
expect(response).not_to be_nil
|
25
25
|
end
|
26
|
+
|
27
|
+
it "receives a valid response with opts", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
|
28
|
+
opts = {
|
29
|
+
"streams" => ["123456"],
|
30
|
+
"headers" => {"foo" => "bar"},
|
31
|
+
"bidirectional" => true
|
32
|
+
}
|
33
|
+
|
34
|
+
response = websocket.connect(session_id, expiring_token, websocket_uri, opts)
|
35
|
+
expect(response).not_to be_nil
|
36
|
+
end
|
26
37
|
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.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stijn Mathysen
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
- Song Zheng
|
10
10
|
- Patrick Quinn-Graham
|
11
11
|
- Ankur Oberoi
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2025-
|
15
|
+
date: 2025-10-06 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bundler
|
@@ -245,7 +245,9 @@ files:
|
|
245
245
|
- spec/cassettes/OpenTok_Archives/http_client_errors/.yml
|
246
246
|
- spec/cassettes/OpenTok_Archives/removes_a_stream_from_an_archive.yml
|
247
247
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml
|
248
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_maxBitrate_set_to_specified_max_bitrate_value.yml
|
248
249
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml
|
250
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_quantizationParameter_set_to_specified_value.yml
|
249
251
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_streamMode_set_to_specified_stream_mode_value.yml
|
250
252
|
- spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
|
251
253
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
@@ -319,6 +321,7 @@ files:
|
|
319
321
|
- spec/cassettes/OpenTok_Streams/get_specific_stream_information.yml
|
320
322
|
- spec/cassettes/OpenTok_Streams/layout_working_on_two_stream_list.yml
|
321
323
|
- spec/cassettes/OpenTok_WebSocket/receives_a_valid_response.yml
|
324
|
+
- spec/cassettes/OpenTok_WebSocket/receives_a_valid_response_with_opts.yml
|
322
325
|
- spec/matchers/token.rb
|
323
326
|
- spec/opentok/archives_spec.rb
|
324
327
|
- spec/opentok/broadcasts_spec.rb
|
@@ -340,7 +343,7 @@ licenses:
|
|
340
343
|
- MIT
|
341
344
|
metadata:
|
342
345
|
source_code_uri: https://github.com/opentok/OpenTok-Ruby-SDK
|
343
|
-
post_install_message:
|
346
|
+
post_install_message:
|
344
347
|
rdoc_options: []
|
345
348
|
require_paths:
|
346
349
|
- lib
|
@@ -355,8 +358,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
355
358
|
- !ruby/object:Gem::Version
|
356
359
|
version: '0'
|
357
360
|
requirements: []
|
358
|
-
rubygems_version: 3.5.
|
359
|
-
signing_key:
|
361
|
+
rubygems_version: 3.5.3
|
362
|
+
signing_key:
|
360
363
|
specification_version: 4
|
361
364
|
summary: Ruby gem for the OpenTok API
|
362
365
|
test_files:
|
@@ -366,7 +369,9 @@ test_files:
|
|
366
369
|
- spec/cassettes/OpenTok_Archives/http_client_errors/.yml
|
367
370
|
- spec/cassettes/OpenTok_Archives/removes_a_stream_from_an_archive.yml
|
368
371
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml
|
372
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_maxBitrate_set_to_specified_max_bitrate_value.yml
|
369
373
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml
|
374
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_quantizationParameter_set_to_specified_value.yml
|
370
375
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_streamMode_set_to_specified_stream_mode_value.yml
|
371
376
|
- spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
|
372
377
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
@@ -440,6 +445,7 @@ test_files:
|
|
440
445
|
- spec/cassettes/OpenTok_Streams/get_specific_stream_information.yml
|
441
446
|
- spec/cassettes/OpenTok_Streams/layout_working_on_two_stream_list.yml
|
442
447
|
- spec/cassettes/OpenTok_WebSocket/receives_a_valid_response.yml
|
448
|
+
- spec/cassettes/OpenTok_WebSocket/receives_a_valid_response_with_opts.yml
|
443
449
|
- spec/matchers/token.rb
|
444
450
|
- spec/opentok/archives_spec.rb
|
445
451
|
- spec/opentok/broadcasts_spec.rb
|