msgbyte / tailchat

Next generation noIM application in your own workspace, not only another Slack/Discord/Rocket.chat
https://tailchat.msgbyte.com/
Apache License 2.0
2.85k stars 308 forks source link

wrong SimulcastLayers order for livekit plugin? #248

Open kingins opened 1 month ago

kingins commented 1 month ago

5d1a5a1faec7ef16c4f32637320b134a

reference: https://docs.livekit.io/client-sdk-js/interfaces/trackpublishdefaults.html

the description in livekit-client API document says it should be ordered from low quality to high quality, but the code in livekit plugin is the opposite.

code is here: server/plugins/com.msgbyte.livekit/web/plugins/com.msgbyte.livekit/src/components/ActiveRoom.tsx:50

  const roomOptions = useMemo((): RoomOptions => {
    return {
      videoCaptureDefaults: {
        deviceId: userChoices.videoDeviceId ?? undefined,
        resolution: hq === true ? VideoPresets.h2160 : VideoPresets.h720,
      },
      publishDefaults: {
        videoSimulcastLayers:
          hq === true
            ? [VideoPresets.h1080, VideoPresets.h720]  // here
            : [VideoPresets.h720, VideoPresets.h540, VideoPresets.h216],  // here
        screenShareSimulcastLayers:
          hq === true
            ? [ScreenSharePresets.h1080fps15, ScreenSharePresets.h720fps5]  // here
            : [ScreenSharePresets.h720fps5, ScreenSharePresets.h360fps3],  // here
      },
      audioCaptureDefaults: {
        deviceId: userChoices.audioDeviceId ?? undefined,
      },
      adaptiveStream: { pixelDensity: 'screen' },
      dynacast: true,
    };
  }, [userChoices, hq]);

also the hq variable seems always to be false

moonrailgun commented 1 month ago

idk because i just reference with official demo.

https://github.com/livekit-examples/meet/blob/84c6151e4bf6472f22fa0e7376857bbf6dcfaea1/pages/rooms/%5Bname%5D.tsx#L133

did you found somthing different in real use?

kingins commented 1 month ago

idk because i just reference with official demo.

https://github.com/livekit-examples/meet/blob/84c6151e4bf6472f22fa0e7376857bbf6dcfaea1/pages/rooms/%5Bname%5D.tsx#L133

did you found somthing different in real use?

it's likely that these params didn't take effect because I changed these codes here hoping to start a 60fps screen sharing and found it doesn't work. It seems that the config is overwritten here in the livekit client: image

The frame rate sharing is always15fps. I also found the debug info in the console that shows the default 15fps becomes a constraint: image

BTW, I found that I can't see the members in a livekit room before joining when using self-compiled docker image without any changes (v1.11.6 release tag). But this is ok yesterday when I was using the image pulled from the docker registry.

moonrailgun commented 1 month ago

feel free to send a PR to help us improve code.

BTW, I found that I can't see the members in a livekit room before joining when using self-compiled docker image without any changes (v1.11.6 release tag). But this is ok yesterday when I was using the image pulled from the docker registry.

i dont think its has different between official docker image and source code because its auto build by github action. its maybe others reason