Detects suspended event, stops local video and shows overlay.

Also removes device change listener, cause when PC wakeups devices will be reconnected and we can try open the local video again.
pull/1131/head
damencho 8 years ago
parent 96b280668d
commit 82926ef8c6
  1. 31
      conference.js

@ -1283,6 +1283,30 @@ export default {
// FIXME close
});
room.on(ConferenceEvents.SUSPEND_DETECTED, () => {
// After wake up, we will be in a state where conference is left
// there will be dialog shown to user.
// We do not want video/audio as we show an overlay and after it
// user need to rejoin or close, while waking up we can detect
// camera wakeup as a problem with device.
// We also do not care about device change, which happens
// on resume after suspending PC.
if (this.deviceChangeListener)
JitsiMeetJS.mediaDevices.removeEventListener(
JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,
this.deviceChangeListener);
// stop local video
if (localVideo)
localVideo.dispose();
// stop local audio
if (localAudio)
localAudio.dispose();
// show overlay
APP.UI.showSuspendedOverlay();
});
room.on(ConferenceEvents.DTMF_SUPPORT_CHANGED, (isDTMFSupported) => {
APP.UI.updateDTMFSupport(isDTMFSupported);
});
@ -1617,11 +1641,12 @@ export default {
APP.UI.onAvailableDevicesChanged(devices);
});
this.deviceChangeListener = (devices) =>
window.setTimeout(
() => this._onDeviceListChanged(devices), 0);
JitsiMeetJS.mediaDevices.addEventListener(
JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,
(devices) =>
window.setTimeout(
() => this._onDeviceListChanged(devices), 0));
this.deviceChangeListener);
}
},
/**

Loading…
Cancel
Save