lib/opentok/session.rb in opentok-4.6.0 vs lib/opentok/session.rb in opentok-4.7.0
- old
+ new
@@ -18,10 +18,14 @@
# method.
#
# @attr_reader [String] archive_mode Whether the session will be archived automatically
# (<code>:always</code>) or not (<code>:manual</code>).
#
+ # @attr_reader [String] archive_name The name to use for archives in auto-archived sessions.
+ #
+ # @attr_reader [String] :archive_resolution The resolution of archives in an auto-archived session.
+ #
# @!method generate_token(options)
# Generates a token.
#
# @param [Hash] options
# @option options [Symbol] :role The role for the token. Set this to one of the following
@@ -55,11 +59,11 @@
:api_key => ->(instance) { instance.api_key },
:api_secret => ->(instance) { instance.api_secret },
:session_id => ->(instance) { instance.session_id }
})
- attr_reader :session_id, :media_mode, :location, :archive_mode, :api_key, :api_secret
+ attr_reader :session_id, :media_mode, :location, :archive_mode, :archive_name, :archive_resolution, :e2ee, :api_key, :api_secret
# @private
# this implementation doesn't completely understand the format of a Session ID
# that is intentional, that is too much responsibility.
def self.belongs_to_api_key?(session_id, api_key)
@@ -71,10 +75,15 @@
end
# @private
def initialize(api_key, api_secret, session_id, opts={})
@api_key, @api_secret, @session_id = api_key, api_secret, session_id
- @media_mode, @location, @archive_mode = opts.fetch(:media_mode, :relayed), opts[:location], opts.fetch(:archive_mode, :manual)
+ @media_mode = opts.fetch(:media_mode, :relayed)
+ @location = opts[:location]
+ @archive_mode = opts.fetch(:archive_mode, :manual)
+ @archive_name = opts.fetch(:archive_name, '') if archive_mode == :always
+ @archive_resolution = opts.fetch(:archive_resolution, "640x480") if archive_mode == :always
+ @e2ee = opts.fetch(:e2ee, :false)
end
# @private
def to_s
@session_id