Skip to content

sourceUpdate event handler for mutistream bot audio slot is not called #4849

Description

@MykolaRodin

Describe the bug
I add a mutistream bot is added to the meeting with several participants like this

const options: AddMediaOptions = {
      localStreams: this.localStreams,
      audioEnabled: true, // Enable audio streams
      videoEnabled: true, // Enable video streams
      remoteMediaManagerConfig: {
        video: {
          preferLiveVideo: true,
          initialLayoutId: 'myLayoutId',
          layouts: {
            DualPanePingPong: myLayout,
          },
        },
        audio: {
          numOfActiveSpeakerStreams: 1, // Single slot: trust it contains audio for current active speaker
          numOfScreenShareStreams: 1,
        },
      },
      additionalMediaOptions: {
        receiveVideo: true,
        receiveAudio: true,
        sendVideo: true,
        sendAudio: false,  // Bot is receive-only
      },
    };
    await this.meeting!.addMedia(options)

I subscribe to sourceUpdate event for audio like this:

private setupMediaEvents(meeting: Meeting): void {
    meeting.on('media:remoteAudio:created', (event: RemoteMediaGroup) => {

      const audioSlots = event.getRemoteMedia('unpinned') || event.getRemoteMedia('all') || [];

      audioSlots.forEach((slot: any, index: number) => {
        slot.on('sourceUpdate', (ev: any) => {
          this.log(`[AudioSlot ${index} sourceUpdate] state:${ev.state}, csi:${ev.csi}, memberId:${ev.memberId}`, 'info');
        });
      });
    });
}

The thing is that sourceUpdate event can be received for video panes but it cannot be received for audio slots. As result of it, I cannot see how I can distinguish the moment some audio slot starts channeling audio for a different person.

I tried to use a workaround - create just a single audio slot and use media:activeSpeakerChanged to distinguish the moment active speaker changes. But it happened that media:activeSpeakerChanged might arrive significantly later that the only audio slot starts channeling audio for a different participant.

I tried to use a different workaround - pin audio slot to use with receiver-requested policy (like video slots allow to do) but is did not work and the audio slot was still used by webex-js-sdk with active-speaker policy.

Thus, could you please clarify if sourceUpdate works for audio slots and how it can be used?

To Reproduce
Steps to reproduce the behavior:

  1. Create a multistream bot
  2. Subscribe to sourceUpdate event for audio slots
  3. Wait when several participants join the meeting and start talking
  4. Check if sourceUpdate event handler for audio slot is called

Expected behavior
sourceUpdate event handler for audio slot is called

Actual behavior
sourceUpdate handler for audio slot is NOT called

Platform (please complete the following information):

  • OS: MacOS
  • Browser: chrome
  • Version: 146.0.7680.178
  • Device Type Desktop

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions