@@ -79,8 +79,9 @@ export default {
});
if (stream) {
video.srcObject = stream;
- video.play();
- if (video.readyState !== 4 || !video.srcObject.active) {
+ try {
+ await video.play();
+ } catch (error) {
this.$Message.error({
content: "摄像头没有正常启用",
duration: 5