Fix deprecated method in web demo.
This commit is contained in:
parent
cb0de2ce66
commit
0c07bba31e
|
@ -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.");
|
||||
|
|
Loading…
Reference in New Issue