src/opentok-screen-sharing.js
function (annotationContainer) {

    _session.publish(_this.publisher, function (error) {
      if (error) {

        // Let's write our own error message
        var customError = _.omit(error, 'message');

        if (error.code === 1500 && navigator.userAgent.indexOf('Firefox') !== -1) {
          $('#dialog-form-ff').toggle();
        } else {

          var errorMessage;

          if (error.code === 1010) {
            errorMessage = 'Check your network connection';
          } else {
            errorMessage = 'Error sharing the screen';
          }

          customError.message = errorMessage;
          _triggerEvent('screenSharingError', customError);
          _log(_logEventData.actionStart, _logEventData.variationError);
        }
      } else {
        if (_this.annotation && _this.externalWindow) {
          _accPack.linkAnnotation(_this.publisher, annotationContainer, _this.annotationWindow);
          _log(_logEventData.actionInitialize, _logEventData.variationSuccess);
        }
        _active = true;
        _triggerEvent('startScreenSharing', _this.publisher);
        _log(_logEventData.actionStart, _logEventData.variationSuccess);
      }
    });

  }
function (annotationContainer) {

    _session.publish(_this.publisher, function (error) {
      if (error) {

        // Let's write our own error message
        var customError = _.omit(error, 'message');

        if (error.code === 1500 && navigator.userAgent.indexOf('Firefox') !== -1) {
          $('#dialog-form-ff').toggle();
        } else {

          var errorMessage;

          if (error.code === 1010) {
            errorMessage = 'Check your network connection';
          } else {
            errorMessage = 'Error sharing the screen';
          }

          customError.message = errorMessage;
          _triggerEvent('screenSharingError', customError);
          _log(_logEventData.actionStart, _logEventData.variationError);
        }
      } else {
        if (_this.annotation && _this.externalWindow) {
          _accPack.linkAnnotation(_this.publisher, annotationContainer, _this.annotationWindow);
          _log(_logEventData.actionInitialize, _logEventData.variationSuccess);
        }
        _active = true;
        _triggerEvent('startScreenSharing', _this.publisher);
        _log(_logEventData.actionStart, _logEventData.variationSuccess);
      }
    });

  }
function ( annotationContainer ) { _session . publish ( _this . publisher , function ( error ) { if ( error ) { // Let's write our own error message var customError = _ . omit ( error , 'message' ) ; if ( error . code === 1500 && navigator . userAgent . indexOf ( 'Firefox' ) !== - 1 ) { $ ( '#dialog-form-ff' ) . toggle ( ) ; } else { var errorMessage ; if ( error . code === 1010 ) { errorMessage = 'Check your network connection' ; } else { errorMessage = 'Error sharing the screen' ; } customError . message = errorMessage ; _triggerEvent ( 'screenSharingError' , customError ) ; _log ( _logEventData . actionStart , _logEventData . variationError ) ; } } else { if ( _this . annotation && _this . externalWindow ) { _accPack . linkAnnotation ( _this . publisher , annotationContainer , _this . annotationWindow ) ; _log ( _logEventData . actionInitialize , _logEventData . variationSuccess ) ; } _active = true ; _triggerEvent ( 'startScreenSharing' , _this . publisher ) ; _log ( _logEventData . actionStart , _logEventData . variationSuccess ) ; } } ) ; }
Start publishing the screen
@param annotationContainer
Start publishing the screen