fix: improve camera access error handling and permission checks #28
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
onsuspend
event fires on media elements (like<video>
or<audio>
) when the browser intentionally pauses loading more data because it has enough buffered, or the browser chooses to suspend further data fetching temporarily.I can't test this well because my camera is built-in. I don't think we really have to worry about permissions being revoked during the exam. I suspect/assume that when revoking permissions during the exam will cause them to take effect after re-launching the environment.
The first permission check (when you start up the environment) only checks if the access wasn't granted. Thus giving a "denied" message. But on MacOS the camera permission state will start with "prompt". Although the permission already has been granted in development. If we want to change this behaviour I suspect that we need to reset those permissions when starting a new dev session.