{"record":{"id":"eba07ab1cefe8112","repo":"iflytek/astron-agent","slug":"invalid-operation","errorCode":"INVALID_OPERATION","errorMessage":"switch device is not supported in screen sharing","messagePattern":"switch device is not supported in screen sharing","errorType":"error_code","errorClass":"X","httpStatus":null,"severity":"error","filePath":"console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/xrtc-player-BJTnVhG9.js","lineNumber":4956,"sourceCode":"            'contentHint' in t &&\n            (this.logger.info('set video track contentHint to: ' + e),\n            (t.contentHint = e),\n            t.contentHint !== e &&\n              this.logger.info('Invalid video track contentHint: ' + e),\n            this.logger.buriedLog({\n              c: Ue.SET_VIDEO_CONTENT_HINT,\n              v: 'hint'.concat(e),\n            }));\n        },\n      },\n      {\n        key: 'switchDevice',\n        value: function (e, t) {\n          var i,\n            r,\n            n = this;\n          if (this.screen)\n            throw new X({\n              code: B.INVALID_OPERATION,\n              message: 'switch device is not supported in screen sharing',\n            });\n          if (\n            !t ||\n            this.streamConfig.audioSource ||\n            this.streamConfig.videoSource\n          )\n            return Promise.reject();\n          if (\n            ('audio' === e && this.microphoneId_ === t) ||\n            ('video' === e && this.cameraId_ === t)\n          )\n            return (\n              this.logger.warn('switch device is not supported same device'),\n              Promise.reject('switch device is not supported same device')\n            );\n          if (","sourceCodeStart":4938,"sourceCodeEnd":4974,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/frontend/src/utils/avatar-sdk-web_3.1.2.1002/xrtc-player-BJTnVhG9.js#L4938-L4974","documentation":"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.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Stop screen sharing before calling switchDevice","Disable device-switch UI while screen sharing","Catch the error and surface a 'not available during screen share' message"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}