-
Notifications
You must be signed in to change notification settings - Fork 16
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
Should we add reasons to MediaStreamTrack.onended #143
Comments
I'm supportive of this, and even more so of |
Some various reasons for failure:
The first two reasons might be somehow discoverable via permissions API and devicechange/enumerateDevices. |
Automatic recovery by the user agent is not ideal, but the web page should be able to, depending on their use case. For my use case, it seems incredibly common to have a USB cable yanked out causing the "device disappeared" scenario for a split second. When this happens, it makes sense to attempt to get the stream again after a few seconds pass, and start recording again. This behavior is specific to the application. |
As a rule, I don't find the argument of "also discoverable through x" as convincing, because that often requires that the app iterate through an arbitrary number of disparate potential reasons and their matching detection mechanisms. It's also not future-proof for when new potential reasons are discovered. Contrast that with: switch (reason) {
case 'reason1':
doSomethingAboutReason1();
break;
case 'reason2':
doSomethingAboutReason2();
break;
case 'reason3':
// Known to be inactionable; ignore.
break;
default:
// Log to the server that a new reason was encountered
// in the wild. This will issue an alert and get a developer
// to examine this and decide if it deserves its own handling,
// or if it needs to be explicitly ignored.
logNewReason(reason);
break;
}
I think it's likely that some apps would want to experiment with showing a toast notification, in case the user closed the shared tab/window unintentionally. (It's been known to happen.) |
Websites might have to react upon capture ended events.
Providing some reasons might help web sites decide whether they should call getUserMedia again to recover.
The text was updated successfully, but these errors were encountered: