diff --git a/demos/web/index.html b/demos/web/index.html
index 761d84e..7abf4d3 100644
--- a/demos/web/index.html
+++ b/demos/web/index.html
@@ -217,10 +217,12 @@ limitations under the License.
$("#trainingChk").bootstrapToggle('off');
$("#peopleInVideo").html("");
- if (navigator.getUserMedia) {
- var videoSelector = {video : true};
- navigator.getUserMedia(videoSelector, umSuccess, function() {
- alert("Error fetching video from webcam");
+ if (navigator.mediaDevices.getUserMedia) {
+ var videoSelector = {video : true};
+ navigator.mediaDevices.getUserMedia(videoSelector)
+ .then(umSuccess)
+ .catch(function() {
+ alert("Error fetching video from webcam");
});
} else {
alert("No webcam detected.");