fix(StreamDispatcher): only update speaking for non broadcasts (#2437)

If the player is a BroadcastAudioPlayer it has no VoiceConnection directly associated with it.
This commit is contained in:
Jérémie N'gadi
2018-04-09 21:17:16 +02:00
committed by SpaceEEC
parent 952a7123f3
commit e845758037

View File

@@ -253,7 +253,9 @@ class StreamDispatcher extends Writable {
}
_setSpeaking(value) {
this.player.voiceConnection.setSpeaking(value);
if (typeof this.player.voiceConnection !== 'undefined') {
this.player.voiceConnection.setSpeaking(value);
}
/**
* Emitted when the dispatcher starts/stops speaking.
* @event StreamDispatcher#speaking