|
@@ -26,6 +26,7 @@
|
|
></image>
|
|
></image>
|
|
</view>
|
|
</view>
|
|
<view v-else>
|
|
<view v-else>
|
|
|
|
+ <video id="video" width="400" height="300" class="photo_v"></video>
|
|
<!-- v-if="playVID" -->
|
|
<!-- v-if="playVID" -->
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
<!-- #ifdef MP-WEIXIN -->
|
|
<view
|
|
<view
|
|
@@ -3601,16 +3602,14 @@ export default {
|
|
// this.isTaking = true
|
|
// this.isTaking = true
|
|
// this.photoPopup = true
|
|
// this.photoPopup = true
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
- console.log('video:', document);
|
|
|
|
- const video = document.getElementById("video");
|
|
|
|
|
|
+ const video = uni.createVideoContext('video')
|
|
// 将视频流设置为video元素的源
|
|
// 将视频流设置为video元素的源
|
|
console.log('video1:',video, 'stream:',stream);
|
|
console.log('video1:',video, 'stream:',stream);
|
|
video.srcObject = stream;
|
|
video.srcObject = stream;
|
|
- video.play();
|
|
|
|
this.mediaStreamTrack =
|
|
this.mediaStreamTrack =
|
|
typeof stream.stop === "function" ? stream : stream.getTracks()[0];
|
|
typeof stream.stop === "function" ? stream : stream.getTracks()[0];
|
|
console.log('mediaStreamTrack:', mediaStreamTrack);
|
|
console.log('mediaStreamTrack:', mediaStreamTrack);
|
|
- // video.play();
|
|
|
|
|
|
+ video.play();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
photographError(err) {
|
|
photographError(err) {
|