Fix unused locals and better receiver selector available media checking

This commit is contained in:
hensm
2019-08-16 12:57:23 +01:00
parent 1c67354e1d
commit e2eca07876
28 changed files with 282 additions and 363 deletions

View File

@@ -21,22 +21,6 @@ let session: cast.Session;
let wasSessionRequested = false;
let peerConnection: RTCPeerConnection;
let drawWindowIntervalId: number;
let availableMediaTypes =
ReceiverSelectorMediaType.Screen
| ReceiverSelectorMediaType.Tab;
/**
* Remove "Screen" option when on an insecure origin as
* MediaDevices.getDisplayMedia will not exist (and legacy
* MediaDevices.getUserMedia mediaSource constraint will
* fail).
*/
if (typeof navigator.mediaDevices.getDisplayMedia === "undefined") {
availableMediaTypes &= ~ReceiverSelectorMediaType.Screen;
}
/**
@@ -124,7 +108,7 @@ async function onRequestSessionSuccess (newSession: cast.Session) {
}
drawWindowIntervalId = window.setInterval(drawWindow, 1000 / 30);
window.setInterval(drawWindow, 1000 / 30);
/**
* Capture video stream from canvas and feed into the RTC