opentok 4.12.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 +4 -0
- data/lib/opentok/archives.rb +7 -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_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 +7 -0
- data/spec/opentok/websocket_spec.rb +11 -0
- metadata +10 -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,7 @@
|
|
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
|
+
|
1
5
|
# 4.12.0
|
2
6
|
|
3
7
|
* Updating the `Archives#create` method to allow `max_bitrate` as an option. See [#288](https://github.com/opentok/OpenTok-Ruby-SDK/pull/288)
|
data/lib/opentok/archives.rb
CHANGED
@@ -84,6 +84,11 @@ module OpenTok
|
|
84
84
|
# to control the size of the composed archive. This maximum bitrate applies to the video bitrate only. If the output archive has
|
85
85
|
# audio, those bits will be excluded from the limit.
|
86
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.
|
91
|
+
#
|
87
92
|
# @return [Archive] The Archive object, which includes properties defining the archive,
|
88
93
|
# including the archive ID.
|
89
94
|
#
|
@@ -110,7 +115,8 @@ module OpenTok
|
|
110
115
|
:layout,
|
111
116
|
:multi_archive_tag,
|
112
117
|
:stream_mode,
|
113
|
-
:max_bitrate
|
118
|
+
:max_bitrate,
|
119
|
+
:quantization_parameter
|
114
120
|
]
|
115
121
|
opts = options.inject({}) do |m,(k,v)|
|
116
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","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
|
@@ -77,6 +77,13 @@ describe OpenTok::Archives do
|
|
77
77
|
expect(archive.max_bitrate).to eq max_bitrate
|
78
78
|
end
|
79
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
|
+
|
80
87
|
it "should create audio only archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
81
88
|
archive = archives.create session_id, :has_video => false
|
82
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
|
@@ -247,6 +247,7 @@ files:
|
|
247
247
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml
|
248
248
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_maxBitrate_set_to_specified_max_bitrate_value.yml
|
249
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
|
250
251
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_streamMode_set_to_specified_stream_mode_value.yml
|
251
252
|
- spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
|
252
253
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
@@ -320,6 +321,7 @@ files:
|
|
320
321
|
- spec/cassettes/OpenTok_Streams/get_specific_stream_information.yml
|
321
322
|
- spec/cassettes/OpenTok_Streams/layout_working_on_two_stream_list.yml
|
322
323
|
- spec/cassettes/OpenTok_WebSocket/receives_a_valid_response.yml
|
324
|
+
- spec/cassettes/OpenTok_WebSocket/receives_a_valid_response_with_opts.yml
|
323
325
|
- spec/matchers/token.rb
|
324
326
|
- spec/opentok/archives_spec.rb
|
325
327
|
- spec/opentok/broadcasts_spec.rb
|
@@ -341,7 +343,7 @@ licenses:
|
|
341
343
|
- MIT
|
342
344
|
metadata:
|
343
345
|
source_code_uri: https://github.com/opentok/OpenTok-Ruby-SDK
|
344
|
-
post_install_message:
|
346
|
+
post_install_message:
|
345
347
|
rdoc_options: []
|
346
348
|
require_paths:
|
347
349
|
- lib
|
@@ -356,8 +358,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
356
358
|
- !ruby/object:Gem::Version
|
357
359
|
version: '0'
|
358
360
|
requirements: []
|
359
|
-
rubygems_version: 3.5.
|
360
|
-
signing_key:
|
361
|
+
rubygems_version: 3.5.3
|
362
|
+
signing_key:
|
361
363
|
specification_version: 4
|
362
364
|
summary: Ruby gem for the OpenTok API
|
363
365
|
test_files:
|
@@ -369,6 +371,7 @@ test_files:
|
|
369
371
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_matching_multi_archive_tag_when_multiArchiveTag_is_specified.yml
|
370
372
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_maxBitrate_set_to_specified_max_bitrate_value.yml
|
371
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
|
372
375
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_streamMode_set_to_specified_stream_mode_value.yml
|
373
376
|
- spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
|
374
377
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
@@ -442,6 +445,7 @@ test_files:
|
|
442
445
|
- spec/cassettes/OpenTok_Streams/get_specific_stream_information.yml
|
443
446
|
- spec/cassettes/OpenTok_Streams/layout_working_on_two_stream_list.yml
|
444
447
|
- spec/cassettes/OpenTok_WebSocket/receives_a_valid_response.yml
|
448
|
+
- spec/cassettes/OpenTok_WebSocket/receives_a_valid_response_with_opts.yml
|
445
449
|
- spec/matchers/token.rb
|
446
450
|
- spec/opentok/archives_spec.rb
|
447
451
|
- spec/opentok/broadcasts_spec.rb
|