Skip to content
Cloudflare Docs

RTKSelfMedia

Members

audioTrack

Returns the audioTrack.

rawAudioTrack

Returns the rawAudioTrack having no middleware executed on it.

mediaPermissions

Returns the current audio and video permissions given by the user. 'ACCEPTED' if the user has given permission to use the media. 'CANCELED' if the user has canceled the screenshare. 'DENIED' if the user has denied permission to use the media. 'SYS_DENIED' if the user's system has denied permission to use the media. 'UNAVAILABLE' if the media is not available (or being used by a different application).

videoTrack

Returns the videoTrack.

rawVideoTrack

Returns the videoTrack having no middleware executed on it.

screenShareTracks

Returns the screen share tracks.

audioEnabled

Returns true if audio is enabled.

videoEnabled

Returns true if video is enabled.

screenShareEnabled

Returns true if screen share is enabled.

Functions

init(options, [skipAwaits], [context])
addAudioMiddleware(audioMiddleware)

Adds the audio middleware to be executed on the raw audio stream. If there are more than 1 audio middlewares, they will be executed in the sequence they were added in. If you want the sequence to be altered, please remove all previous middlewares and re-add.

removeAudioMiddleware(audioMiddleware)

Removes the audio middleware, if it is there.

removeAllAudioMiddlewares()

Removes all audio middlewares, if they are there.

addVideoMiddleware(videoMiddleware)

Adds the video middleware to be executed on the raw video stream. If there are more than 1 video middlewares, they will be executed in the sequence they were added in. If you want the sequence to be altered, please remove all previous middlewares and re-add.

setVideoMiddlewareGlobalConfig(config)

Sets global config to be used by video middlewares.

removeVideoMiddleware(videoMiddleware)

Removes the video middleware, if it is there.

removeAllVideoMiddlewares()

Removes all video middlewares, if they are there.

getCurrentDevices()

Returns the media devices currently being used.

getAudioDevices()

Returns the local participant's audio devices.

getVideoDevices()

Returns the local participant's video devices.

getSpeakerDevices()

Returns the local participant's speaker devices.

getDeviceById(deviceId, kind)

Returns the local participant's device, indexed by ID and kind.

setDevice(device)

Change the current media device that is being used by the local participant.

Returns the audioTrack.

Kind: global variable

Returns the rawAudioTrack having no middleware executed on it.

Kind: global variable

Returns the current audio and video permissions given by the user. 'ACCEPTED' if the user has given permission to use the media. 'CANCELED' if the user has canceled the screenshare. 'DENIED' if the user has denied permission to use the media. 'SYS_DENIED' if the user's system has denied permission to use the media. 'UNAVAILABLE' if the media is not available (or being used by a different application).

Kind: global variable

Returns the videoTrack.

Kind: global variable

Returns the videoTrack having no middleware executed on it.

Kind: global variable

Returns the screen share tracks.

Kind: global variable

Returns true if audio is enabled.

Kind: global variable

Returns true if video is enabled.

Kind: global variable

Returns true if screen share is enabled.

Kind: global variable

Kind: global function

ParamTypeDefault
optionsObject
[options.video]boolean
[options.audio]boolean
[options.constraints]MediaConstraints
[skipAwaits]booleanfalse
[context]Context

Adds the audio middleware to be executed on the raw audio stream. If there are more than 1 audio middlewares, they will be executed in the sequence they were added in. If you want the sequence to be altered, please remove all previous middlewares and re-add.

Kind: global function

ParamType
audioMiddlewareAudioMiddleware

Removes the audio middleware, if it is there.

Kind: global function

ParamType
audioMiddlewareAudioMiddleware

Removes all audio middlewares, if they are there.

Kind: global function

Adds the video middleware to be executed on the raw video stream. If there are more than 1 video middlewares, they will be executed in the sequence they were added in. If you want the sequence to be altered, please remove all previous middlewares and re-add.

Kind: global function

ParamType
videoMiddlewareVideoMiddleware

Sets global config to be used by video middlewares.

Kind: global function

ParamTypeDescription
configVideoMiddlewareGlobalConfigconfig
config.disablePerFrameCanvasRenderingbooleanIf set to true, Instead of calling Middleware for every frame, Middleware will only be called once that too with empty canvas, it is the responsibility of the middleware author to keep updating this canvas. meeting.self.rawVideoTrack can be used to retrieve video track for the periodic updates.

Removes the video middleware, if it is there.

Kind: global function

ParamType
videoMiddlewareVideoMiddleware

Removes all video middlewares, if they are there.

Kind: global function

Returns the media devices currently being used.

Kind: global function

Returns the local participant's audio devices.

Kind: global function

Returns the local participant's video devices.

Kind: global function

Returns the local participant's speaker devices.

Kind: global function

Returns the local participant's device, indexed by ID and kind.

Kind: global function

ParamTypeDescription
deviceIdstringThe ID of the device.
kind'audio' | 'video' | 'speaker'The kind of the device: audio, video, or speaker.

Change the current media device that is being used by the local participant.

Kind: global function

ParamTypeDescription
deviceMediaDeviceInfoThe device that is to be used. A device of the same kind will be replaced. the primary stream.