/ fm / liveswitch / WebRtcLocalMediaBase
Class: WebRtcLocalMediaBase<TLocalMedia, TAudioTrack, TVideoTrack>
fm.liveswitch.WebRtcLocalMediaBase
A collection of local audio/video track base methods.
Type parameters
Name | Type |
---|---|
TLocalMedia |
WebRtcLocalMediaBase<TLocalMedia, TAudioTrack, TVideoTrack> |
TAudioTrack |
WebRtcAudioTrack |
TVideoTrack |
WebRtcVideoTrack |
Hierarchy
WebRtcMedia<TAudioTrack, TVideoTrack>
↳ WebRtcLocalMediaBase
Table of contents
Constructors
Methods
- _setAudioMediaStream
- _setVideoMediaStream
- abortStart
- addOnAudioDestroyed
- addOnAudioLevel
- addOnVideoDestroyed
- addOnVideoSize
- addOnVideoSizeChange
- destroy
- destroyAudioContext
- doGetAudioEncodings
- doGetVideoEncodings
- doSetAudioEncodings
- doSetVideoEncodings
- doStart
- doStop
- dontUseAudioSink
- fmliveswitchWebRtcLocalMediaBaseInit
- getAudio
- getAudioEncoding
- getAudioEncodings
- getAudioGain
- getAudioLevelInterval
- getAudioMuted
- getAudioSimulcastDisabled
- getAudioSimulcastEncodingCount
- getAudioSimulcastPreferredBitrate
- getAudioSink
- getAudioTrack
- getAudioTracks
- getAudioVolume
- getDynamicProperties
- getDynamicValue
- getId
- getState
- getTypeString
- getVideo
- getVideoEncoding
- getVideoEncodings
- getVideoMuted
- getVideoSimulcastBitsPerPixel
- getVideoSimulcastDegradationPreference
- getVideoSimulcastDisabled
- getVideoSimulcastEncodingCount
- getVideoSimulcastPreferredBitrate
- getVideoSink
- getVideoSize
- getVideoTrack
- getVideoTracks
- getView
- getViewSink
- grabVideoFrame
- initializeAudioContext
- lockAudioEncodings
- lockVideoEncodings
- removeOnAudioDestroyed
- removeOnAudioLevel
- removeOnVideoDestroyed
- removeOnVideoSize
- removeOnVideoSizeChange
- setAudio
- setAudioEncodings
- setAudioGain
- setAudioLevelInterval
- setAudioMuted
- setAudioSimulcastDisabled
- setAudioSimulcastEncodingCount
- setAudioSimulcastPreferredBitrate
- setAudioVolume
- setDynamicValue
- setId
- setVideo
- setVideoEncodings
- setVideoMuted
- setVideoSimulcastBitsPerPixel
- setVideoSimulcastDegradationPreference
- setVideoSimulcastDisabled
- setVideoSimulcastEncodingCount
- setVideoSimulcastPreferredBitrate
- start
- stop
- unsetDynamicValue
- getDefaultVideoBitsPerPixel
- setDefaultVideoBitsPerPixel
Constructors
constructor
+ new WebRtcLocalMediaBase<TLocalMedia, TAudioTrack, TVideoTrack>(external
: Object): WebRtcLocalMediaBase<TLocalMedia, TAudioTrack, TVideoTrack>
Initializes a new instance of the [[fm.liveswitch.localMediaBase]] class.
Type parameters:
Name | Type |
---|---|
TLocalMedia |
WebRtcLocalMediaBase<TLocalMedia, TAudioTrack, TVideoTrack, TLocalMedia> |
TAudioTrack |
WebRtcAudioTrack<TAudioTrack> |
TVideoTrack |
WebRtcVideoTrack<TVideoTrack> |
Parameters:
Name | Type | Description |
---|---|---|
external |
Object | The external. |
Returns: WebRtcLocalMediaBase<TLocalMedia, TAudioTrack, TVideoTrack>
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:36
Methods
_setAudioMediaStream
▸ Protected
_setAudioMediaStream(audioMediaStream
: MediaStream): boolean
Parameters:
Name | Type |
---|---|
audioMediaStream |
MediaStream |
Returns: boolean
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:24
_setVideoMediaStream
▸ Protected
_setVideoMediaStream(videoMediaStream
: MediaStream): boolean
Parameters:
Name | Type |
---|---|
videoMediaStream |
MediaStream |
Returns: boolean
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:49
abortStart
▸ Protected
abortStart(promise
: Promise<TLocalMedia>, exception
: Exception): void
Aborts the start.
Parameters:
Name | Type | Description |
---|---|---|
promise |
Promise<TLocalMedia> | The promise. |
exception |
Exception | The exception. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:100
addOnAudioDestroyed
▸ addOnAudioDestroyed(value
: IAction0): void
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:164
addOnAudioLevel
▸ addOnAudioLevel(value
: IAction1<number>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<number> |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:177
addOnVideoDestroyed
▸ addOnVideoDestroyed(value
: IAction0): void
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:167
addOnVideoSize
▸ addOnVideoSize(value
: IAction1<Size>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<Size> |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:181
addOnVideoSizeChange
▸ addOnVideoSizeChange(value
: IAction1<Size>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<Size> |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:185
destroy
▸ destroy(): void
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:216
destroyAudioContext
▸ Protected
destroyAudioContext(): void
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:444
doGetAudioEncodings
▸ Protected
Abstract
doGetAudioEncodings(): AudioEncodingConfig[]
Gets the local audio encodings.
Returns: AudioEncodingConfig[]
The local audio encodings.
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:122
doGetVideoEncodings
▸ Protected
Abstract
doGetVideoEncodings(): VideoEncodingConfig[]
Gets the local video encodings.
Returns: VideoEncodingConfig[]
The local video encodings.
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:129
doSetAudioEncodings
▸ Protected
Abstract
doSetAudioEncodings(encodings
: AudioEncodingConfig[]): void
Sets the local audio encodings.
Parameters:
Name | Type | Description |
---|---|---|
encodings |
AudioEncodingConfig[] | The local audio encodings. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:136
doSetVideoEncodings
▸ Protected
Abstract
doSetVideoEncodings(encodings
: VideoEncodingConfig[]): void
Sets the local video encodings.
Parameters:
Name | Type | Description |
---|---|---|
encodings |
VideoEncodingConfig[] | The local video encodings. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:143
doStart
▸ Protected
Abstract
doStart(): Future<TLocalMedia>
Starts the local media.
Returns: Future<TLocalMedia>
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:149
doStop
▸ Protected
Abstract
doStop(): Future<TLocalMedia>
Stops the local media.
Returns: Future<TLocalMedia>
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:155
dontUseAudioSink
▸ dontUseAudioSink(): void
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:329
fmliveswitchWebRtcLocalMediaBaseInit
▸ Private
fmliveswitchWebRtcLocalMediaBaseInit(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:32
getAudio
▸ getAudio(): any
Returns: any
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:80
getAudioEncoding
▸ getAudioEncoding(): AudioEncodingConfig
Gets the local audio encoding configuration. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.
Returns: AudioEncodingConfig
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:161
getAudioEncodings
▸ getAudioEncodings(): AudioEncodingConfig[]
Gets the local audio encoding configurations. Audio encodings cannot be empty, so if you set an encoding with a null value or an empty array, this method creates an empty array with one AudioEncodingConfig in it.
If a new audio encodings array has the same number of encodings as the current one, the new audio encodings are applied to the local media’s audio track. Otherwise, an exception is thrown because the number of audio encodings cannot be changed once they are set.
Returns: AudioEncodingConfig[]
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:174
getAudioGain
▸ getAudioGain(): number
Returns: number
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:220
getAudioLevelInterval
▸ getAudioLevelInterval(): number
Returns: number
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:224
getAudioMuted
▸ getAudioMuted(): boolean
Gets a value indicating whether the audio is muted. This method silences audio but does not disable the audio source or prevent its data from flowing through the processing pipeline. If there are multiple audio tracks in a custom media stack, this property is bound to the first audio track.
Returns: boolean
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:110
getAudioSimulcastDisabled
▸ getAudioSimulcastDisabled(): boolean
Gets whether audio simulcast is disabled.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:186
getAudioSimulcastEncodingCount
▸ getAudioSimulcastEncodingCount(): number
Gets the maximum number of simulcast encodings that this media produces for the audio stream.
The number of encodings cannot be changed once they are set.
This property must be set before the media starts.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:200
getAudioSimulcastPreferredBitrate
▸ getAudioSimulcastPreferredBitrate(): number
Gets the preferred audio simulcast bitrate, in kbps. The bitrate must be a positive integer.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:213
getAudioSink
▸ getAudioSink(): WebRtcDomAudioSink
Returns: WebRtcDomAudioSink
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:251
getAudioTrack
▸ getAudioTrack(): WebRtcAudioTrack
Gets the audio track from this media. If there are multiple audio tracks in a custom media stack, this property is bound to the first audio track. Returns null if there are no audio tracks.
Returns: WebRtcAudioTrack
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:125
getAudioTracks
▸ getAudioTracks(): WebRtcAudioTrack[]
Returns: WebRtcAudioTrack[]
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:227
getAudioVolume
▸ getAudioVolume(): number
Returns: number
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:233
getDynamicProperties
▸ getDynamicProperties(): Hash<string, Object>
Gets all dynamic properties on this instance.
Returns: Hash<string, Object>
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:37
getDynamicValue
▸ getDynamicValue(key
: string): Object
Gets a property value from the local cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
Returns: Object
The stored value, if found; otherwise null.
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:58
getId
▸ getId(): string
Gets the unique identifier of this media.
Returns: string
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:160
getState
▸ getState(): LocalMediaState
Gets the current state of this media. The possible states are defined in the enumeration LocalMediaState. Use this property to check if, for example, the media instance is starting, has started, is stopping, or has stopped.
Returns: LocalMediaState
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:225
getTypeString
▸ getTypeString(): string
Returns: string
Overrides: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:10
getVideo
▸ getVideo(): any
Returns: any
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:88
getVideoEncoding
▸ getVideoEncoding(): VideoEncodingConfig
Gets the local video encoding configuration.
If there are multiple video tracks in a custom media stack, this method calls into the first video track. Returns the local VideoEncodingConfig.
Returns: VideoEncodingConfig
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:238
getVideoEncodings
▸ getVideoEncodings(): VideoEncodingConfig[]
Gets the local video encoding configurations. Video encodings cannot be empty, so if you set the value of this method to null or an empty array, an exception is thrown.
The number of video encodings cannot be changed once set. If the number of new video encodings is different from the existing number of video encodings, an error is thrown. If a new video encoding array has the same number of encodings as the current one, the encodings are applied to the media’s VP8, VP9, H.264, and H.265 controllers, converters, encoders, and packetizers.
For controllers which inherit from FrameRatePipe, that means setting controller.OutputSynchronizationSource to the encoding.SynchronizationSource. If the encoding.FrameRate is greater than zero, this sets the controller.MaxFrameRate and controller.TargetFrameRate to the encoding.FrameRate.
For converters which are the ImageScalePipe type, that means setting converter.MaxScale and converter.TargetScale to encoding.Scale, as long as encoding.Scale is greater than zero.
For encoders, if the encoder's output format is not a fixed bitrate and encoding.Bitrate is greater than zero, that means setting the encoder.MaxBitrate and encoder.TargetBitrate to encoding.Bitrate.
For packetizers, that means setting packetizer.Deactivated to encoding.Deactivated.
Returns: VideoEncodingConfig[]
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:255
getVideoMuted
▸ getVideoMuted(): boolean
Gets a value indicating whether the video track is muted.
If the video track is muted, then remote users see a black frame instead of the local user’s video.
If there are multiple video tracks in a custom media stack, this property is bound to the first video track.
Returns: boolean
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:174
getVideoSimulcastBitsPerPixel
▸ getVideoSimulcastBitsPerPixel(): number
Gets the video simulcast bits per pixel (bpp). The bits per pixel value must be greater than or equal to zero.
If the video source has declared a target width, height, and frame rate, and VideoSimulcastBitsPerPixel has a set value, then the encoding bitrates are calculated with setVideoSimulcastBitsPerPixel’s value instead of the preferred bitrate.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:268
getVideoSimulcastDegradationPreference
▸ getVideoSimulcastDegradationPreference(): VideoDegradationPreference
Gets the video’s simulcast degradation preference.
The following degradation preferences can be set:
Automatic: Prefers to automate degradation based on video type. A Screen video type prefers to degrade FrameRate. A Camera video type prefers to degrade Resolution. An unknown video type prefers a Balanced approach.
Balanced: Prefers to degrade both FrameRate and Resolution together in smaller increments.
FrameRate: Prefers to degrade FrameRate instead of Resolution.
Resolution: Prefers to degrade Resolution instead of FrameRate.
Returns: VideoDegradationPreference
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:285
getVideoSimulcastDisabled
▸ getVideoSimulcastDisabled(): boolean
Gets whether video simulcast is disabled. If true, video simulcast is disabled. If false, video simulcast is enabled.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:297
getVideoSimulcastEncodingCount
▸ getVideoSimulcastEncodingCount(): number
Gets the maximum number of simulcast encodings that this LocalMedia produces for the video stream. The default value is 2. For LiveSwitch Media Server, the maximum is 4 encodings. This property must be set before the LocalMedia starts.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:309
getVideoSimulcastPreferredBitrate
▸ getVideoSimulcastPreferredBitrate(): number
Gets the preferred bitrate of a video simulcast in Kbps. The bitrate must be a positive integer.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:321
getVideoSink
▸ getVideoSink(): WebRtcDomVideoSink
Returns: WebRtcDomVideoSink
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:257
getVideoSize
▸ getVideoSize(): Size
Returns: Size
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:242
getVideoTrack
▸ getVideoTrack(): WebRtcVideoTrack
Gets the video track from this media.
If there are multiple video tracks in a custom media stack, this property is bound to the first video track. Returns null if there are no video tracks.
Returns: WebRtcVideoTrack
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:196
getVideoTracks
▸ getVideoTracks(): WebRtcVideoTrack[]
Returns: WebRtcVideoTrack[]
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:245
getView
▸ getView(): HTMLElement
Returns: HTMLElement
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:263
getViewSink
▸ getViewSink(): WebRtcDomVideoSink
Returns: WebRtcDomVideoSink
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:269
grabVideoFrame
▸ grabVideoFrame(): Future<VideoBuffer>
Returns: Future<VideoBuffer>
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:275
initializeAudioContext
▸ Protected
initializeAudioContext(): void
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:334
lockAudioEncodings
▸ Protected
lockAudioEncodings(): void
Locks the audio encodings in prior to initialization.
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:346
lockVideoEncodings
▸ Protected
lockVideoEncodings(): void
Locks the video encodings in prior to initialization.
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:360
▸ Protected
lockVideoEncodings(sourceType
: VideoType): void
Locks the video encodings in prior to initialization.
Parameters:
Name | Type |
---|---|
sourceType |
VideoType |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:366
▸ Protected
lockVideoEncodings(sourceType
: VideoType, sourceWidth
: number, sourceHeight
: number, sourceFrameRate
: number): void
Locks the video encodings in prior to initialization.
Parameters:
Name | Type |
---|---|
sourceType |
VideoType |
sourceWidth |
number |
sourceHeight |
number |
sourceFrameRate |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:372
removeOnAudioDestroyed
▸ removeOnAudioDestroyed(value
: IAction0): void
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:170
removeOnAudioLevel
▸ removeOnAudioLevel(value
: IAction1<number>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<number> |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:294
removeOnVideoDestroyed
▸ removeOnVideoDestroyed(value
: IAction0): void
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:173
removeOnVideoSize
▸ removeOnVideoSize(value
: IAction1<Size>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<Size> |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:300
removeOnVideoSizeChange
▸ removeOnVideoSizeChange(value
: IAction1<Size>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<Size> |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:303
setAudio
▸ setAudio(audio
: any): void
Parameters:
Name | Type |
---|---|
audio |
any |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:83
setAudioEncodings
▸ setAudioEncodings(value
: AudioEncodingConfig[]): void
Sets the local audio encoding configurations. Audio encodings cannot be empty, so if you set an encoding with a null value or an empty array, this method creates an empty array with one AudioEncodingConfig in it.
If a new audio encodings array has the same number of encodings as the current one, the new audio encodings are applied to the local media’s audio track. Otherwise, an exception is thrown because the number of audio encodings cannot be changed once they are set.
Parameters:
Name | Type |
---|---|
value |
AudioEncodingConfig[] |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:397
setAudioGain
▸ setAudioGain(value
: number): void
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:306
setAudioLevelInterval
▸ setAudioLevelInterval(value
: number): void
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:310
setAudioMuted
▸ setAudioMuted(value
: boolean): void
Sets a value indicating whether the audio is muted. This method silences audio but does not disable the audio source or prevent its data from flowing through the processing pipeline. If there are multiple audio tracks in a custom media stack, this property is bound to the first audio track.
Parameters:
Name | Type |
---|---|
value |
boolean |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:288
setAudioSimulcastDisabled
▸ setAudioSimulcastDisabled(value
: boolean): void
Sets whether audio simulcast is disabled.
Parameters:
Name | Type |
---|---|
value |
boolean |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:420
setAudioSimulcastEncodingCount
▸ setAudioSimulcastEncodingCount(value
: number): void
Sets the maximum number of simulcast encodings that this media produces for the audio stream.
The number of encodings cannot be changed once they are set.
This property must be set before the media starts.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:434
setAudioSimulcastPreferredBitrate
▸ setAudioSimulcastPreferredBitrate(value
: number): void
Sets the preferred audio simulcast bitrate, in kbps. The bitrate must be a positive integer.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:448
setAudioVolume
▸ setAudioVolume(value
: number): void
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:319
setDynamicValue
▸ setDynamicValue(key
: string, value
: Object): void
Sets a property value in the local cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
value |
Object | The property value. This can be any object that needs to be stored for future use. |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:95
setId
▸ setId(value
: string): void
Sets the unique identifier of this media.
Parameters:
Name | Type |
---|---|
value |
string |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:319
setVideo
▸ setVideo(video
: any): void
Parameters:
Name | Type |
---|---|
video |
any |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:91
setVideoEncodings
▸ setVideoEncodings(value
: VideoEncodingConfig[]): void
Sets the local video encoding configurations. Video encodings cannot be empty, so if you set the value of this method to null or an empty array, an exception is thrown.
The number of video encodings cannot be changed once set. If the number of new video encodings is different from the existing number of video encodings, an error is thrown. If a new video encoding array has the same number of encodings as the current one, the encodings are applied to the media’s VP8, VP9, H.264, and H.265 controllers, converters, encoders, and packetizers.
For controllers which inherit from FrameRatePipe, that means setting controller.OutputSynchronizationSource to the encoding.SynchronizationSource. If the encoding.FrameRate is greater than zero, this sets the controller.MaxFrameRate and controller.TargetFrameRate to the encoding.FrameRate.
For converters which are the ImageScalePipe type, that means setting converter.MaxScale and converter.TargetScale to encoding.Scale, as long as encoding.Scale is greater than zero.
For encoders, if the encoder's output format is not a fixed bitrate and encoding.Bitrate is greater than zero, that means setting the encoder.MaxBitrate and encoder.TargetBitrate to encoding.Bitrate.
For packetizers, that means setting packetizer.Deactivated to encoding.Deactivated.
Parameters:
Name | Type |
---|---|
value |
VideoEncodingConfig[] |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:474
setVideoMuted
▸ setVideoMuted(value
: boolean): void
Sets a value indicating whether the video track is muted.
If the video track is muted, then remote users see a black frame instead of the local user’s video.
If there are multiple video tracks in a custom media stack, this property is bound to the first video track.
Parameters:
Name | Type |
---|---|
value |
boolean |
Returns: void
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:333
setVideoSimulcastBitsPerPixel
▸ setVideoSimulcastBitsPerPixel(value
: number): void
Sets the video simulcast bits per pixel (bpp). The bits per pixel value must be greater than or equal to zero.
If the video source has declared a target width, height, and frame rate, and VideoSimulcastBitsPerPixel has a set value, then the encoding bitrates are calculated with setVideoSimulcastBitsPerPixel’s value instead of the preferred bitrate.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:498
setVideoSimulcastDegradationPreference
▸ setVideoSimulcastDegradationPreference(value
: VideoDegradationPreference): void
Sets the video’s simulcast degradation preference.
The following degradation preferences can be set:
Automatic: Prefers to automate degradation based on video type. A Screen video type prefers to degrade FrameRate. A Camera video type prefers to degrade Resolution. An unknown video type prefers a Balanced approach.
Balanced: Prefers to degrade both FrameRate and Resolution together in smaller increments.
FrameRate: Prefers to degrade FrameRate instead of Resolution.
Resolution: Prefers to degrade Resolution instead of FrameRate.
Parameters:
Name | Type |
---|---|
value |
VideoDegradationPreference |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:515
setVideoSimulcastDisabled
▸ setVideoSimulcastDisabled(value
: boolean): void
Sets whether video simulcast is disabled. If true, video simulcast is disabled. If false, video simulcast is enabled.
Parameters:
Name | Type |
---|---|
value |
boolean |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:527
setVideoSimulcastEncodingCount
▸ setVideoSimulcastEncodingCount(value
: number): void
Sets the maximum number of simulcast encodings that this LocalMedia produces for the video stream. The default value is 2. For LiveSwitch Media Server, the maximum is 4 encodings. This property must be set before the LocalMedia starts.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:539
setVideoSimulcastPreferredBitrate
▸ setVideoSimulcastPreferredBitrate(value
: number): void
Sets the preferred bitrate of a video simulcast in Kbps. The bitrate must be a positive integer.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:552
start
▸ start(): Future<TLocalMedia>
Starts media track sources. This method does not take any parameters and executes asynchronously. Call this method when LocalMedia's state is New or Stopped. If you call this method when LocalMedia's state is not New or Stopped, then the Future returned by this method is rejected.
Returns: Future<TLocalMedia>
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:565
stop
▸ stop(): Future<TLocalMedia>
Stops media track sources. This method does not take any parameters and executes asynchronously. Call this method when LocalMedia has started. If you call this method when LocalMedia has not started, then the Future returned by this method is rejected.
Returns: Future<TLocalMedia>
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:615
unsetDynamicValue
▸ unsetDynamicValue(key
: string): boolean
Removes a property value from the local cache. Returns true if the value was removed and returns false otherwise.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
Returns: boolean
true
if the value was removed; otherwise, false
.
Inherited from: WebRtcMedia
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:122
getDefaultVideoBitsPerPixel
▸ Static
getDefaultVideoBitsPerPixel(): number
Gets the default bits-per-pixel for video.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:69
setDefaultVideoBitsPerPixel
▸ Static
setDefaultVideoBitsPerPixel(value
: number): void
Sets the default bits-per-pixel for video.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcLocalMediaBase.ts:82