"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7688/resources/nwjs-integration/index.html" (1 Dec 2023, 2337 Bytes) of package /linux/misc/jitsi-meet-7688.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    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, function (error) {
   40                             errorCallback &&
   41                                 errorCallback(error, vid_constraint);
   42                         });
   43                     }
   44                 );
   45             }
   46 
   47             // use Esc to leave fullscreen mode
   48             nw.App.registerGlobalHotKey(new nw.Shortcut({
   49                 key: "Escape",
   50                 active: function () {
   51                     var win = nw.Window.get();
   52                     if (win.isFullscreen) {
   53                         win.leaveFullscreen();
   54                     }
   55                 }
   56             }));
   57 
   58             // create iframe with jitsi-meet
   59             var iframe = document.createElement('iframe');
   60             iframe.src = nw.App.manifest['jitsi-url'];
   61             iframe.allowFullscreen = true;
   62             iframe.onload = function () {
   63                 iframe.contentWindow.JitsiMeetNW = {
   64                     obtainDesktopStream: obtainDesktopStream
   65                 };
   66             };
   67 
   68             document.body.appendChild(iframe);
   69         </script>
   70     </body>
   71 </html>