Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
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.
 
 
 
 
 
 
jitsi-meet/resources/nwjs-integration/index.html

71 lines
2.3 KiB

<html>
<head>
<style>
body {
margin: 0;
}
iframe {
width: 100%;
height: 100%;
border: 0 none;
}
</style>
</head>
<body>
<script>
var gui = require('nw.gui');
var screenInitialized = false;
function obtainDesktopStream (callback, errorCallback) {
if (!screenInitialized) {
gui.Screen.Init();
screenInitialized = true;
}
gui.Screen.chooseDesktopMedia(
["window","screen"],
function(streamId) {
var vid_constraint = {
mandatory: {
chromeMediaSource: 'desktop',
chromeMediaSourceId: streamId,
maxWidth: 1920,
maxHeight: 1080
},
optional: []
};
navigator.webkitGetUserMedia({
audio: false, video: vid_constraint
}, callback, function (error) {
errorCallback &&
errorCallback(error, vid_constraint);
});
}
);
}
// use Esc to leave fullscreen mode
nw.App.registerGlobalHotKey(new nw.Shortcut({
key: "Escape",
active: function () {
var win = nw.Window.get();
if (win.isFullscreen) {
win.leaveFullscreen();
}
}
}));
// create iframe with jitsi-meet
var iframe = document.createElement('iframe');
iframe.src = nw.App.manifest['jitsi-url'];
iframe.allowFullscreen = true;
iframe.onload = function () {
iframe.contentWindow.JitsiMeetNW = {
obtainDesktopStream: obtainDesktopStream
};
};
document.body.appendChild(iframe);
</script>
</body>
</html>