Class: StageStream<T>
Base Class for common StageStream functionality
Type parameters
Name | Type |
---|---|
T | extends EventMap = never |
Hierarchy
-
TypedEmitter
<T
>↳
StageStream
Constructors
constructor
• new StageStream<T
>(track
, getStats?
)
Initializer for StageStream
Type parameters
Name | Type |
---|---|
T | extends EventMap = never |
Parameters
Name | Type | Description |
---|---|---|
track | MediaStreamTrack | Media stream track to be wrapped |
getStats? | GetStatsFunction | Optional callback override for WebRTC stats |
Overrides
TypedEmitter<T>.constructor
Properties
id
• id: string
isMuted
• isMuted: boolean
mediaStreamTrack
• mediaStreamTrack: MediaStreamTrack
streamType
• streamType: StreamType
Methods
cleanup
▸ cleanup(): void
Prevents the getStats closure from preventing garbage collection for
Returns
void
emit
▸ emit<E
>(event
, ...args
): void
Emit args for event E
Type parameters
Name | Type |
---|---|
E | extends string | number | symbol |
Parameters
Name | Type | Description |
---|---|---|
event | E | the event name |
...args | Parameters <T [E ]> | - |
Returns
void
Inherited from
TypedEmitter.emit
off
▸ off<E
>(event
, callback
): void
De-register a callback for event E
Type parameters
Name | Type |
---|---|
E | extends string | number | symbol |
Parameters
Name | Type | Description |
---|---|---|
event | E | the event to de-register the callback for |
callback | T [E ] | the callback to be de-registered |
Returns
void
Inherited from
TypedEmitter.off
on
▸ on<E
>(event
, callback
): void
Register a new callback for event E
Type parameters
Name | Type |
---|---|
E | extends string | number | symbol |
Parameters
Name | Type | Description |
---|---|---|
event | E | the event to register the callback for |
callback | T [E ] | the callback to be invoked for the event |
Returns
void
Inherited from
TypedEmitter.on
removeAllListeners
▸ removeAllListeners(): void
Remove all event listeners
Returns
void
Inherited from
TypedEmitter.removeAllListeners
requestRTCStats
▸ requestRTCStats(): Promise
<undefined
| RTCStatsReport
>
Get the RTC Stats report for this media source
Returns
Promise
<undefined
| RTCStatsReport
>
setGetStats
▸ setGetStats(getStats
): void
Used for setting the getStats call after publishing
Parameters
Name | Type | Description |
---|---|---|
getStats | GetStatsFunction | Callback for returning getStats callback |
Returns
void