<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # desktopCapturer `desktopCapturer` 模塊可用來獲取可用資源,這個資源可通過 `getUserMedia` 捕獲得到. ```javascript // 在渲染進程中. var desktopCapturer = require('electron').desktopCapturer; desktopCapturer.getSources({types: ['window', 'screen']}, function(error, sources) { if (error) throw error; for (var i = 0; i < sources.length; ++i) { if (sources[i].name == "Electron") { navigator.webkitGetUserMedia({ audio: false, video: { mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId: sources[i].id, minWidth: 1280, maxWidth: 1280, minHeight: 720, maxHeight: 720 } } }, gotStream, getUserMediaError); return; } } }); function gotStream(stream) { document.querySelector('video').src = URL.createObjectURL(stream); } function getUserMediaError(e) { console.log('getUserMediaError'); } ``` 當調用 `navigator.webkitGetUserMedia` 時創建一個約束對象,如果使用 `desktopCapturer` 的資源,必須設置 `chromeMediaSource` 為 `"desktop"` ,并且 `audio` 為 `false`. 如果你想捕獲整個桌面的 audio 和 video,你可以設置 `chromeMediaSource` 為 `"screen"` ,和 `audio` 為 `true`. 當使用這個方法的時候,不可以指定一個 `chromeMediaSourceId`. ## 方法 `desktopCapturer` 模塊有如下方法: ### `desktopCapturer.getSources(options, callback)` * `options` Object * `types` Array - 一個 String 數組,列出了可以捕獲的桌面資源類型, 可用類型為 `screen` 和 `window`. * `thumbnailSize` Object (可選) - 建議縮略可被縮放的 size, 默認為 `{width: 150, height: 150}`. * `callback` Function 發起一個請求,獲取所有桌面資源,當請求完成的時候使用 `callback(error, sources)` 調用 `callback` . `sources` 是一個 `Source` 對象數組, 每個 `Source` 表示了一個捕獲的屏幕或單獨窗口,并且有如下屬性 : * `id` String - 在 `navigator.webkitGetUserMedia` 中使用的捕獲窗口或屏幕的 id . 格式為 `window:XX` 禍 `screen:XX`,`XX` 是一個隨機數. * `name` String - 捕獲窗口或屏幕的描述名 . 如果資源為屏幕,名字為 `Entire Screen` 或 `Screen <index>`; 如果資源為窗口, 名字為窗口的標題. * `thumbnail` [NativeImage](NativeImage.md) - 縮略圖. **注意:** 不能保證 `source.thumbnail` 的 size 和 `options` 中的 `thumnbailSize` 一直一致. 它也取決于屏幕或窗口的縮放比例.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看