mirror of https://github.com/dani/vroom.git
Video conf based on SimpleWebRTC https://vroom.fws.fr/documentation
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.1 KiB
25 lines
1.1 KiB
/* background page, responsible for actually choosing media */
|
|
chrome.runtime.onConnect.addListener(function (channel) {
|
|
channel.onMessage.addListener(function (message) {
|
|
switch(message.type) {
|
|
case 'getScreen':
|
|
var pending = chrome.desktopCapture.chooseDesktopMedia(message.options || ['screen', 'window'],
|
|
channel.sender.tab, function (streamid) {
|
|
// communicate this string to the app so it can call getUserMedia with it
|
|
message.type = 'gotScreen';
|
|
message.sourceId = streamid;
|
|
channel.postMessage(message);
|
|
});
|
|
// let the app know that it can cancel the timeout
|
|
message.type = 'getScreenPending';
|
|
message.request = pending;
|
|
channel.postMessage(message);
|
|
break;
|
|
case 'cancelGetScreen':
|
|
chrome.desktopCapture.cancelChooseDesktopMedia(message.request);
|
|
message.type = 'canceledGetScreen';
|
|
channel.postMessage(message);
|
|
break;
|
|
}
|
|
});
|
|
});
|
|
|