最終更新:2020-03-27 (金) 16:49:21 (108d)  

OpenTok/画面共有
Top / OpenTok / 画面共有

https://tokbox.com/developer/guides/screen-sharing/js/

対応

非対応

  • Publishing screen-sharing streams is currently not supported in Safari or non-Chromium versions of Microsoft Edge

メモ

  • Important: As of Google Chrome 72+, Firefox 52+, and Opera 59?+, an extension is no longer needed for screen sharing. The browser prompts the end user for access to the screen as it would for access to the camera.

macOS

  • On macOS 10.15+ (Catalina), to publish a screen-sharing stream the user must grant the browser access to the screen in macOS System Preferences > Security & Privacy > Privacy > Screen Recording. Otherwise, the Publisher will dispatch an accessDenied event.

OpenTok.js

  • OT.checkScreenSharingCapabilit?
  • OT.initPublisher
    <div id="publisher"></div>
    <div id="screen-preview"></div>
    
    OT.checkScreenSharingCapability(function(response) {
      if(!response.supported || response.extensionRegistered === false) {
        // This browser does not support screen sharing.
      } else if (response.extensionInstalled === false) {
        // Prompt to install the extension.
      } else {
        // Screen sharing is available. Publish the screen.
        var publisher = OT.initPublisher('screen-preview',
          {videoSource: 'screen'},
          function(error) {
            if (error) {
              // Look at error.message to see what went wrong.
            } else {
              session.publish(publisher, function(error) {
                if (error) {
                  // Look error.message to see what went wrong.
                }
              });
            }
          }
        );
      }
    });

参考