Id of the peer that owns this producer.
The underlying mediasoup producer to wrap.
Protected Readonly_The wrapped mediasoup producer/consumer handle.
ReadonlypeerId of the peer this entity belongs to.
ReadonlyroleAlways "producer".
Whether the entity has been closed.
The underlying entity's id.
The media kind ("audio" or "video").
Whether the entity is currently paused.
Id of the transport this producer sends on, or undefined for a producer
that was piped in from another router via pipeToRouter (which has no
client-facing transport of its own).
Closes the entity and releases its resources. Idempotent: safe to call multiple times, and MediaEntityEvent.Closed is emitted only once.
Synchronously invokes every listener registered for event, in registration order.
true if at least one listener was invoked, false if there were none.
The listener list is snapshotted before dispatch, so mutations made by handlers take effect only on subsequent emissions. Listeners are isolated: if one throws, the remaining listeners still run and the error is surfaced via console.error rather than swallowed silently (consistent with LocalMessageBus).
Returns the number of listeners currently registered for event.
The event name to count listeners for.
The count of registered listeners (0 if none).
Registers a listener that is invoked at most once: it is removed automatically before
being called the first time event is emitted.
This emitter, for chaining.
Remove a pending one-time listener by passing the same function reference to off.
Pauses the entity. No-op if already closed or paused.
Emits MediaEntityEvent.Paused when a pause actually occurs.
Removes listeners for a single event, or for all events.
Optionalevent: keyof MediaEntityEventsThe event name to clear; if omitted, listeners for every event are removed.
This emitter, for chaining.
Resumes the entity. No-op if closed or not paused.
Emits MediaEntityEvent.Resumed when a resume actually occurs.
Server-side (mediasoup SFU) representation of a track a peer is sending into a MediaRouter. Wraps a mediasoup
Producerand exposes the shared lifecycle from MediaEntity (pause/resume/close and events).