Skip to content

@seydx/rtsp / supportsBackchannel

Function: supportsBackchannel()

supportsBackchannel(source): source is Source & BackchannelSource

Defined in: types.ts:272

Determine whether a source accepts talkback audio.

Narrows a Source to also be a BackchannelSource when it implements sendBackchannel, enabling type-safe access to the backchannel API without an unchecked cast.

Parameters

source

Source

The source to test

Returns

source is Source & BackchannelSource

true if the source implements the backchannel capability, narrowing its type accordingly

Example

typescript
import { supportsBackchannel } from '@seydx/rtsp';

if (supportsBackchannel(source)) {
  // source is now typed as Source & BackchannelSource
  source.sendBackchannel(rtpPacket);
}

See

BackchannelSource For the capability being detected