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

How to judge the loss of video stream #162

Open
aixinaxc opened this issue Feb 16, 2021 · 1 comment
Open

How to judge the loss of video stream #162

aixinaxc opened this issue Feb 16, 2021 · 1 comment

Comments

@aixinaxc
Copy link

How to judge the loss of video stream?
When a browser video is closed, how do other browsers know that the video stream is closed?

@putrafajarh
Copy link

i hope this can help

stream.onremovetrack = () => {
    try {
        const i = this.streams.findIndex((stm) => stm.id === stream.id)
        if (i !== -1) {
            this.streams.splice(i, 1);
        }
    } catch (error) {
        console.error(error)
    }
}

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

2 participants