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

Make this demo works again #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

limhenry
Copy link

  1. Force reload to https since it's required by the camera API
  2. Update Google Font to https
  3. Fix image not showing after pressing the "Snapshot" button

1. Force reload to https since it's required by the camera API
2. Update Google Font to https
3. Fix image not showing after pressing the "Snapshot" button
@@ -154,6 +154,12 @@
</article>
<canvas id="photo" style="display:none"></canvas>
<script>


if (location.protocol != 'https:'){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (location.protocol !== 'https:') {



if (location.protocol != 'https:'){
location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would work:

location.protocol = 'https:';

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. this is actually better :)

@@ -227,9 +233,12 @@
intervalId = null;
return;
}

document.getElementById("monitor").height = video.videoHeight;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cache and dry it up:

const monitor = document.getElementById('monitor');
monitor.height = video.videoHeight;
monitor.width = video.videoWidth;

Copy link
Author

@limhenry limhenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah looks good to me :) haha

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

Successfully merging this pull request may close these issues.

2 participants