Skip to content

Commit 6632bb6

Browse files
authored
Release 4.8.1 (#270)
* Fixes a bug with Archive#create
1 parent c5e3588 commit 6632bb6

6 files changed

+73
-9
lines changed

CHANGES.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 4.8.1
2+
3+
* 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+
15
# 4.8.0
26

37
* Add support for Captions API [#267](https://github.com/opentok/OpenTok-Ruby-SDK/pull/267)

lib/opentok/archive.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,14 @@ module OpenTok
7272
# set to null. The download URL is obfuscated, and the file is only available from the URL for
7373
# 10 minutes. To generate a new URL, call the Archive.listArchives() or OpenTok.getArchive() method.
7474
class Archive
75-
attr_reader :multi_archive_tag
75+
attr_reader :multi_archive_tag, :stream_mode
7676
# @private
7777
def initialize(interface, json)
7878
@interface = interface
7979
# TODO: validate json fits schema
8080
@json = json
8181
@multi_archive_tag = @json['multiArchiveTag']
82+
@stream_mode = @json['streamMode']
8283
end
8384

8485
# A JSON-encoded string representation of the archive.

lib/opentok/archives.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def initialize(client)
3939
# (a video track is included). If you set both <code>has_audio</code> and
4040
# <code>has_video</code> to <code>false</code>, the call to the <code>create()</code>
4141
# method results in an error.
42-
# @option options [String] :multiArchiveTag (Optional) Set this to support recording multiple archives for the same session simultaneously.
42+
# @option options [String] :multi_archive_tag (Optional) Set this to support recording multiple archives for the same session simultaneously.
4343
# 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
4444
# that is {https://tokbox.com/developer/guides/archiving/#automatic automatically archived}. Note that the `multiArchiveTag` value is not included
4545
# in the response for the methods to {https://tokbox.com/developer/rest/#listing_archives list archives} and
46-
# {https://tokbox.com/developer/rest/#retrieve_archive_info retrieve archive information}. If you do not specify a unique `multiArchiveTag`,
46+
# {https://tokbox.com/developer/rest/#retrieve_archive_info retrieve archive information}. If you do not specify a unique `multi_archive_tag`,
4747
# you can only record one archive at a time for a given session.
4848
# {https://tokbox.com/developer/guides/archiving/#simultaneous-archives See Simultaneous archives}.
4949
# @option options [String] :output_mode Whether all streams in the archive are recorded
@@ -56,7 +56,7 @@ def initialize(client)
5656
# (HD portrait), or "1080x1920" (FHD portrait). This property only applies to composed archives. If you set
5757
# this property and set the outputMode property to "individual", a call to the method
5858
# results in an error.
59-
# @option options [String] :streamMode (Optional) Whether streams included in the archive are selected
59+
# @option options [String] :stream_mode (Optional) Whether streams included in the archive are selected
6060
# automatically ("auto", the default) or manually ("manual"). When streams are selected automatically ("auto"),
6161
# all streams in the session can be included in the archive. When streams are selected manually ("manual"),
6262
# you specify streams to be included based on calls to the {Archives#add_stream} method. You can specify whether a
@@ -104,8 +104,8 @@ def create(session_id, options = {})
104104
:output_mode,
105105
:resolution,
106106
:layout,
107-
:multiArchiveTag,
108-
:streamMode
107+
:multi_archive_tag,
108+
:stream_mode
109109
]
110110
opts = options.inject({}) do |m,(k,v)|
111111
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.8.0'
3+
VERSION = '4.8.1'
44
end

spec/cassettes/OpenTok_Archives/should_create_an_archive_with_streamMode_set_to_specified_stream_mode_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

+9-2
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@
4444

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

5353
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
5454
archive_tag = 'archive-1'
55-
archive = archives.create session_id, :multiArchiveTag => archive_tag
55+
archive = archives.create session_id, :multi_archive_tag => archive_tag
5656
expect(archive).to be_an_instance_of OpenTok::Archive
5757
expect(archive.multi_archive_tag).to eq archive_tag
5858
end
@@ -63,6 +63,13 @@
6363
expect(archive.multi_archive_tag).to be_nil
6464
end
6565

66+
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
67+
stream_mode = 'manual'
68+
archive = archives.create session_id, :stream_mode => stream_mode
69+
expect(archive).to be_an_instance_of OpenTok::Archive
70+
expect(archive.stream_mode).to eq stream_mode
71+
end
72+
6673
it "should create audio only archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
6774
archive = archives.create session_id, :has_video => false
6875
expect(archive).to be_an_instance_of OpenTok::Archive

0 commit comments

Comments
 (0)