From 76cda73afb3330a87150f284f72487fea9e15a07 Mon Sep 17 00:00:00 2001 From: superchilled Date: Fri, 3 Oct 2025 11:54:12 +0100 Subject: [PATCH 1/2] Adding support for quantization_parameter in video archives --- lib/vonage/keys.rb | 3 ++- lib/vonage/video/archives.rb | 4 +++- test/vonage/video/archives_test.rb | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/vonage/keys.rb b/lib/vonage/keys.rb index 94722cbb..2bfd1272 100644 --- a/lib/vonage/keys.rb +++ b/lib/vonage/keys.rb @@ -40,7 +40,8 @@ def camelcase(hash) 'phone_number', 'hashed_phone_number', 'max_age', - 'max_bitrate' + 'max_bitrate', + 'quantization_parameter' ] hash.transform_keys do |k| if exceptions.include?(k.to_s) diff --git a/lib/vonage/video/archives.rb b/lib/vonage/video/archives.rb index 27717551..c4b1ec16 100644 --- a/lib/vonage/video/archives.rb +++ b/lib/vonage/video/archives.rb @@ -59,7 +59,9 @@ def info(archive_id:) # # @param [optional, String] :multi_archive_tag # - # @param [optional, String] :max_bitrate + # @param [optional, Number] :max_bitrate + # + # @param [optional, Number] :quantization_parameter # # @param [optional, Hash] :layout # diff --git a/test/vonage/video/archives_test.rb b/test/vonage/video/archives_test.rb index 879b7629..d6e7a930 100644 --- a/test/vonage/video/archives_test.rb +++ b/test/vonage/video/archives_test.rb @@ -44,7 +44,8 @@ def test_start_method_with_optional_params sessionId: video_session_id, resolution: '640x480', streamMode: 'auto', - maxBitrate: 200000 + maxBitrate: 200000, + quantizationParameter: 40 } stub_request(:post, uri).with(body: request_params).to_return(response) @@ -53,7 +54,8 @@ def test_start_method_with_optional_params session_id: video_session_id, resolution: '640x480', stream_mode: 'auto', - max_bitrate: 200000 + max_bitrate: 200000, + quantization_parameter: 40 ) end From ae7502eecd633221a696af3710c51d38d943dfda Mon Sep 17 00:00:00 2001 From: superchilled Date: Fri, 3 Oct 2025 19:34:29 +0100 Subject: [PATCH 2/2] Adding support for bidirectional flag in VIdeo websocket implementation --- lib/vonage/video/web_socket.rb | 1 + test/vonage/video/web_socket_test.rb | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/vonage/video/web_socket.rb b/lib/vonage/video/web_socket.rb index 6d2fb07e..e781c9b9 100644 --- a/lib/vonage/video/web_socket.rb +++ b/lib/vonage/video/web_socket.rb @@ -38,6 +38,7 @@ class Video::WebSocket < Namespace # @option websocket [optional, Hash] :headers An object of key-value pairs of headers to be sent to your WebSocket server with each message, with a maximum length of 512 bytes. # @option websocket [optional, Integer] :audio_rate A number representing the audio sampling rate in Hz # - Must be one of: 8000, 16000 + # @option websocket [optional, Boolean] :bidirectional Whether to send audio data from the WebSocket connection to a stream published in the session. # # @return [Response] # diff --git a/test/vonage/video/web_socket_test.rb b/test/vonage/video/web_socket_test.rb index 244de28d..b3b8caba 100644 --- a/test/vonage/video/web_socket_test.rb +++ b/test/vonage/video/web_socket_test.rb @@ -40,7 +40,8 @@ def test_connect_method_with_optional_params uri: 'wss://example.com/ws-endpoint', streams: ['stream1', 'stream2'], headers: { property1: 'foo', property2: 'bar' }, - audioRate: 16000 + audioRate: 16000, + bidirectional: true } } @@ -53,7 +54,8 @@ def test_connect_method_with_optional_params uri: 'wss://example.com/ws-endpoint', streams: ['stream1', 'stream2'], headers: { property1: 'foo', property2: 'bar' }, - audio_rate: 16000 + audio_rate: 16000, + bidirectional: true } )