Handling the active-share-change event when one joins the channel after someone shared the screen

So for the rest of the users, they will get the share-content-change event and the user who was sharing the screen will get active-share-change event

@vk-jangid

Yes. That’s correct.

Thanks
Vic

Ok, thanks.
And what about this error and the console log?

Calling startShareView in the share-content-change event is throwing an error of Invalid operation.
is something different need to be done in this event?

@vk-jangid

It’s unnecessary to call the stream.startShareView in the share-content-change event, the Video SDK will update the shared content automatically.

Regard the event as a notification, you can pop an alert if the screen shared content changes.

Thanks
Vic

In my case, the content is not updating automatically.
Nothing is rendering on the canvas of the participant who started the screen share when someone already is sharing the screen.

@vk-jangid

Could you try our sample project? Is it still not able to render the shared content?

Thanks
Vic

I have multiple canvases for each participant, can this be a reason for the content not updating properly?

@vk-jangid

Canvas for shared content is different from the canvases for videos. Is there any error on the console?

Thanks
Vic

In my case, I have multiple canvases for screen share content for each participant.

@vk-jangid

It’s very likely that this is the cause of this issue. We suggest using the same canvas to serve the shared content.

Thanks
Vic

Hey @vic.yang
Please explain this error and the console log. This usually comes up after the startAudio call.

Also, just have one feature request about the mic state. Maintaining the mic state is an extra task and all other SDKs provide the mic and cam state in the user data.
So it would be better that we get the mic state in the user data.

As you mentioned that we can broadcast the microphone state, but if I refresh the page then how will I get the microphone state of the other participants because the command channel doesn’t give all the messages which were sent before refreshing?

Also, one more issue in the speakerOnly mode when sharing the screen with tab audio, in this case, the other participants weren’t able to hear the tab audio.

Hey @vk-jangid

This error usually occurs when the stream.startAudio() method is called twice, but the previous one is not resolved or rejected.

A way to share the microphone state:

  • If a participant connects or disconnects the microphone, he/she can broadcast the message via Command Channel.
  • If a participant joins a session or failover(refresh the page), he/she can send a private message via Command Channel to query the microphone state

Thanks
Vic

Hey @vk-jangid

It works on my side. Did you mute the share audio accidentally?

Thanks
Vic

Ok, may I ask why the mic state can’t be given in the muted key, just like for the cam there is a key of bVideoOn, and by this key, we can know the cam state of a user?

Because as I said most of the SDKs provide this data because this is very basic data that needs to be given.

Hey @vk-jangid

We have the audio property in the user state. It can tell whether the user joined the audio.

But that’s not enough, can not distinguish whether both microphone and speaker are connected or only the speaker is connected.

If you just want to know the audio state of a user, can use the audio property.

Thanks
Vic

I want to know the state where the user has his/her microphone on or off and for that audio property can’t help.

So, are you saying that after calling the startAudio function, you are not able to distinguish that both speaker and microphone is on or just the speaker is on?

Hey @vk-jangid

Currently, we don’t have a microphone state property to share among the participants. So as I mentioned above, you can use the Command Channel to achieve the function as a workaround.

We’d like to add this feature to our roadmap. But it may take some time to get it ready. Please stay tuned.

Thanks
Vic