|
@@ -80,6 +80,12 @@ export default {
|
|
|
if (stream) {
|
|
|
video.srcObject = stream;
|
|
|
video.play();
|
|
|
+ if (video.readyState !== 4 || !video.srcObject.active) {
|
|
|
+ this.$Message.error({
|
|
|
+ content: "摄像头没有正常启用",
|
|
|
+ duration: 5
|
|
|
+ });
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$Message.error("没有可用的视频流");
|
|
|
}
|
|
@@ -152,7 +158,7 @@ export default {
|
|
|
async getSnapShot() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
const video = this.$refs.video;
|
|
|
- if (video.readyState !== 4 && video.srcObject.active) {
|
|
|
+ if (video.readyState !== 4 || !video.srcObject.active) {
|
|
|
this.$Message.error({ content: "摄像头没有正常启用", duration: 5 });
|
|
|
reject("摄像头没有正常启用");
|
|
|
this.logout();
|