xuqiaoying 2 年之前
父節點
當前提交
131ca5336e
共有 2 個文件被更改,包括 10 次插入11 次删除
  1. 7 7
      pages/index/index.vue
  2. 3 4
      pages3/polyv/detail.vue

+ 7 - 7
pages/index/index.vue

@@ -456,13 +456,13 @@ export default {
 	} else {
 		console.log('没有code');
 		// 没有code,就重定向到地址https://www.xyyxt.net?ask_type=h.xyyxt.net 去获取code,授权后就会把code带上然后访问域名,就拿到code了
-		if (!uni.getStorageSync('h5_code')) {
-			location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
-			return
-		} else {
-			// this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
-			// this.OfficialLogin()
-		}
+		// if (!uni.getStorageSync('h5_code')) {
+		// 	location.replace('https://www.xyyxt.net/?ask_type=h.xyyxt.net')
+		// 	return
+		// } else {
+		// 	// this.$set(this.optObj, 'code', uni.getStorageSync('h5_code'))
+		// 	// this.OfficialLogin()
+		// }
 	}
 	// #endif
     this.getInfo(); // 判断有没有关注公众号

+ 3 - 4
pages3/polyv/detail.vue

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