{"record":{"id":"34fb3df84f83e785","repo":"transloadit/uppy","slug":"no-video-stream-available","errorCode":null,"errorMessage":"No video stream available","messagePattern":"No video stream available","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@uppy/screen-capture/src/ScreenCapture.tsx","lineNumber":298,"sourceCode":"      .catch((err) => {\n        if (err.name === 'NotAllowedError') {\n          this.uppy.info(this.i18n('micDisabled'), 'error', 5000)\n          this.uppy.log(this.i18n('micDisabled'), 'warning')\n        }\n        return false\n      })\n  }\n\n  startRecording(): void {\n    const options: { mimeType?: string } = {}\n    this.capturedMediaFile = null\n    this.recordingChunks = []\n    const { preferredVideoMimeType } = this.opts\n\n    this.selectVideoStreamSource()\n      .then((videoStream) => {\n        if (videoStream === false) {\n          throw new Error('No video stream available')\n        }\n        // Attempt to use the passed preferredVideoMimeType (if any) during recording.\n        // If the browser doesn't support it, we'll fall back to the browser default instead\n        if (\n          preferredVideoMimeType &&\n          MediaRecorder.isTypeSupported(preferredVideoMimeType) &&\n          getFileTypeExtension(preferredVideoMimeType)\n        ) {\n          options.mimeType = preferredVideoMimeType\n        }\n\n        // prepare tracks\n        const tracks = [videoStream.getVideoTracks()[0]]\n\n        // merge audio if exits\n        if (this.audioStream) {\n          tracks.push(this.audioStream.getAudioTracks()[0])\n        }","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/screen-capture/src/ScreenCapture.tsx#L280-L316","documentation":"Thrown by ScreenCapture's startRecording when selectVideoStreamSource() resolves to false, meaning no screen/window/tab stream was obtained before recording started. This happens when getDisplayMedia is unsupported or the stream selection returned false, so there is nothing to record.","triggerScenarios":"Calling startRecording (via getRecordButtonProps().onClick) in a browser without navigator.mediaDevices.getDisplayMedia, or when the internal selectVideoStreamSource promise resolves false (e.g. plugin not mounted, stream already stopped, or inactive video track).","commonSituations":"Running in a non-secure context (http, not localhost), unsupported browser (Safari/Firefox without screen capture), running in a headless test environment, or starting recording after the user cancelled the screen picker.","solutions":["Check navigator.mediaDevices?.getDisplayMedia is available and the page is served over HTTPS before enabling the ScreenCapture plugin","Only trigger recording from the plugin's own UI state (RECORDING/PAUSED states), not programmatically before a stream exists","In tests/headless environments, stub getDisplayMedia or skip the plugin"],"exampleFix":"// before\nconst btn = plugin.getRecordButtonProps()\nbtn.onClick() // may throw: no stream yet\n\n// after\nif (navigator.mediaDevices?.getDisplayMedia && plugin.getPluginState().screenRecActive !== undefined) {\n  plugin.getRecordButtonProps().onClick()\n}","handlingStrategy":"validation","validationCode":"const canRecord = typeof navigator.mediaDevices?.getDisplayMedia === 'function'\nif (canRecord) uppy.use(ScreenCapture)","typeGuard":"const supportsScreenCapture = (): boolean =>\n  typeof navigator !== 'undefined' &&\n  typeof navigator.mediaDevices?.getDisplayMedia === 'function'","tryCatchPattern":"try { plugin.getRecordButtonProps().onClick() } catch (e) { if (e.message === 'No video stream available') uppy.info('Screen sharing unavailable', 'error', 5000) }","preventionTips":["Only enable ScreenCapture over HTTPS in browsers supporting getDisplayMedia","Drive recording through the plugin's own Dashboard UI so streams are always established first","Stub getDisplayMedia in automated tests"],"tags":["screen-capture","getdisplaymedia","media-recorder","browser-support"],"backgroundTag":"getdisplaymedia-unavailable","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}