Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createLocalTracks with video device with exact id, exact constraint is not maintained on re-enabling camera #1316

Open
mdanilakis opened this issue Nov 18, 2024 · 0 comments

Comments

@mdanilakis
Copy link

Describe the bug

const video = {
  deviceId: { exact: "deviceId" },
};

const audio = { ... };

const tracks = await createLocalTracks({ video, audio });

Constraining the deviceId with exact on Track creation.

Expectation: internally getUserMedia is called with exact the first time, and should be called again on restart (e.g. unmute of camera).

What happens: internally getUserMedia is called with exact the first time, but on unmute the exact constraint is removed resulting in selecting a different video stream (from a different device) on unmute (tested in Chrome).

Where I think the issue is: https://github.com/livekit/client-sdk-js/pull/773/files

Why is the browser returning a different stream given it actually returned it correctly the first time: I don't know (this is where the whole getUserMedia madness starts).

Reproduction

  1. Create LocalTrack(s) using:
const video = {
  deviceId: { exact: "deviceId" },
};

const audio = { ... };

const tracks = await createLocalTracks({ video, audio });
  1. Verify correct camera feed
  2. Switch off camera e.g. localParticipat.setCameraEnabled(false)
  3. Switch on camera
  4. Camera feed is from a different device from the one specified in exact

Note: it happens under specific circumstances (hard to reproduce on some clients, reproducible with others - e.g. with a different set of devices).

Logs

No response

System Info

Mac OS, Chrome 130.0.6723.119, LiveKit Client 2.1.5

Severity

annoyance

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant