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

switchVideoCameraCapture shouldn't stop the track unless really needed... #6046

Closed
MaZZly opened this issue Jan 22, 2024 · 1 comment · Fixed by ant-media/StreamApp#432
Closed
Assignees

Comments

@MaZZly
Copy link

MaZZly commented Jan 22, 2024

Short description

media_manager.js:

    switchVideoCameraCapture(streamId, deviceId, onEndedCallback) {
        //stop the track because in some android devices need to close the current camera stream
        if (this.localStream && this.localStream.getVideoTracks().length > 0) {
            var videoTrack = this.localStream.getVideoTracks()[0];
            videoTrack.stop();
        } else {
            Logger.warn("There is no video track in local stream");
        }

If this is only happening on "some Android devices", it should only stop the existing track on those...

Why stop the stream for all other clients where the bug would not appear...
Now there is a black screen in between when switching cameras, which is not nice UX.


Also, if we wanted to call setVideoCameraSource manually, e.g. to choose facingMode or similar, why is the same logic not applied there? I'm guessing the same bug happens there if the existing track is not stopped first...

Expected behavior

  • Only close the existing track if needed.
  • Also handle this on setVideoCameraSource

Actual behavior

  • Always closes existing track (even when not needed)
  • It never closes existing track when using setVideoCameraSource
@burak-58
Copy link
Contributor

Thank you @MaZZly for the feedback. I am taking this to plan to check.

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

Successfully merging a pull request may close this issue.

3 participants