我正在尝试在android浏览器中运行tracking.js,但它不起作用(在我的PC浏览器中,它可以正常运行,例如chrome等),首先我在想它不受android浏览器的支持tracking.js,但是当我打开网址https://trackingjs.com/examples/face_camera.html时,它可以工作,因此受支持,我也复制了该示例,但它不起作用。
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>tracking.js - face with camera</title>
<script src="./build/tracking-min.js"></script>
</head>
<body>
<div class="demo-frame">
<div class="demo-container">
<video id="video" width="320" height="240" preload autoplay loop
muted></video>
<canvas id="canvas" width="320" height="240"></canvas>
</div>
</div>
<script>
window.onload = function() {
var video = document.getElementById('video');
var canvas = document.getElementById('canvas');
var tracker = new tracking.ObjectTracker('face');
tracker.setInitialScale(4);
tracker.setStepSize(2);
tracker.setEdgesDensity(0.1);
tracking.track('#video', tracker, { camera: true });
};
</script>
</body>
</html>
致谢