opentok 4.14.0 → 4.15.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 +5 -0
- data/lib/opentok/archives.rb +8 -2
- data/lib/opentok/version.rb +1 -1
- data/lib/opentok/websocket.rb +6 -0
- data/spec/cassettes/OpenTok_Archives/should_create_an_archive_with_transcription_enabled_and_transcription_settings_specified.yml +56 -0
- data/spec/cassettes/OpenTok_WebSocket/receives_a_valid_response_with_opts.yml +1 -1
- data/spec/opentok/archives_spec.rb +10 -0
- data/spec/opentok/websocket_spec.rb +10 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dba16e262ee1efcd3e87c99d60c84559a2fe31b0f0040266f292665130231dfd
|
|
4
|
+
data.tar.gz: d5ead947680c53381169f9bfc229bf761f0fe8834952cb1ccc5280023f0011dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b79caecbdafc5b0ea92fabf23e5bcff06e1ccd457e8c07cddae0989041c4844bf49599f6d9e8b7298440233d019b20e1ba82b2fae645f43b1803f4872096800d
|
|
7
|
+
data.tar.gz: 3a5f7ab3e37791c2c182a892e914f208b9fdb167e47407f2e26a238c6bddace7feb59d3bda9d71e7baa4fe0bef525879ab2731d51f813f9f36b6c32a9b9d069d
|
data/CHANGES.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# 4.15.0
|
|
2
|
+
|
|
3
|
+
* Adds support for transcription settings when starting an archive recording. See [#298](https://github.com/opentok/OpenTok-Ruby-SDK/pull/298)
|
|
4
|
+
* Ensures support for setting `audio_transport` configuration in a `WebSocket` connection. See [#297](https://github.com/opentok/OpenTok-Ruby-SDK/pull/297)
|
|
5
|
+
|
|
1
6
|
# 4.14.0
|
|
2
7
|
|
|
3
8
|
* Implements functionality to allow the use of Vonage Video endpoints and credentials.
|
data/lib/opentok/archives.rb
CHANGED
|
@@ -83,11 +83,15 @@ module OpenTok
|
|
|
83
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
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
|
-
#
|
|
87
86
|
# @option options [Integer] :quantization_parameter (Optional) The quantization parameter (QP) is an optional video encoding value allowed for composed archiving,
|
|
88
87
|
# smaller values generate higher quality and larger archives, larger values generate lower quality and smaller archives, QP uses variable bitrate (VBR). The minimum
|
|
89
88
|
# value is 15 and the maximum is 40.
|
|
90
89
|
# This parameter is mutually exclusive with the max_bitrate parameter.
|
|
90
|
+
# @option options [Boolean] :has_transcription (Optional) Whether the archive will have a transcription of the audio of the session (true) or not (false, the default).
|
|
91
|
+
# @option options [Hash] :transcription_properties (Optional) A hash of specific transcription settings.
|
|
92
|
+
# @option options[:transcription_properties] [String] 'primaryLanguageCode' (Optional) The primary language spoken in the archive to be transcribed, in BCP-47 format, e.g. en-US, es-ES or pt-BR.
|
|
93
|
+
# @see https://developer.vonage.com/en/api/video#post-v2-project-application_id-archive for a full list of supported languages.
|
|
94
|
+
# @option options[:transcription_properties] [Boolean] 'hasSummary' (Optional) Whether the transcription should include a summary of the session (true) or not (false, the default).
|
|
91
95
|
#
|
|
92
96
|
# @return [Archive] The Archive object, which includes properties defining the archive,
|
|
93
97
|
# including the archive ID.
|
|
@@ -116,7 +120,9 @@ module OpenTok
|
|
|
116
120
|
:multi_archive_tag,
|
|
117
121
|
:stream_mode,
|
|
118
122
|
:max_bitrate,
|
|
119
|
-
:quantization_parameter
|
|
123
|
+
:quantization_parameter,
|
|
124
|
+
:has_transcription,
|
|
125
|
+
:transcription_properties
|
|
120
126
|
]
|
|
121
127
|
opts = options.inject({}) do |m,(k,v)|
|
|
122
128
|
if valid_opts.include? k.to_sym
|
data/lib/opentok/version.rb
CHANGED
data/lib/opentok/websocket.rb
CHANGED
|
@@ -29,6 +29,12 @@ module OpenTok
|
|
|
29
29
|
# @option opts [Boolean] :bidirectional (optional) Whether the WebSocket connection should be bidirectional.
|
|
30
30
|
# @option opts [Integer] :audio_rate (optional) A number representing the audio sampling rate in Hz for the WebSocket stream.
|
|
31
31
|
# - Must be one of: 8000, 16000, 24000
|
|
32
|
+
# @option opts [Hash] :audio_transport (optional) A hash that configures how audio is serialized on the WebSocket wire. By default, audio is sent as raw binary PCM 16-bit frames.
|
|
33
|
+
# @option opts[:audio_transport] [String] :transport (optional) The transport type for the audio data. Must be one of: "json", "binary".
|
|
34
|
+
# @option opts[:audio_transport] [String] :encoding (optional) The encoding type for the audio data. Required when transport is "json". Must be one of: "base64".
|
|
35
|
+
# @option opts[:audio_transport] [String] :audio_field (optional) The JSON key for the outbound audio data. The default value is "audio".
|
|
36
|
+
# @option opts[:audio_transport] [String] :receive_audio_field (optional) The JSON key for inbound audio data (when bidirectional is enabled). Defaults to the same value as `audio_field`.
|
|
37
|
+
# @option opts[:audio_transport] [Hash] :static_fields (optional) An optional hash of extra key-value pairs included in every outbound JSON audio message.
|
|
32
38
|
def connect(session_id, token, websocket_uri, opts = {})
|
|
33
39
|
response = @client.connect_websocket(session_id, token, websocket_uri, opts)
|
|
34
40
|
end
|
|
@@ -0,0 +1,56 @@
|
|
|
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","hasTranscription":true,"transcriptionProperties":{"primaryLanguageCode":"en-US","hasSummary":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
|
+
Server:
|
|
26
|
+
- nginx
|
|
27
|
+
Date:
|
|
28
|
+
- Tue, 18 Aug 2026 15:46:06 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
|
+
"hasTranscription": true,
|
|
50
|
+
"transcriptionProperties": {
|
|
51
|
+
"primaryLanguageCode": "en-US",
|
|
52
|
+
"hasSummary": true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
recorded_at: Tue, 18 Aug 2026 15:46:06 GMT
|
|
56
|
+
recorded_with: VCR 6.3.1
|
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
|
5
5
|
uri: https://api.opentok.com/v2/project/123456/connect
|
|
6
6
|
body:
|
|
7
7
|
encoding: UTF-8
|
|
8
|
-
string: '{"sessionId":"SESSIONID","token":"TOKENID","websocket":{"uri":"ws://service.com/wsendpoint","streams":["123456"],"headers":{"foo":"bar"},"bidirectional":true}}'
|
|
8
|
+
string: '{"sessionId":"SESSIONID","token":"TOKENID","websocket":{"uri":"ws://service.com/wsendpoint","streams":["123456"],"headers":{"foo":"bar"},"bidirectional":true,"audioTransport":{"transport":"json","encoding":"base64","audio_field":"audio","receive_audio_field":"audio","static_fields":{"foo":"bar"}}}}'
|
|
9
9
|
headers:
|
|
10
10
|
User-Agent:
|
|
11
11
|
- OpenTok-Ruby-SDK/<%= version %>
|
|
@@ -119,6 +119,16 @@ describe OpenTok::Archives do
|
|
|
119
119
|
expect(archive.session_id).to eq session_id
|
|
120
120
|
end
|
|
121
121
|
|
|
122
|
+
it "should create an archive with transcription enabled and transcription settings specified", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
|
123
|
+
transcription_properties = {
|
|
124
|
+
'primaryLanguageCode' => 'en-US',
|
|
125
|
+
'hasSummary' => true
|
|
126
|
+
}
|
|
127
|
+
archive = archives.create session_id, :has_transcription => true, :transcription_properties => transcription_properties
|
|
128
|
+
expect(archive).to be_an_instance_of OpenTok::Archive
|
|
129
|
+
expect(archive.session_id).to eq session_id
|
|
130
|
+
end
|
|
131
|
+
|
|
122
132
|
it "should stop archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
|
|
123
133
|
archive = archives.stop_by_id started_archive_id
|
|
124
134
|
expect(archive).to be_an_instance_of OpenTok::Archive
|
|
@@ -28,7 +28,16 @@ describe OpenTok::WebSocket do
|
|
|
28
28
|
opts = {
|
|
29
29
|
"streams" => ["123456"],
|
|
30
30
|
"headers" => {"foo" => "bar"},
|
|
31
|
-
"bidirectional" => true
|
|
31
|
+
"bidirectional" => true,
|
|
32
|
+
"audio_transport" => {
|
|
33
|
+
"transport" => "json",
|
|
34
|
+
"encoding" => "base64",
|
|
35
|
+
"audio_field" => "audio",
|
|
36
|
+
"receive_audio_field" => "audio",
|
|
37
|
+
"static_fields" => {
|
|
38
|
+
"foo" => "bar"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
response = websocket.connect(session_id, expiring_token, websocket_uri, opts)
|
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.15.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stijn Mathysen
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
- Ankur Oberoi
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2026-
|
|
14
|
+
date: 2026-09-16 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|
|
@@ -250,6 +250,7 @@ files:
|
|
|
250
250
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml
|
|
251
251
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_quantizationParameter_set_to_specified_value.yml
|
|
252
252
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_streamMode_set_to_specified_stream_mode_value.yml
|
|
253
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_transcription_enabled_and_transcription_settings_specified.yml
|
|
253
254
|
- spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
|
|
254
255
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
|
255
256
|
- spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml
|
|
@@ -376,6 +377,7 @@ test_files:
|
|
|
376
377
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_multi_archive_tag_value_of_nil_when_multiArchiveTag_not_specified.yml
|
|
377
378
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_quantizationParameter_set_to_specified_value.yml
|
|
378
379
|
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_streamMode_set_to_specified_stream_mode_value.yml
|
|
380
|
+
- spec/cassettes/OpenTok_Archives/should_create_an_archive_with_transcription_enabled_and_transcription_settings_specified.yml
|
|
379
381
|
- spec/cassettes/OpenTok_Archives/should_create_an_archives_with_a_specified_multiArchiveTag.yml
|
|
380
382
|
- spec/cassettes/OpenTok_Archives/should_create_archives.yml
|
|
381
383
|
- spec/cassettes/OpenTok_Archives/should_create_audio_only_archives.yml
|