tiktok-live-connector
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -38,5 +38,6 @@ /** | ||
* Connects to the current live stream room | ||
* @param {string} [roomId] If you want to connect to a specific roomId. Otherwise the current roomId will be retrieved. | ||
* @returns {Promise} Promise that will be resolved when the connection is established. | ||
*/ | ||
connect(): Promise<any>; | ||
connect(roomId?: string): Promise<any>; | ||
/** | ||
@@ -43,0 +44,0 @@ * Disconnects the connection to the live stream |
@@ -244,5 +244,6 @@ "use strict"; | ||
* Connects to the current live stream room | ||
* @param {string} [roomId] If you want to connect to a specific roomId. Otherwise the current roomId will be retrieved. | ||
* @returns {Promise} Promise that will be resolved when the connection is established. | ||
*/ | ||
async connect() { | ||
async connect(roomId = null) { | ||
if (_classPrivateFieldGet(this, _isConnecting)) { | ||
@@ -259,4 +260,12 @@ throw new Error('Already connecting!'); | ||
try { | ||
await _classPrivateMethodGet(this, _retrieveRoomId, _retrieveRoomId2).call(this); // Fetch room info if option enabled | ||
// roomId already specified? | ||
if (roomId) { | ||
_classPrivateFieldSet(this, _roomId, roomId); | ||
_classPrivateFieldGet(this, _clientParams).room_id = roomId; | ||
} else { | ||
await _classPrivateMethodGet(this, _retrieveRoomId, _retrieveRoomId2).call(this); | ||
} // Fetch room info if option enabled | ||
if (_classPrivateFieldGet(this, _options).fetchRoomInfoOnConnect) { | ||
@@ -263,0 +272,0 @@ await _classPrivateMethodGet(this, _fetchRoomInfo, _fetchRoomInfo2).call(this); // Prevent connections to finished rooms |
{ | ||
"name": "tiktok-live-connector", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Node.js module to receive live stream chat events like comments and gifts from TikTok LIVE", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131638
1417