Skip to content

Commit 6e6478c

Browse files
authored
DEVX-9004: Implementing max bitrate for archives (#288)
* Implementing max bitrate for archives
1 parent b6d4bc6 commit 6e6478c

File tree

5 files changed

+70
-2
lines changed

5 files changed

+70
-2
lines changed

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 4.12.0
2+
3+
* Updating the `Archives#create` method to allow `max_bitrate` as an option. See [#288](https://github.com/opentok/OpenTok-Ruby-SDK/pull/288)
4+
15
# 4.11.0
26

37
* Updating client token creation to use JWTs by default. See [#287](https://github.com/opentok/OpenTok-Ruby-SDK/pull/274)

lib/opentok/archives.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ def initialize(client)
7979
# layout type. For more information, see
8080
# {https://tokbox.com/developer/guides/archiving/layout-control.html Customizing
8181
# 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.
8286
#
8387
# @return [Archive] The Archive object, which includes properties defining the archive,
8488
# including the archive ID.
@@ -105,7 +109,8 @@ def create(session_id, options = {})
105109
:resolution,
106110
:layout,
107111
:multi_archive_tag,
108-
:stream_mode
112+
:stream_mode,
113+
:max_bitrate
109114
]
110115
opts = options.inject({}) do |m,(k,v)|
111116
if valid_opts.include? k.to_sym

lib/opentok/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module OpenTok
22
# @private
3-
VERSION = '4.11.0'
3+
VERSION = '4.12.0'
44
end

spec/cassettes/OpenTok_Archives/should_create_an_archive_with_maxBitrate_set_to_specified_max_bitrate_value.yml

+52
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/opentok/archives_spec.rb

+7
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@
7070
expect(archive.stream_mode).to eq stream_mode
7171
end
7272

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+
7380
it "should create audio only archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
7481
archive = archives.create session_id, :has_video => false
7582
expect(archive).to be_an_instance_of OpenTok::Archive

0 commit comments

Comments
 (0)