|
@@ -0,0 +1,68 @@
|
|
1
|
+<html>
|
|
2
|
+ <head>
|
|
3
|
+
|
|
4
|
+ <style>
|
|
5
|
+ body {
|
|
6
|
+ margin: 0;
|
|
7
|
+ }
|
|
8
|
+
|
|
9
|
+ iframe {
|
|
10
|
+ width: 100%;
|
|
11
|
+ height: 100%;
|
|
12
|
+ border: 0 none;
|
|
13
|
+ }
|
|
14
|
+ </style>
|
|
15
|
+ </head>
|
|
16
|
+ <body>
|
|
17
|
+ <script>
|
|
18
|
+ var gui = require('nw.gui');
|
|
19
|
+ var screenInitialized = false;
|
|
20
|
+ function obtainDesktopStream (callback, errorCallback) {
|
|
21
|
+ if (!screenInitialized) {
|
|
22
|
+ gui.Screen.Init();
|
|
23
|
+ screenInitialized = true;
|
|
24
|
+ }
|
|
25
|
+ gui.Screen.chooseDesktopMedia(
|
|
26
|
+ ["window","screen"],
|
|
27
|
+ function(streamId) {
|
|
28
|
+ var vid_constraint = {
|
|
29
|
+ mandatory: {
|
|
30
|
+ chromeMediaSource: 'desktop',
|
|
31
|
+ chromeMediaSourceId: streamId,
|
|
32
|
+ maxWidth: 1920,
|
|
33
|
+ maxHeight: 1080
|
|
34
|
+ },
|
|
35
|
+ optional: []
|
|
36
|
+ };
|
|
37
|
+ navigator.webkitGetUserMedia({
|
|
38
|
+ audio: false, video: vid_constraint
|
|
39
|
+ }, callback, errorCallback);
|
|
40
|
+ }
|
|
41
|
+ );
|
|
42
|
+ }
|
|
43
|
+
|
|
44
|
+ // use Esc to leave fullscreen mode
|
|
45
|
+ nw.App.registerGlobalHotKey(new nw.Shortcut({
|
|
46
|
+ key: "Escape",
|
|
47
|
+ active: function () {
|
|
48
|
+ var win = nw.Window.get();
|
|
49
|
+ if (win.isFullscreen) {
|
|
50
|
+ win.leaveFullscreen();
|
|
51
|
+ }
|
|
52
|
+ }
|
|
53
|
+ }));
|
|
54
|
+
|
|
55
|
+ // create iframe with jitsi-meet
|
|
56
|
+ var iframe = document.createElement('iframe');
|
|
57
|
+ iframe.src = nw.App.manifest['jitsi-url'];
|
|
58
|
+ iframe.allowFullscreen = true;
|
|
59
|
+ iframe.onload = function () {
|
|
60
|
+ iframe.contentWindow.JitsiMeetNW = {
|
|
61
|
+ obtainDesktopStream: obtainDesktopStream
|
|
62
|
+ };
|
|
63
|
+ };
|
|
64
|
+
|
|
65
|
+ document.body.appendChild(iframe);
|
|
66
|
+ </script>
|
|
67
|
+ </body>
|
|
68
|
+</html>
|