Fix deprecated method in web demo.

This commit is contained in:
Lex Toumbourou 2018-06-08 10:42:07 +10:00 committed by Brandon Amos
parent cb0de2ce66
commit 0c07bba31e
1 changed files with 6 additions and 4 deletions

View File

@ -217,10 +217,12 @@ limitations under the License.
$("#trainingChk").bootstrapToggle('off'); $("#trainingChk").bootstrapToggle('off');
$("#peopleInVideo").html(""); $("#peopleInVideo").html("");
if (navigator.getUserMedia) { if (navigator.mediaDevices.getUserMedia) {
var videoSelector = {video : true}; var videoSelector = {video : true};
navigator.getUserMedia(videoSelector, umSuccess, function() { navigator.mediaDevices.getUserMedia(videoSelector)
alert("Error fetching video from webcam"); .then(umSuccess)
.catch(function() {
alert("Error fetching video from webcam");
}); });
} else { } else {
alert("No webcam detected."); alert("No webcam detected.");