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

Video Analyzer doesn't work on http/default server settings #1621

Open
4 tasks done
hamishwillee opened this issue Sep 5, 2023 · 3 comments
Open
4 tasks done

Video Analyzer doesn't work on http/default server settings #1621

hamishwillee opened this issue Sep 5, 2023 · 3 comments

Comments

@hamishwillee
Copy link

hamishwillee commented Sep 5, 2023

  • I understand that issues created here are only relevant to the samples in this repo - not browser or SDK bugs
  • I have provided steps to reproduce
  • I have provided browser name and version
  • I have provided a link to the sample here or a modified version thereof

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed.

Browser affected

Firefox 119.0a1, Chrome

Description

Video Analyzer (and probably others) apply transforms to local media (i.e. webcam).
The webcam can only be requested in a secure context on all recent browsers, while http-server is not configured to work with https by default.

What this means is that you can't easily test the samples locally without modification.

The desired result is that is it is easy to try out these examples and that they reflect the current standards.

Steps to reproduce

Run src/content/insertable-streams/video-analyzer/ locally following the readme instructions.

Expected results

YOu are prompted to use webcam, then frame rates etc are reported.

Actual results

You will not be prompted to get access to webcam. The example effectively stalls since HTTPS does not work, you don't get the webcam, frames aren't provided.

I reset to the latest chrome and the example to latest gh-pages head revision and got this result on pressing the "Call" button.

image

@hamishwillee
Copy link
Author

hamishwillee commented Sep 5, 2023

When these samples were written, "localhost:" was treated as a trusted context by Chrome. Has that changed?

@alvestrand This is the bug spawned off #1620

I don't know "for sure" if Chrome is treating localhost as trusted, but it looks like not: https://chromestatus.com/feature/6269417340010496 - and that is how I interpret the fact that this works if I install a certificate and serve as HTTPS.

Edit: Note, the title was wrong/issue is not localhost - the issue is that the server does not allow testing in a secure context by default

@fippo
Copy link
Collaborator

fippo commented Sep 5, 2023

But you are running on 192.168.56.1 in the screenshot which isn't localhost? TypeError is what is returned when there is no navigator.mediaDevices which is only available when window.isSecureContext is true.

@hamishwillee hamishwillee changed the title Video Analyzer doesn't work on localhost Video Analyzer doesn't work on http/default server settings Sep 5, 2023
@hamishwillee
Copy link
Author

@fippo Apologies. The description was OK but the title is not. The issue is that the server test urls are all http - to test this you do need a secure context, so you can't test the samples out of the box.

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