-
Notifications
You must be signed in to change notification settings - Fork 194
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
base: master
Are you sure you want to change the base?
Conversation
limhenry
commented
Jan 13, 2017
- Force reload to https since it's required by the camera API
- Update Google Font to https
- 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:'){ |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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:';
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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;
There was a problem hiding this 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