Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: adding auto archive documentation #305

Merged
merged 3 commits into from
Jul 21, 2023
Merged
Changes from 1 commit
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
55 changes: 30 additions & 25 deletions lib/opentok.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ OpenTok = function (apiKey, apiSecret, env) {

// validate arguments: apiKey := Number|String, apiSecret := String
if (!(_.isNumber(apiKey) || _.isString(apiKey)) || !_.isString(apiSecret)) {
throw new Error('Invalid arguments when initializing OpenTok: apiKey=' +
apiKey +
', apiSecret=' +
apiSecret);
throw new Error('Invalid arguments when initializing OpenTok: apiKey='
+ apiKey
+ ', apiSecret='
+ apiSecret);
}

// apiKey argument can be a Number, but we will internally store it as a String
Expand Down Expand Up @@ -488,7 +488,7 @@ OpenTok = function (apiKey, apiSecret, env) {
);
};

/**
/**
* Retrieves a List of {@link Render} objects, representing any renders in the starting,
* started, stopped or failed state, for your API key.
*
Expand Down Expand Up @@ -1047,7 +1047,6 @@ OpenTok = function (apiKey, apiSecret, env) {
);
};


/**
* Sets (or updates) the layout of the broadcast. See
* <a href="https://tokbox.com/developer/guides/broadcast/live-streaming/#configuring-video-layout-for-opentok-live-streaming-broadcasts">
Expand Down Expand Up @@ -1280,17 +1279,17 @@ OpenTok = function (apiKey, apiSecret, env) {
for (i = 0; i < classListArray.length; i += 1) {
layoutObj = classListArray[i];
if (typeof layoutObj.id !== 'string') {
return callback(new Error('Invalid arguments -- each element in the streamClassArray ' +
'must have an id string.'));
return callback(new Error('Invalid arguments -- each element in the streamClassArray '
+ 'must have an id string.'));
}
if (!Array.isArray(layoutObj.layoutClassList)) {
return callback(new Error('Invalid arguments -- each element in the streamClassArray ' +
'must have a layoutClassList array.'));
return callback(new Error('Invalid arguments -- each element in the streamClassArray '
+ 'must have a layoutClassList array.'));
}
for (j = 0; j < layoutObj.layoutClassList.length; j += 1) {
if (typeof layoutObj.layoutClassList[j] !== 'string') {
return callback(new Error('Invalid arguments -- each element in the layoutClassList ' +
'array must be a string (defining class names).'));
return callback(new Error('Invalid arguments -- each element in the layoutClassList '
+ 'array must be a string (defining class names).'));
}
}
}
Expand Down Expand Up @@ -1842,6 +1841,12 @@ OpenTok.prototype.dial = function (sessionId, token, sipUri, options, callback)
* session (either automatically or not), you must set the <code>mediaMode</code> parameter to
* <code>"routed"</code>.
*
* <li><code>archiveName</code> (String) &mdash; Name of the archives in auto archived sessions</li>
*
* <li><code>archiveResolution</code> (Enum) &mdash; Resolution of the archives in
* auto archived sessions. Can be one of "480x640", "640x480", "720x1280", "1280x720", "1080x1920", "1920x1080">
* </li>
Copy link
Collaborator

@jeffswartz jeffswartz Jul 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* <li><code>archiveName</code> (String) &mdash; Name of the archives in auto archived sessions</li>
*
* <li><code>archiveResolution</code> (Enum) &mdash; Resolution of the archives in
* auto archived sessions. Can be one of "480x640", "640x480", "720x1280", "1280x720", "1080x1920", "1920x1080">
* </li>
* <li><code>archiveName</code> (String) &mdash; The name of the archives to be used in
* auto-archived sessions</li>
*
* <li><code>archiveResolution</code> (Enum) &mdash; The resolution of archives in an auto-archived session.
* Valid values are "480x640", "640x480", "720x1280", "1280x720", "1080x1920", and "1920x1080".
* </li>

*
* <ul>
* <li>The OpenTok Media Router can decrease bandwidth usage in multiparty sessions.
* (When the <code>mediaMode</code> parameter is set to <code>"relayed"</code>,
Expand Down Expand Up @@ -1909,8 +1914,8 @@ OpenTok.prototype.createSession = function (opts, callback) {
}
if ('location' in opts && !net.isIPv4(opts.location)) {
return process.nextTick(function () {
callback(new Error('Invalid arguments when calling createSession, location must be an ' +
'IPv4 address'));
callback(new Error('Invalid arguments when calling createSession, location must be an '
+ 'IPv4 address'));
});
}

Expand Down Expand Up @@ -2054,24 +2059,24 @@ OpenTok.prototype.generateToken = function (sessionId, opts) {
throw new Error('Invalid expireTime for token generation: ' + tokenData.expire_time);
}
if (tokenData.expire_time < now) {
throw new Error('Invalid expireTime for token generation, time cannot be in the past: ' +
tokenData.expire_time +
' < ' +
now);
throw new Error('Invalid expireTime for token generation, time cannot be in the past: '
+ tokenData.expire_time
+ ' < '
+ now);
}
if (
tokenData.connection_data &&
(tokenData.connection_data.length > 1024 ||
!_.isString(tokenData.connection_data))
tokenData.connection_data
&& (tokenData.connection_data.length > 1024
|| !_.isString(tokenData.connection_data))
) {
throw new Error('Invalid data for token generation, must be a string with maximum length 1024');
}
if (
tokenData.initial_layout_class_list &&
tokenData.initial_layout_class_list.length > 1024
tokenData.initial_layout_class_list
&& tokenData.initial_layout_class_list.length > 1024
) {
throw new Error('Invalid initial layout class list for token generation, must have ' +
'concatenated length of less than 1024');
throw new Error('Invalid initial layout class list for token generation, must have '
+ 'concatenated length of less than 1024');
}

return encodeToken(tokenData, this.apiKey, this.apiSecret);
Expand Down