MediaTrackError

View as MarkdownOpen in Claude

Raised when a peer-connection track operation fails — most commonly when the SDK tries to addTrack, replaceTrack, or remove a track during device switching, muting, or screen-share handoff. The operation and kind properties locate the failure; originalError carries the underlying DOMException from the WebRTC stack.

Extends

  • Error

Constructors

Constructor

1new MediaTrackError(operation, kind, originalError): MediaTrackError

Parameters

operation
stringRequired

Track operation that failed (e.g. addTrack, replaceTrack).

kind
stringRequired

Kind of media track involved (audio or video).

originalError
unknownRequired

Underlying error raised by the WebRTC stack.

Properties

kind
stringRequired

Kind of media track involved (audio or video).

operation
stringRequired

Track operation that failed (e.g. addTrack, replaceTrack).

originalError
unknownRequired

Underlying error raised by the WebRTC stack.

Examples

1import { MediaTrackError } from '@signalwire/js';
2
3call.errors$.subscribe((err) => {
4 if (err instanceof MediaTrackError) {
5 console.error(`media track ${err.kind} ${err.operation} failed:`, err.originalError);
6 }
7});