Class ProducerMediaPaused

Service to handle the paused state of media for a producer.

ProducerMediaPaused

Handles the actions required when media is paused for a specified producer, including UI updates, participant state handling, and managing meeting display optimizations.

producerMediaPaused

Options to specify the producer and event details:

  • producerId {string}: The ID of the paused producer.
  • kind {string}: The type of media paused (e.g., "audio", "video").
  • name {string}: Name of the producer whose media is paused.
  • parameters {ProducerMediaPausedParameters}: Configuration and state parameters for the meeting.
    • activeSounds {string[]}: Active audio streams currently displayed.
    • meetingDisplayType {string}: Current meeting layout type (e.g., "media", "video").
    • meetingVideoOptimized {boolean}: Indicates if video is optimized.
    • participants {Participant[]}: List of all meeting participants.
    • oldSoundIds {string[]}: List of previously active audio stream IDs.
    • shared {boolean}: Indicates if the screen is currently shared.
    • shareScreenStarted {boolean}: Indicates if screen sharing has started.
    • updateMainWindow {boolean}: Specifies if the main display window should update.
    • hostLabel {string}: The label representing the host participant.
    • islevel {string}: The access level of the participant.
    • updateActiveSounds {Function}: Updates the list of active audio streams.
    • updateUpdateMainWindow {Function}: Updates the status of the main display window.
    • reorderStreams {Function}: Reorders media streams for optimized display.
    • prepopulateUserMedia {Function}: Preloads user media based on display needs.
    • reUpdateInter {Function}: Refreshes participant interactions on the UI.

Resolves when media pause handling is complete.

const options = {
producerId: '12345',
kind: 'audio',
name: 'Participant A',
parameters: {
activeSounds: ['Participant B'],
meetingDisplayType: 'video',
meetingVideoOptimized: false,
participants: [...],
oldSoundIds: ['Participant A'],
shared: false,
shareScreenStarted: false,
updateMainWindow: true,
hostLabel: 'Host',
islevel: '1',
updateActiveSounds: (sounds) => { ... },
updateUpdateMainWindow: (status) => { ... },
reorderStreams: ({ add, screenChanged, parameters }) => { ... },
prepopulateUserMedia: ({ name, parameters }) => { ... },
reUpdateInter: ({ name, add, force, parameters }) => { ... }
}
};

producerMediaPausedService.producerMediaPaused(options)
.then(() => console.log('Media pause handled'))
.catch(error => console.error('Error:', error));

Constructors

Methods

Constructors

Methods

  • Handles the event when media is paused for a producer.

    Parameters

    Returns Promise<void>

    A promise that resolves when the media paused handling is complete.

    This function handles the event when media is paused for a producer. It performs the following tasks:

    • Updates the parameters.
    • Iterates through participants and updates the UI based on their muted status and other conditions.
    • Handles meeting display type and optimizes the UI accordingly.
    • Manages audio media by updating the relevant participant's state.