dever il y a 5 ans
Parent
commit
5cd986cca5
1 fichiers modifiés avec 13 ajouts et 9 suppressions
  1. 13 9
      pages/dream/view/vodShort.vue

+ 13 - 9
pages/dream/view/vodShort.vue

@@ -5,7 +5,8 @@
 		
 				<video
 					:src="v.video"
-					preload
+					preload
+					:muted="muted"
 					show-play-btn="true"
 					controls="false"
 					v
@@ -24,7 +25,7 @@
 				<cover-image 
 				class="play" v-if="show_play" 
 				@tap="videoPlay"
-				src="../../../static/video/play.png"></cover-image>
+				src="../../static/video/play.png"></cover-image>
 				
 				<cover-view class="cover-view-left">
 					<text class="view-left-text">@{{ v.name }}</text>
@@ -41,19 +42,19 @@
 					<text class="right-follow">+</text>
 					<cover-image 
 					style="position:relative;top:-20upx;"
-					:src="up ? '../../../static/video/axc.png' : '../../../static/video/bed.png'" 
+					:src="up ? '../../static/video/axc.png' : '../../static/video/bed.png'" 
 					class="img-left" @click.stop="tapLove"></cover-image>
 					
 					<text class="right-text">1</text>
-					<cover-image src="../../../static/video/ay2.png" 
+					<cover-image src="../../static/video/ay2.png" 
 					style="height: 80upx;" class="img-left" @click.stop="tapMsg"></cover-image>
 					
 					<text class="right-text">10</text>
-					<cover-image src="../../../static/video/b6p.png" 
+					<cover-image src="../../static/video/b6p.png" 
 					style="height: 76upx;" class="img-left" @click.stop="tapShare"></cover-image>
 					
 					<text class="right-text">10</text>
-					<cover-image src="../../../static/video/changpian.png" class="musicIcon img">
+					<cover-image src="../../static/video/changpian.png" class="musicIcon img">
 					</cover-image>
 					
 					<cover-view class="progressBar" :animation="animationData" ></cover-view>
@@ -88,7 +89,8 @@ export default {
 			animationData: {},
 			times:null,
 			play: false,
-			show_play:false,
+			show_play:false,
+			muted: true,
 			current_index: 0
 		};
 	},
@@ -115,13 +117,15 @@ export default {
 			let video_id = this.item.text[this.current_index].order;
 			
 			if (play) {
-				console.log('播放视频',`video_${video_id}`);
+				console.log('播放视频',`video_${video_id}`);
+				this.muted = false;
 				this.videoCtx = uni.createVideoContext(`video_${video_id}`, this);
 				this.videoCtx.play();
 				this.show_play = false;
 				play = false;
 			} else {
-				console.log('暂停视频',`video_${video_id}`);
+				console.log('暂停视频',`video_${video_id}`);
+				this.muted = true;
 				this.videoCtx = uni.createVideoContext(`video_${video_id}`, this);
 				this.videoCtx.pause();
 				this.show_play = true;