Skip to content

Commit

Permalink
Release 4.8.1 (#270)
Browse files Browse the repository at this point in the history
* Fixes a bug with Archive#create
  • Loading branch information
superchilled authored Jan 3, 2024
1 parent c5e3588 commit 6632bb6
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 4.8.1

* Fixes a bug with the `Archives#create` method. See [#269](https://github.com/opentok/OpenTok-Ruby-SDK/pull/269) and [#270](https://github.com/opentok/OpenTok-Ruby-SDK/pull/270)

# 4.8.0

* Add support for Captions API [#267](https://github.com/opentok/OpenTok-Ruby-SDK/pull/267)
Expand Down
3 changes: 2 additions & 1 deletion lib/opentok/archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ module OpenTok
# set to null. The download URL is obfuscated, and the file is only available from the URL for
# 10 minutes. To generate a new URL, call the Archive.listArchives() or OpenTok.getArchive() method.
class Archive
attr_reader :multi_archive_tag
attr_reader :multi_archive_tag, :stream_mode
# @private
def initialize(interface, json)
@interface = interface
# TODO: validate json fits schema
@json = json
@multi_archive_tag = @json['multiArchiveTag']
@stream_mode = @json['streamMode']
end

# A JSON-encoded string representation of the archive.
Expand Down
10 changes: 5 additions & 5 deletions lib/opentok/archives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def initialize(client)
# (a video track is included). If you set both <code>has_audio</code> and
# <code>has_video</code> to <code>false</code>, the call to the <code>create()</code>
# method results in an error.
# @option options [String] :multiArchiveTag (Optional) Set this to support recording multiple archives for the same session simultaneously.
# @option options [String] :multi_archive_tag (Optional) Set this to support recording multiple archives for the same session simultaneously.
# Set this to a unique string for each simultaneous archive of an ongoing session. You must also set this option when manually starting an archive
# that is {https://tokbox.com/developer/guides/archiving/#automatic automatically archived}. Note that the `multiArchiveTag` value is not included
# in the response for the methods to {https://tokbox.com/developer/rest/#listing_archives list archives} and
# {https://tokbox.com/developer/rest/#retrieve_archive_info retrieve archive information}. If you do not specify a unique `multiArchiveTag`,
# {https://tokbox.com/developer/rest/#retrieve_archive_info retrieve archive information}. If you do not specify a unique `multi_archive_tag`,
# you can only record one archive at a time for a given session.
# {https://tokbox.com/developer/guides/archiving/#simultaneous-archives See Simultaneous archives}.
# @option options [String] :output_mode Whether all streams in the archive are recorded
Expand All @@ -56,7 +56,7 @@ def initialize(client)
# (HD portrait), or "1080x1920" (FHD portrait). This property only applies to composed archives. If you set
# this property and set the outputMode property to "individual", a call to the method
# results in an error.
# @option options [String] :streamMode (Optional) Whether streams included in the archive are selected
# @option options [String] :stream_mode (Optional) Whether streams included in the archive are selected
# automatically ("auto", the default) or manually ("manual"). When streams are selected automatically ("auto"),
# all streams in the session can be included in the archive. When streams are selected manually ("manual"),
# you specify streams to be included based on calls to the {Archives#add_stream} method. You can specify whether a
Expand Down Expand Up @@ -104,8 +104,8 @@ def create(session_id, options = {})
:output_mode,
:resolution,
:layout,
:multiArchiveTag,
:streamMode
:multi_archive_tag,
:stream_mode
]
opts = options.inject({}) do |m,(k,v)|
if valid_opts.include? k.to_sym
Expand Down
2 changes: 1 addition & 1 deletion lib/opentok/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module OpenTok
# @private
VERSION = '4.8.0'
VERSION = '4.8.1'
end

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

11 changes: 9 additions & 2 deletions spec/opentok/archives_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@

it "should create an archives with a specified multiArchiveTag", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive_tag = 'archive-1'
archive = archives.create session_id, :multiArchiveTag => archive_tag
archive = archives.create session_id, :multi_archive_tag => archive_tag
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.session_id).to eq session_id
expect(archive.multiArchiveTag).to eq archive_tag
end

it "should create an archive with matching multi_archive_tag when multiArchiveTag is specified", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive_tag = 'archive-1'
archive = archives.create session_id, :multiArchiveTag => archive_tag
archive = archives.create session_id, :multi_archive_tag => archive_tag
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.multi_archive_tag).to eq archive_tag
end
Expand All @@ -63,6 +63,13 @@
expect(archive.multi_archive_tag).to be_nil
end

it "should create an archive with streamMode set to specified stream_mode value", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
stream_mode = 'manual'
archive = archives.create session_id, :stream_mode => stream_mode
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.stream_mode).to eq stream_mode
end

it "should create audio only archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
archive = archives.create session_id, :has_video => false
expect(archive).to be_an_instance_of OpenTok::Archive
Expand Down

0 comments on commit 6632bb6

Please sign in to comment.