Service to handle closing a media producer and associated UI and state updates.
Name
ProducerMediaClosed
Description
Manages the closure of a media producer by identifying associated consumer transports, closing necessary resources,
and updating the user interface to reflect the change. For screen sharing, it resets the shared state and adjusts the main view.
Method
producerMediaClosed
Param: options
Contains details on the producer and parameters for state updates:
producerId {string}: ID of the producer to close.
kind {string}: The type of media to close (e.g., "screenshare" or "audio").
parameters {ProducerMediaClosedParameters}: Settings and update functions to manage the closure process.
consumerTransports {Transport[]}: List of active transports for consumers.
updateConsumerTransports {Function}: Updates the list of active consumer transports.
hostLabel {string}: Label of the host to revert to if screen sharing ends.
shared {boolean}: Indicates whether a screen is currently shared.
updateShared {Function}: Updates the shared screen state.
updateShareScreenStarted {Function}: Marks the start or end of screen sharing.
updateScreenId {Function}: Clears the screen ID when screen sharing ends.
updateShareEnded {Function}: Marks the end of screen sharing.
closeAndResize {Function}: Adjusts the screen display upon closing the media.
prepopulateUserMedia {Function}: Loads default media after screen sharing ends.
reorderStreams {Function}: Reorders streams to optimize layout when media is closed.
Returns
Resolves when all updates are complete and the producer closure is handled.
Service to handle closing a media producer and associated UI and state updates.
Name
ProducerMediaClosed
Description
Manages the closure of a media producer by identifying associated consumer transports, closing necessary resources, and updating the user interface to reflect the change. For screen sharing, it resets the shared state and adjusts the main view.
Method
producerMediaClosed
Param: options
Contains details on the producer and parameters for state updates:
producerId
{string}: ID of the producer to close.kind
{string}: The type of media to close (e.g., "screenshare" or "audio").parameters
{ProducerMediaClosedParameters}: Settings and update functions to manage the closure process.consumerTransports
{Transport[]}: List of active transports for consumers.updateConsumerTransports
{Function}: Updates the list of active consumer transports.hostLabel
{string}: Label of the host to revert to if screen sharing ends.shared
{boolean}: Indicates whether a screen is currently shared.updateShared
{Function}: Updates the shared screen state.updateShareScreenStarted
{Function}: Marks the start or end of screen sharing.updateScreenId
{Function}: Clears the screen ID when screen sharing ends.updateShareEnded
{Function}: Marks the end of screen sharing.closeAndResize
{Function}: Adjusts the screen display upon closing the media.prepopulateUserMedia
{Function}: Loads default media after screen sharing ends.reorderStreams
{Function}: Reorders streams to optimize layout when media is closed.Returns
Resolves when all updates are complete and the producer closure is handled.
Example
Remarks
This service performs the following steps:
closeAndResize
.