Skip to content

Commit baa3f38

Browse files
manchuckjeffswartz
andauthored
docs: adding auto archive documentation (#305)
* docs: adding auto archive documentation * Docs edits --------- Co-authored-by: Jeff Swartz <jeff.swartz@vonage.com>
1 parent b3bf0be commit baa3f38

File tree

1 file changed

+33
-25
lines changed

1 file changed

+33
-25
lines changed

lib/opentok.js

+33-25
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ OpenTok = function (apiKey, apiSecret, env) {
7575

7676
// validate arguments: apiKey := Number|String, apiSecret := String
7777
if (!(_.isNumber(apiKey) || _.isString(apiKey)) || !_.isString(apiSecret)) {
78-
throw new Error('Invalid arguments when initializing OpenTok: apiKey=' +
79-
apiKey +
80-
', apiSecret=' +
81-
apiSecret);
78+
throw new Error('Invalid arguments when initializing OpenTok: apiKey='
79+
+ apiKey
80+
+ ', apiSecret='
81+
+ apiSecret);
8282
}
8383

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

491-
/**
491+
/**
492492
* Retrieves a List of {@link Render} objects, representing any renders in the starting,
493493
* started, stopped or failed state, for your API key.
494494
*
@@ -1048,7 +1048,6 @@ OpenTok = function (apiKey, apiSecret, env) {
10481048
);
10491049
};
10501050

1051-
10521051
/**
10531052
* Sets (or updates) the layout of the broadcast. See
10541053
* <a href="https://tokbox.com/developer/guides/broadcast/live-streaming/#configuring-video-layout-for-opentok-live-streaming-broadcasts">
@@ -1286,17 +1285,17 @@ OpenTok = function (apiKey, apiSecret, env) {
12861285
for (i = 0; i < classListArray.length; i += 1) {
12871286
layoutObj = classListArray[i];
12881287
if (typeof layoutObj.id !== 'string') {
1289-
return callback(new Error('Invalid arguments -- each element in the streamClassArray ' +
1290-
'must have an id string.'));
1288+
return callback(new Error('Invalid arguments -- each element in the streamClassArray '
1289+
+ 'must have an id string.'));
12911290
}
12921291
if (!Array.isArray(layoutObj.layoutClassList)) {
1293-
return callback(new Error('Invalid arguments -- each element in the streamClassArray ' +
1294-
'must have a layoutClassList array.'));
1292+
return callback(new Error('Invalid arguments -- each element in the streamClassArray '
1293+
+ 'must have a layoutClassList array.'));
12951294
}
12961295
for (j = 0; j < layoutObj.layoutClassList.length; j += 1) {
12971296
if (typeof layoutObj.layoutClassList[j] !== 'string') {
1298-
return callback(new Error('Invalid arguments -- each element in the layoutClassList ' +
1299-
'array must be a string (defining class names).'));
1297+
return callback(new Error('Invalid arguments -- each element in the layoutClassList '
1298+
+ 'array must be a string (defining class names).'));
13001299
}
13011300
}
13021301
}
@@ -1853,6 +1852,15 @@ for the OpenTok session. Set to <code>"true"</code> or <code>"false"</code>.
18531852
* session (either automatically or not), you must set the <code>mediaMode</code> parameter to
18541853
* <code>"routed"</code>.
18551854
*
1855+
* <li><code>archiveName</code> (String) &mdash; The name of the archives to be used in
1856+
* auto-archived sessions. The length of the archive name can be up to 80 chars.
1857+
* Due to encoding limitations the following special characters are translated to
1858+
* a colon (:) character: ~, -, _.</li>
1859+
*
1860+
* <li><code>archiveResolution</code> (Enum) &mdash; The resolution of archives in an auto-archived session.
1861+
* Valid values are "480x640", "640x480", "720x1280", "1280x720", "1080x1920", and "1920x1080".
1862+
* </li>
1863+
*
18561864
* <ul>
18571865
* <li>The OpenTok Media Router can decrease bandwidth usage in multiparty sessions.
18581866
* (When the <code>mediaMode</code> parameter is set to <code>"relayed"</code>,
@@ -1922,8 +1930,8 @@ OpenTok.prototype.createSession = function (opts, callback) {
19221930
}
19231931
if ('location' in opts && !net.isIPv4(opts.location)) {
19241932
return process.nextTick(function () {
1925-
callback(new Error('Invalid arguments when calling createSession, location must be an ' +
1926-
'IPv4 address'));
1933+
callback(new Error('Invalid arguments when calling createSession, location must be an '
1934+
+ 'IPv4 address'));
19271935
});
19281936
}
19291937

@@ -2067,24 +2075,24 @@ OpenTok.prototype.generateToken = function (sessionId, opts) {
20672075
throw new Error('Invalid expireTime for token generation: ' + tokenData.expire_time);
20682076
}
20692077
if (tokenData.expire_time < now) {
2070-
throw new Error('Invalid expireTime for token generation, time cannot be in the past: ' +
2071-
tokenData.expire_time +
2072-
' < ' +
2073-
now);
2078+
throw new Error('Invalid expireTime for token generation, time cannot be in the past: '
2079+
+ tokenData.expire_time
2080+
+ ' < '
2081+
+ now);
20742082
}
20752083
if (
2076-
tokenData.connection_data &&
2077-
(tokenData.connection_data.length > 1024 ||
2078-
!_.isString(tokenData.connection_data))
2084+
tokenData.connection_data
2085+
&& (tokenData.connection_data.length > 1024
2086+
|| !_.isString(tokenData.connection_data))
20792087
) {
20802088
throw new Error('Invalid data for token generation, must be a string with maximum length 1024');
20812089
}
20822090
if (
2083-
tokenData.initial_layout_class_list &&
2084-
tokenData.initial_layout_class_list.length > 1024
2091+
tokenData.initial_layout_class_list
2092+
&& tokenData.initial_layout_class_list.length > 1024
20852093
) {
2086-
throw new Error('Invalid initial layout class list for token generation, must have ' +
2087-
'concatenated length of less than 1024');
2094+
throw new Error('Invalid initial layout class list for token generation, must have '
2095+
+ 'concatenated length of less than 1024');
20882096
}
20892097

20902098
return encodeToken(tokenData, this.apiKey, this.apiSecret);

0 commit comments

Comments
 (0)