@@ -75,10 +75,10 @@ OpenTok = function (apiKey, apiSecret, env) {
75
75
76
76
// validate arguments: apiKey := Number|String, apiSecret := String
77
77
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 ) ;
82
82
}
83
83
84
84
// apiKey argument can be a Number, but we will internally store it as a String
@@ -488,7 +488,7 @@ OpenTok = function (apiKey, apiSecret, env) {
488
488
) ;
489
489
} ;
490
490
491
- /**
491
+ /**
492
492
* Retrieves a List of {@link Render} objects, representing any renders in the starting,
493
493
* started, stopped or failed state, for your API key.
494
494
*
@@ -1048,7 +1048,6 @@ OpenTok = function (apiKey, apiSecret, env) {
1048
1048
) ;
1049
1049
} ;
1050
1050
1051
-
1052
1051
/**
1053
1052
* Sets (or updates) the layout of the broadcast. See
1054
1053
* <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) {
1286
1285
for ( i = 0 ; i < classListArray . length ; i += 1 ) {
1287
1286
layoutObj = classListArray [ i ] ;
1288
1287
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.' ) ) ;
1291
1290
}
1292
1291
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.' ) ) ;
1295
1294
}
1296
1295
for ( j = 0 ; j < layoutObj . layoutClassList . length ; j += 1 ) {
1297
1296
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).' ) ) ;
1300
1299
}
1301
1300
}
1302
1301
}
@@ -1853,6 +1852,15 @@ for the OpenTok session. Set to <code>"true"</code> or <code>"false"</code>.
1853
1852
* session (either automatically or not), you must set the <code>mediaMode</code> parameter to
1854
1853
* <code>"routed"</code>.
1855
1854
*
1855
+ * <li><code>archiveName</code> (String) — 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) — The resolution of archives in an auto-archived session.
1861
+ * Valid values are "480x640", "640x480", "720x1280", "1280x720", "1080x1920", and "1920x1080".
1862
+ * </li>
1863
+ *
1856
1864
* <ul>
1857
1865
* <li>The OpenTok Media Router can decrease bandwidth usage in multiparty sessions.
1858
1866
* (When the <code>mediaMode</code> parameter is set to <code>"relayed"</code>,
@@ -1922,8 +1930,8 @@ OpenTok.prototype.createSession = function (opts, callback) {
1922
1930
}
1923
1931
if ( 'location' in opts && ! net . isIPv4 ( opts . location ) ) {
1924
1932
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' ) ) ;
1927
1935
} ) ;
1928
1936
}
1929
1937
@@ -2067,24 +2075,24 @@ OpenTok.prototype.generateToken = function (sessionId, opts) {
2067
2075
throw new Error ( 'Invalid expireTime for token generation: ' + tokenData . expire_time ) ;
2068
2076
}
2069
2077
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 ) ;
2074
2082
}
2075
2083
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 ) )
2079
2087
) {
2080
2088
throw new Error ( 'Invalid data for token generation, must be a string with maximum length 1024' ) ;
2081
2089
}
2082
2090
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
2085
2093
) {
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' ) ;
2088
2096
}
2089
2097
2090
2098
return encodeToken ( tokenData , this . apiKey , this . apiSecret ) ;
0 commit comments