iflytek/astron-agent · error · X

INVALID_OPERATION

INVALID_OPERATION

Error message

switch device is not supported in screen sharing

What it means

The xrtc SDK's switchDevice method throws a coded business error (INVALID_OPERATION) when screen sharing is active — switching camera/microphone mid screen-share is not supported by the SDK. Fires if the app calls switchDevice while this.screen is true.

Solutions

  1. Stop screen sharing before calling switchDevice
  2. Disable device-switch UI while screen sharing
  3. Catch the error and surface a 'not available during screen share' message
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/xrtc-player-BJTnVhG9.js:4956 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/eba07ab1cefe8112. Report an issue: GitHub.

Appendix: source

Thrown at console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/xrtc-player-BJTnVhG9.js:4956

            'contentHint' in t &&
            (this.logger.info('set video track contentHint to: ' + e),
            (t.contentHint = e),
            t.contentHint !== e &&
              this.logger.info('Invalid video track contentHint: ' + e),
            this.logger.buriedLog({
              c: Ue.SET_VIDEO_CONTENT_HINT,
              v: 'hint'.concat(e),
            }));
        },
      },
      {
        key: 'switchDevice',
        value: function (e, t) {
          var i,
            r,
            n = this;
          if (this.screen)
            throw new X({
              code: B.INVALID_OPERATION,
              message: 'switch device is not supported in screen sharing',
            });
          if (
            !t ||
            this.streamConfig.audioSource ||
            this.streamConfig.videoSource
          )
            return Promise.reject();
          if (
            ('audio' === e && this.microphoneId_ === t) ||
            ('video' === e && this.cameraId_ === t)
          )
            return (
              this.logger.warn('switch device is not supported same device'),
              Promise.reject('switch device is not supported same device')
            );
          if (

View on GitHub (pinned to 5e758547a8)