MediaAccessError

View as MarkdownOpen in Claude

Raised when getUserMedia or getDisplayMedia fails to hand the SDK a local track — a denied permission, a device already held exclusively by another application, or a capture the browser refused.

Non-fatal by default: a screen share or additional-device failure never ends the call, and a main-connection failure degrades to receive-only when the call is set to receive media. fatal is true only when the call cannot continue — fallbackToReceiveOnly was disabled, or the call has no receive intent to fall back to.

Extends

  • Error

Constructors

Constructor

new MediaAccessError(operation, media, originalError, fatal?): MediaAccessError

Parameters

operation
stringRequired

The SDK operation that failed, e.g. 'acquireLocalMedia', 'startScreenShare', 'addInputDevice'.

media
stringRequired

The media being acquired: 'audio', 'video', 'audiovideo', or 'screen'.

originalError
unknownRequired

The raw getUserMedia/getDisplayMedia error, typically a DOMException.

fatal
booleanDefaults to false

Whether this failure terminates the call.

Properties

denied
booleanRequired

Read-only. true when the underlying failure is a permission denial by the user or by policy — that is, when originalError.name is NotAllowedError, SecurityError, or PermissionDeniedError.

fatal
booleanRequired

Whether this failure terminates the call.

media
stringRequired

The media being acquired: 'audio', 'video', 'audiovideo', or 'screen'.

operation
stringRequired

The SDK operation that failed.

originalError
unknownRequired

The raw getUserMedia/getDisplayMedia error.

Examples

import { MediaAccessError } from '@signalwire/js';
call.errors$.subscribe(({ error, leg }) => {
if (error instanceof MediaAccessError) {
if (error.denied) {
showPermissionHelp(error.media);
} else if (leg === 'screenshare') {
toast('Screen share failed — the call is still connected.');
}
}
});

See