您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.html 2.1KB

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