This message was deleted.
# helpdesk
s
This message was deleted.
p
hi! in order to debug this I would 1. check if you have the same experience on meet.livekit.io 2. if not, try to create a minimal example that reproduces the issue
h
@polite-kilobyte-67570 I can no longer find livekit playground page. Is it disabled?
p
yeah, we do not have the playground anymore. you can use the custom tab on meet.livekit.io instead. for generating a minimal reproduction, you can use
@livekit/components-js
example folder or the
client-sdk-js
example folder as a starting point
h
Thanks
@polite-kilobyte-67570 I created this playground https://replit.com/@burzomir/Screen-Sharing-Mute-Behavior It will log mute and unmute events as you focus/unfocus different Chrome tabs. In my application when the muted event is emitted LiveKit calls pauseUpstream. But at meet.livekit.io and in the example app from client-sdk-js it doesn’t. I can’t figure out why though. Any suggestions?
@polite-kilobyte-67570 I figured out that •
createLocalScreenTracks({ 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.
p
interesting. We recently did change behaviour there so that
muted
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-14928
h
@polite-kilobyte-67570 Yes, I used the same tab. As you said, when a video is played on YT, it doesn’t get muted. But if there is no video played yet screen share created with
createLocalScreenTracks
gets muted, and the one created with
localParticipant.createScreenTracks
doesn’t get muted.
Maybe it is because different constraint objects are used
p
can you share your
screenShareCaptureOptions
that you pass in ?
h
const tracks = await room.localParticipant.createScreenTracks({ audio: true })
🤔 1
Copy code
// 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
Copy code
// createLocalScreenTracks
{
    audio: options.audio ?? false,
    video: videoConstraints,
 }
p
I was able to reproduce this. you are right, it seems like the passed constraints do make a difference, in particular setting a
frameRate
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.
h
@polite-kilobyte-67570 Thanks for info. “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” - that was exactly the issue in my project, there should be a frozen frame instead of no screen share at all.