Check Safari before listening for ondevicechange

This commit is contained in:
Pedro Beschorner Marin 2019-12-20 17:02:34 -03:00
parent 78b0d0276a
commit 9b450ae1d9

View File

@ -41,7 +41,10 @@ class VideoService {
this.numberOfDevices = 0;
this.updateNumberOfDevices = this.updateNumberOfDevices.bind(this);
navigator.mediaDevices.ondevicechange = (event) => this.updateNumberOfDevices();
// Safari doesn't support ondevicechange
if (!this.isSafari) {
navigator.mediaDevices.ondevicechange = (event) => this.updateNumberOfDevices();
}
this.updateNumberOfDevices();
}