|
@@ -38,6 +38,7 @@
|
|
type="primary"
|
|
type="primary"
|
|
v-if="isTaking"
|
|
v-if="isTaking"
|
|
class="take"
|
|
class="take"
|
|
|
|
+ :disabled="!successOpen"
|
|
@click="onPhoto"
|
|
@click="onPhoto"
|
|
>拍照</el-button
|
|
>拍照</el-button
|
|
>
|
|
>
|
|
@@ -67,6 +68,7 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ successOpen:false,//是否授权拍照
|
|
takePhotoModal: false,
|
|
takePhotoModal: false,
|
|
isTaking: true,
|
|
isTaking: true,
|
|
loading: false,
|
|
loading: false,
|
|
@@ -81,6 +83,11 @@ export default {
|
|
if (polyvPlayerContext) {
|
|
if (polyvPlayerContext) {
|
|
this.isFullScreen();
|
|
this.isFullScreen();
|
|
}
|
|
}
|
|
|
|
+ this.successOpen = false
|
|
|
|
+ this.faceUrl = "";
|
|
|
|
+ this.loading = false;
|
|
|
|
+ this.isTaking = true;
|
|
|
|
+ this.takePhotoModal = true;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
if (
|
|
if (
|
|
(window.navigator.mediaDevices &&
|
|
(window.navigator.mediaDevices &&
|
|
@@ -111,11 +118,11 @@ export default {
|
|
if (this.isVirtualCamera(stream)) {
|
|
if (this.isVirtualCamera(stream)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this.faceUrl = "";
|
|
|
|
- this.loading = false;
|
|
|
|
- this.isTaking = true;
|
|
|
|
- this.takePhotoModal = true;
|
|
|
|
-
|
|
|
|
|
|
+ // this.faceUrl = "";
|
|
|
|
+ // this.loading = false;
|
|
|
|
+ // this.isTaking = true;
|
|
|
|
+ // this.takePhotoModal = true;
|
|
|
|
+ this.successOpen = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
const video = document.getElementById("video");
|
|
const video = document.getElementById("video");
|
|
// 将视频流设置为video元素的源
|
|
// 将视频流设置为video元素的源
|