From 49e40a4e07697813a054e3acd9f9444887e538e4 Mon Sep 17 00:00:00 2001 From: Hanna Asetskaya Date: Wed, 8 Sep 2021 19:17:49 +0300 Subject: [PATCH] Set new audioSource on props update --- src/OTPublisher.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/OTPublisher.js b/src/OTPublisher.js index 4ce8464c..a3daef76 100644 --- a/src/OTPublisher.js +++ b/src/OTPublisher.js @@ -35,6 +35,12 @@ export default class OTPublisher extends Component { } }; + if (shouldUpdate('audioSource', undefined)) { + this.state.publisher + .setAudioSource(this.props.properties.audioSource) + .catch(error => this.errorHandler(error)); + } + if (shouldUpdate('videoSource', undefined)) { this.destroyPublisher(); this.createPublisher();