Skip to content

Commit

Permalink
Force examples to run in https
Browse files Browse the repository at this point in the history
Since Chrome 47+, getUserMedia only works over https, so we force page
to run in https.
  • Loading branch information
auduno committed Dec 15, 2015
1 parent e42b0af commit c116b7e
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clm_video_responses.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
display : block;
}
</style>
<script>
// getUserMedia only works over https in Chrome 47+, so we redirect to https. Also notify user if running from file.
if (window.location.protocol == "file:") {
alert("You seem to be running this example directly from a file. Note that these examples only work when served from a server or localhost due to canvas cross-domain restrictions.");
} else if (window.location.hostname !== "localhost" && window.location.protocol !== "https:"){
window.location.protocol = "https";
}
</script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
8 changes: 8 additions & 0 deletions examples/caricature.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
margin-top : 0px;
}
</style>
<script>
// getUserMedia only works over https in Chrome 47+, so we redirect to https. Also notify user if running from file.
if (window.location.protocol == "file:") {
alert("You seem to be running this example directly from a file. Note that these examples only work when served from a server or localhost due to canvas cross-domain restrictions.");
} else if (window.location.hostname !== "localhost" && window.location.protocol !== "https:"){
window.location.protocol = "https";
}
</script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
8 changes: 8 additions & 0 deletions examples/clm_emotiondetection.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@
}

</style>
<script>
// getUserMedia only works over https in Chrome 47+, so we redirect to https. Also notify user if running from file.
if (window.location.protocol == "file:") {
alert("You seem to be running this example directly from a file. Note that these examples only work when served from a server or localhost due to canvas cross-domain restrictions.");
} else if (window.location.hostname !== "localhost" && window.location.protocol !== "https:"){
window.location.protocol = "https";
}
</script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
8 changes: 8 additions & 0 deletions examples/clm_genderdetection.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@
text-align : center;
}
</style>
<script>
// getUserMedia only works over https in Chrome 47+, so we redirect to https. Also notify user if running from file.
if (window.location.protocol == "file:") {
alert("You seem to be running this example directly from a file. Note that these examples only work when served from a server or localhost due to canvas cross-domain restrictions.");
} else if (window.location.hostname !== "localhost" && window.location.protocol !== "https:"){
window.location.protocol = "https";
}
</script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
8 changes: 8 additions & 0 deletions examples/facedeform.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
margin-top : 0px;
}
</style>
<script>
// getUserMedia only works over https in Chrome 47+, so we redirect to https. Also notify user if running from file.
if (window.location.protocol == "file:") {
alert("You seem to be running this example directly from a file. Note that these examples only work when served from a server or localhost due to canvas cross-domain restrictions.");
} else if (window.location.hostname !== "localhost" && window.location.protocol !== "https:"){
window.location.protocol = "https";
}
</script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
8 changes: 8 additions & 0 deletions examples/facesubstitution.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
text-align : center;
}
</style>
<script>
// getUserMedia only works over https in Chrome 47+, so we redirect to https. Also notify user if running from file.
if (window.location.protocol == "file:") {
alert("You seem to be running this example directly from a file. Note that these examples only work when served from a server or localhost due to canvas cross-domain restrictions.");
} else if (window.location.hostname !== "localhost" && window.location.protocol !== "https:"){
window.location.protocol = "https";
}
</script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
8 changes: 8 additions & 0 deletions face_deformation_video.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@
display : block;
}
</style>
<script>
// getUserMedia only works over https in Chrome 47+, so we redirect to https. Also notify user if running from file.
if (window.location.protocol == "file:") {
alert("You seem to be running this example directly from a file. Note that these examples only work when served from a server or localhost due to canvas cross-domain restrictions.");
} else if (window.location.hostname !== "localhost" && window.location.protocol !== "https:"){
window.location.protocol = "https";
}
</script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
8 changes: 8 additions & 0 deletions face_mask.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@
display : block;
}
</style>
<script>
// getUserMedia only works over https in Chrome 47+, so we redirect to https. Also notify user if running from file.
if (window.location.protocol == "file:") {
alert("You seem to be running this example directly from a file. Note that these examples only work when served from a server or localhost due to canvas cross-domain restrictions.");
} else if (window.location.hostname !== "localhost" && window.location.protocol !== "https:"){
window.location.protocol = "https";
}
</script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down

0 comments on commit c116b7e

Please sign in to comment.