Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/opentok/archives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,15 @@ def initialize(client)
# value is 100,000 and the maximum is 6,000,000. This option is only valid for composed archives. Set the maximum video bitrate
# to control the size of the composed archive. This maximum bitrate applies to the video bitrate only. If the output archive has
# audio, those bits will be excluded from the limit.
#
# @option options [Integer] :quantization_parameter (Optional) The quantization parameter (QP) is an optional video encoding value allowed for composed archiving,
# smaller values generate higher quality and larger archives, larger values generate lower quality and smaller archives, QP uses variable bitrate (VBR). The minimum
# value is 15 and the maximum is 40.
# This parameter is mutually exclusive with the max_bitrate parameter.
# @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).
# @option options [Hash] :transcription_properties (Optional) A hash of specific transcription settings.
# @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.
# @see https://developer.vonage.com/en/api/video#post-v2-project-application_id-archive for a full list of supported languages.
# @option options[:transcription_properties] [Boolean] 'hasSummary' (Optional) Whether the transcription should include a summary of the session (true) or not (false, the default).
Comment thread
superchilled marked this conversation as resolved.
#
# @return [Archive] The Archive object, which includes properties defining the archive,
# including the archive ID.
Expand Down Expand Up @@ -116,7 +120,9 @@ def create(session_id, options = {})
:multi_archive_tag,
:stream_mode,
:max_bitrate,
:quantization_parameter
:quantization_parameter,
:has_transcription,
:transcription_properties
]
opts = options.inject({}) do |m,(k,v)|
if valid_opts.include? k.to_sym
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions spec/opentok/archives_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@
expect(archive.session_id).to eq session_id
end

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
transcription_properties = {
'primaryLanguageCode' => 'en-US',
'hasSummary' => true
}
archive = archives.create session_id, :has_transcription => true, :transcription_properties => transcription_properties
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.session_id).to eq session_id
Comment thread
superchilled marked this conversation as resolved.
end

it "should stop archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
archive = archives.stop_by_id started_archive_id
expect(archive).to be_an_instance_of OpenTok::Archive
Expand Down
Loading