Skip to content

Commit e51c6ec

Browse files
committed
fix: play interval without audioStream
This commit fixes the issue that the "playInterval" interval would be executed even though there's no "audioStream".
1 parent e19a10b commit e51c6ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,10 @@ class Connection extends EventEmitter {
294294

295295
this.emit('reconnecting', reason)
296296

297-
this.pause()
298-
this.connect(() => this.unpause('reconnected'), true)
297+
if (this.audioStream) {
298+
this.pause()
299+
this.connect(() => this.unpause('reconnected'), true)
300+
}
299301
} else {
300302
this._destroy({ status: 'disconnected', reason: 'websocketClose', code })
301303

0 commit comments

Comments
 (0)