/ fm / liveswitch / WebRtcMedia
Class: WebRtcMedia<TAudioTrack, TVideoTrack>
fm.liveswitch.WebRtcMedia
Type parameters
Name | Type |
---|---|
TAudioTrack |
WebRtcAudioTrack |
TVideoTrack |
WebRtcVideoTrack |
Hierarchy
WebRtcMediaBase<WebRtcAudioTrack, WebRtcVideoTrack>
↳ WebRtcMedia
Implements
Table of contents
Constructors
Properties
Methods
- _setAudioMediaStream
- _setVideoMediaStream
- addOnAudioDestroyed
- addOnAudioLevel
- addOnVideoDestroyed
- addOnVideoSize
- addOnVideoSizeChange
- destroy
- destroyAudioContext
- dontUseAudioSink
- getAudio
- getAudioGain
- getAudioLevelInterval
- getAudioMuted
- getAudioSink
- getAudioTrack
- getAudioTracks
- getAudioVolume
- getDynamicProperties
- getDynamicValue
- getId
- getTypeString
- getVideo
- getVideoMuted
- getVideoSink
- getVideoSize
- getVideoTrack
- getVideoTracks
- getView
- getViewSink
- grabVideoFrame
- initializeAudioContext
- raiseOnVideoSize
- removeOnAudioDestroyed
- removeOnAudioLevel
- removeOnVideoDestroyed
- removeOnVideoSize
- removeOnVideoSizeChange
- setAudio
- setAudioGain
- setAudioLevelInterval
- setAudioMuted
- setAudioVolume
- setDynamicValue
- setId
- setVideo
- setVideoMuted
- tryAttachVideoSizeEvents
- unsetDynamicValue
Constructors
constructor
+ new WebRtcMedia<TAudioTrack, TVideoTrack>(external
: any): WebRtcMedia<TAudioTrack, TVideoTrack>
Type parameters:
Name | Type |
---|---|
TAudioTrack |
WebRtcAudioTrack<TAudioTrack> |
TVideoTrack |
WebRtcVideoTrack<TVideoTrack> |
Parameters:
Name | Type |
---|---|
external |
any |
Returns: WebRtcMedia<TAudioTrack, TVideoTrack>
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:133
Properties
_tryUseAudioWorklet
• Private
_tryUseAudioWorklet: boolean= true
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:333
_useAudioSink
• Private
_useAudioSink: boolean= true
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:328
Methods
_setAudioMediaStream
▸ Protected
_setAudioMediaStream(audioMediaStream
: MediaStream): boolean
Parameters:
Name | Type |
---|---|
audioMediaStream |
MediaStream |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:24
_setVideoMediaStream
▸ Protected
_setVideoMediaStream(videoMediaStream
: MediaStream): boolean
Parameters:
Name | Type |
---|---|
videoMediaStream |
MediaStream |
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:49
addOnAudioDestroyed
▸ addOnAudioDestroyed(value
: IAction0): void
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:164
addOnAudioLevel
▸ addOnAudioLevel(value
: IAction1<number>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<number> |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:177
addOnVideoDestroyed
▸ addOnVideoDestroyed(value
: IAction0): void
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:167
addOnVideoSize
▸ addOnVideoSize(value
: IAction1<Size>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<Size> |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:181
addOnVideoSizeChange
▸ addOnVideoSizeChange(value
: IAction1<Size>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<Size> |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:185
destroy
▸ destroy(): void
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:216
destroyAudioContext
▸ Protected
destroyAudioContext(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:444
dontUseAudioSink
▸ dontUseAudioSink(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:329
getAudio
▸ getAudio(): any
Returns: any
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:80
getAudioGain
▸ getAudioGain(): number
Returns: number
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:220
getAudioLevelInterval
▸ getAudioLevelInterval(): number
Returns: number
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
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
Implementation of: IInternalMedia
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:110
getAudioSink
▸ getAudioSink(): WebRtcDomAudioSink
Returns: WebRtcDomAudioSink
Implementation of: IInternalMedia
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
Implementation of: IInternalMedia
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:125
getAudioTracks
▸ getAudioTracks(): WebRtcAudioTrack[]
Returns: WebRtcAudioTrack[]
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:227
getAudioVolume
▸ getAudioVolume(): number
Returns: number
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
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: WebRtcMediaBase
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: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:58
getId
▸ getId(): string
Gets the unique identifier of this media.
Returns: string
Implementation of: IInternalMedia
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:160
getTypeString
▸ getTypeString(): string
Returns: string
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:5
getVideo
▸ getVideo(): any
Returns: any
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:88
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
Implementation of: IInternalMedia
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:174
getVideoSink
▸ getVideoSink(): WebRtcDomVideoSink
Returns: WebRtcDomVideoSink
Implementation of: IInternalMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:257
getVideoSize
▸ getVideoSize(): Size
Returns: Size
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
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
Implementation of: IInternalMedia
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:196
getVideoTracks
▸ getVideoTracks(): WebRtcVideoTrack[]
Returns: WebRtcVideoTrack[]
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:245
getView
▸ getView(): HTMLElement
Returns: HTMLElement
Implementation of: IInternalMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:263
getViewSink
▸ getViewSink(): WebRtcDomVideoSink
Returns: WebRtcDomVideoSink
Implementation of: IInternalMedia
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:269
grabVideoFrame
▸ grabVideoFrame(): Future<VideoBuffer>
Returns: Future<VideoBuffer>
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:275
initializeAudioContext
▸ Protected
initializeAudioContext(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:334
raiseOnVideoSize
▸ Private
raiseOnVideoSize(width
: number, height
: number): void
Parameters:
Name | Type |
---|---|
width |
number |
height |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:205
removeOnAudioDestroyed
▸ removeOnAudioDestroyed(value
: IAction0): void
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:170
removeOnAudioLevel
▸ removeOnAudioLevel(value
: IAction1<number>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<number> |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:294
removeOnVideoDestroyed
▸ removeOnVideoDestroyed(value
: IAction0): void
Parameters:
Name | Type |
---|---|
value |
IAction0 |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:173
removeOnVideoSize
▸ removeOnVideoSize(value
: IAction1<Size>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<Size> |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:300
removeOnVideoSizeChange
▸ removeOnVideoSizeChange(value
: IAction1<Size>): void
Parameters:
Name | Type |
---|---|
value |
IAction1<Size> |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:303
setAudio
▸ setAudio(audio
: any): void
Parameters:
Name | Type |
---|---|
audio |
any |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:83
setAudioGain
▸ setAudioGain(value
: number): void
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:306
setAudioLevelInterval
▸ setAudioLevelInterval(value
: number): void
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
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
Implementation of: IInternalMedia
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:288
setAudioVolume
▸ setAudioVolume(value
: number): void
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Implementation of: IInternalMedia
Overrides: WebRtcMediaBase
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: WebRtcMediaBase
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
Implementation of: IInternalMedia
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:319
setVideo
▸ setVideo(video
: any): void
Parameters:
Name | Type |
---|---|
video |
any |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:91
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
Implementation of: IInternalMedia
Inherited from: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMediaBase.ts:333
tryAttachVideoSizeEvents
▸ Private
tryAttachVideoSizeEvents(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/WebRtcMedia.ts:189
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: WebRtcMediaBase
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:122