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');
$("#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.");