dever пре 5 година
родитељ
комит
7873ff0ed3
4 измењених фајлова са 58 додато и 13 уклоњено
  1. 1 1
      lib/dever/config.js
  2. 1 1
      pages/dream/view.vue
  3. 20 2
      pages/dream/view/vodComment.vue
  4. 36 9
      pages/dream/view/vodShort.vue

+ 1 - 1
lib/dever/config.js

@@ -7,7 +7,7 @@ const base = {
 const request = {
 	//	服务器接口地址
 
-	host: "http://192.168.33.10/dreamland/",
+	host: "http://192.168.2.70/dreamland/",
 	
 	//	请求的参数	
 	data: {},

+ 1 - 1
pages/dream/view.vue

@@ -3,7 +3,7 @@
 		<view class="container" slot="gBody">
 			<swiper class="swiper" @change="change" :circular="swiper.circular">
 				<swiper-item v-for="(v, k) in fetch.items" v-if="v.data">
-					<scroll-view scroll-y="true" class="scroll-height">
+					<scroll-view scroll-y="true" scroll-x="true" class="scroll-height">
 						<dream :item="v" :config="config" class="item"></dream>
 						<view class="page-num" v-if="swiper.index != -1">P{{swiper.index+1}}</view>
 					</scroll-view>

+ 20 - 2
pages/dream/view/vodComment.vue

@@ -3,7 +3,7 @@
 		<view class="topbanner">
 			<video
 				:src="item.video"
-				preload
+				preload="auto"
 				:show-play-btn="true"
 				:show-center-play-btn="false"
 				:controls="true"
@@ -15,9 +15,17 @@
 				ref="video_url"
 				play-btn-position="center"
 				class="video"
-				:poster="item.pic">
+				:x5-playsinline="true"
+				:playsinline="true"
+				:webkit-playsinline="true"
+				:x5-video-can-play-with-audio="true"
+				x5-video-orientation="portraint"
+				>
 			</video>
 			
+			<cover-image v-if="show_play_poster" class="poster" :src="item.pic">
+			</cover-image>
+			
 			<cover-image
 			class="ico-video-play" v-if="show_play" 
 			@tap="start"></cover-image>
@@ -62,6 +70,7 @@ export default {
 	},
 	data() {
 		return {
+			show_play_poster: true,
 			show_play: true,
 			videoCtx : false,
 			comments: [
@@ -87,6 +96,7 @@ export default {
 			return 'video_comment_' + video_id;
 		},
 		start : function()  {
+			this.show_play_poster = false;
 			this.config.stop[this.config.page] = this;
 			var id = this.id();
 			if (!this.videoCtx) {
@@ -126,6 +136,14 @@ export default {
 }
 .living{
   margin-bottom:50rpx;
+}
+.poster{
+	background-size: cover;
+	position: absolute;
+	left: 0;
+	top: 0;
+	width: 100%;
+	height: 100%;
 }
 .living-tabs{
   display: flex;

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

@@ -17,14 +17,21 @@
 					ref="video_url"
 					play-btn-position="center"
 					class="video"
-					:poster="v.pic"
-					@timeupdate="update">
+					:x5-playsinline="true"
+					:playsinline="true"
+					:webkit-playsinline="true"
+					:x5-video-can-play-with-audio="true"
+					x5-video-orientation="portraint"
+					
+					>
 				</video>
 				
-				<cover-image 
-				class="play" v-if="show_play" 
-				@tap="start"
-				src="@/static/icon/ico-video-play.png"></cover-image>
+				<cover-image v-if="show_play_poster" class="poster" :src="v.pic">
+				</cover-image>
+				
+				<cover-image
+				class="ico-video-play" v-if="show_play" 
+				@tap="start"></cover-image>
 				
 				<pos :item="v" :down="v.video"></pos>
 				
@@ -88,7 +95,8 @@ export default {
 			barWidth:0,
 			animationData: {},
 			times:null,
-			show_play:true,
+			show_play:true,
+			show_play_poster:true,
 			muted: true,
 			current_index: 0,
 			showInfo: false,
@@ -124,6 +132,7 @@ export default {
 			this.handle(false);
 		},
 		handle : function(state)  {
+			this.show_play_poster = false;
 			var id = this.id(this.current_index);
 			if (state) {
 				this.videoCtx = uni.createVideoContext(id, this);
@@ -188,7 +197,8 @@ export default {
 .swiper{
 	width: 100vw;
 	height: 100vh;	
-	position: fixed;
+	/*position: fixed;*/
+	position: relative;
 	top: 0;
 	left: 0;
 }
@@ -205,6 +215,14 @@ export default {
 	top: 40vh;
 	opacity: 0.5;
 }
+.poster{
+	background-size: cover;
+	position: absolute;
+	left: 0;
+	top: 0;
+	width: 100%;
+	height: 100%;
+}
 .progressBar {
 	border-radius: 2upx;
 	height: 4upx;
@@ -213,7 +231,16 @@ export default {
 	position: absolute;
 	bottom: 68rpx;
 }
-
+.ico-video-play{
+  background: url(@/static/icon/ico-video-play.png) no-repeat;
+  background-size: cover;
+  width: 100rpx;
+  height: 100rpx;
+  position: absolute;
+  left: 50%;
+  top: 50%;
+  transform: translate3d(-50%,-50%,0);
+}
 .cover-view-left {
 	position: absolute;
 	margin-left: 20upx;