steep-balloon-41261
07/18/2023, 1:49 PMpolite-kilobyte-67570
07/18/2023, 2:49 PMhigh-exabyte-20673
07/18/2023, 2:58 PMpolite-kilobyte-67570
07/18/2023, 3:01 PM@livekit/components-js example folder or the client-sdk-js example folder as a starting pointhigh-exabyte-20673
07/18/2023, 3:03 PMhigh-exabyte-20673
07/19/2023, 1:00 PMhigh-exabyte-20673
07/19/2023, 1:08 PMcreateLocalScreenTracks({ audio: true }) produces a video track that emits mute events and calls pauseUpstream
• room.localParticipant.createScreenTracks({ audio: true }) produces a video track that does not emit mute events
Looks like using the room.localParticipant.createScreenTracks is a way to go - the difference is still weird, though.polite-kilobyte-67570
07/19/2023, 1:52 PMmuted events on mediastreamtracks call pauseUpstream (note that muted events are generally reserved for browsers to notify that the track cannot produce any data currently).
Even more interestingly, chrome seems to emit the mute event only if the web page does not have interactive content displayed (e.g. the mute event does not get emitted if you share a tab with a youtube video playing).
Thanks for the report, we’ll have to think about how to address this properly. It’s unclear to me however why createLocalScreenTracks and localParticipant.createScreenTracks would show a different behaviour. Did you share the exact same tab when you compared the behaviour?
cc @dry-elephant-14928high-exabyte-20673
07/19/2023, 1:55 PMcreateLocalScreenTracks gets muted, and the one created with localParticipant.createScreenTracks doesn’t get muted.high-exabyte-20673
07/19/2023, 1:56 PMpolite-kilobyte-67570
07/19/2023, 1:56 PMscreenShareCaptureOptions that you pass in ?high-exabyte-20673
07/19/2023, 1:56 PMconst tracks = await room.localParticipant.createScreenTracks({ audio: true })high-exabyte-20673
07/19/2023, 1:59 PM// localParticipant.createScreenTracks
{
audio: options.audio ?? false,
video: videoConstraints,
// @ts-expect-error support for experimental display media features
controller: options.controller,
selfBrowserSurface: options.selfBrowserSurface,
surfaceSwitching: options.surfaceSwitching,
systemAudio: options.systemAudio,
}
vs
// createLocalScreenTracks
{
audio: options.audio ?? false,
video: videoConstraints,
}polite-kilobyte-67570
07/19/2023, 2:36 PMframeRate on videoConstraints seems to fix the problem also in createLocalScreenShareTracks.
I’ll open a PR with the fix, but I guess we’ll have to evaluate whether calling pauseUpstream is the right move on mediastreamtrack.muted - in the case of the screen share track it seems to make more sense to display the frozen frame than signalling a track muted event to remote participants.high-exabyte-20673
07/19/2023, 2:38 PM