Commit 28e3b7d7 authored by Mac's avatar Mac

全屏问题解决

parent 49d3b3dc
...@@ -26,6 +26,7 @@ Page({ ...@@ -26,6 +26,7 @@ Page({
videoContext:'', videoContext:'',
playVideoSrc:'', playVideoSrc:'',
videoState: false, videoState: false,
videoState_t:false
}, },
videoContext: null, videoContext: null,
...@@ -69,17 +70,35 @@ Page({ ...@@ -69,17 +70,35 @@ Page({
msg:msg msg:msg
}) })
}, },
bindPreviewVideo(e) { bindPreviewVideo(e) {
let playVideoSrc =this.data.msg.VideoAddress; let playVideoSrc = this.data.msg.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video'); this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.play();
this.videoContext.requestFullScreen({ direction: 0 });
this.setData({ this.setData({
videoState: true, videoState: true,
playVideoSrc: playVideoSrc playVideoSrc: playVideoSrc
}) })
this.videoContext.play();
},
/**视屏进入、退出全屏 */
fullScreen(e) {
var isFull = e.detail.fullScreen;
//视屏全屏时显示加载video,非全屏时,不显示加载video
this.setData({
videoState: isFull
})
if (isFull == false) {
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.pause();
this.videoContext.exitFullScreen();
}
},
bindwaiting(e) {
console.log(e)
}, },
bindVideoScreenChange: function ( e) { bindVideoScreenChange: function ( e) {
var status = e.detail.fullScreen; var status = e.detail.fullScreen;
......
<view hidden="{{videoState}}" class="clock"> <view hidden="{{videoState_t}}" class="clock">
<view style="padding:30rpx;position:relative"> <view style="padding:30rpx;position:relative">
<image style="width:70rpx;height:70rpx;position: absolute;" src="../../images/index/adress.png"></image> <image style="width:70rpx;height:70rpx;position: absolute;" src="../../images/index/adress.png"></image>
<view class="title"> <view class="title">
...@@ -45,11 +45,11 @@ ...@@ -45,11 +45,11 @@
<view class="hr"></view> <view class="hr"></view>
<view bindtap="tiJiao" class="sumbitBtn">提交</view> <view bindtap="tiJiao" class="sumbitBtn">提交</view>
</view> </view>
<view hidden="{{!videoState}}" class="video_box"> <view class='{{videoState?"show":"hide"}}' >
<video id="prew_video" <video id="prew_video"
autoplay="true" src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen" bindfullscreenchange="fullScreen"
show-fullscreen-btn="fasle" autoplay="true"
src="{{playVideoSrc}}"></video> loop='true'
<image bindtap="closeVideo" class="closeImg" src="../../images/index/close.png"></image> ></video>
</view> </view>
\ No newline at end of file
...@@ -97,4 +97,10 @@ ...@@ -97,4 +97,10 @@
height: 40rpx; height: 40rpx;
right: -20rpx; right: -20rpx;
top: -20rpx; top: -20rpx;
}
.show{
display:show;
}
.hide{
display:none;
} }
\ No newline at end of file
...@@ -40,16 +40,34 @@ Page({ ...@@ -40,16 +40,34 @@ Page({
this.videoContext.pause(); this.videoContext.pause();
}, },
bindPreviewVideo(e) { bindPreviewVideo(e) {
console.log("eee",e);
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress; let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction:0});
this.setData({ this.setData({
videoState: true, videoState: true,
playVideoSrc: playVideoSrc playVideoSrc: playVideoSrc
}) })
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.play(); this.videoContext.play();
}, },
/**视屏进入、退出全屏 */
fullScreen(e) {
var isFull = e.detail.fullScreen;
//视屏全屏时显示加载video,非全屏时,不显示加载video
this.setData({
videoState: isFull
})
if (isFull == false) {
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.pause();
this.videoContext.exitFullScreen();
}
},
bindwaiting(e){
console.log(e)
},
modeImg(e) { modeImg(e) {
let img = e.currentTarget.dataset.item.ImgList; let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({ wx.previewImage({
......
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
<view wx:else style="padding-top:280rpx;text-align:center"> <view wx:else style="padding-top:280rpx;text-align:center">
<image style="width:438rpx;height:215rpx" src="../../images/index/nodata.png"></image> <image style="width:438rpx;height:215rpx" src="../../images/index/nodata.png"></image>
</view> </view>
<view hidden="{{!videoState}}" class="video_box"> <view class='{{videoState?"show":"hide"}}' >
<video id="prew_video" <video id="prew_video"
show-fullscreen-btn="fasle" src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen" bindfullscreenchange="fullScreen"
src="{{playVideoSrc}}"></video> autoplay="true"
<image bindtap="closeVideo" class="closeImg" src="../../images/index/close.png"></image> loop='true'
></video>
</view> </view>
\ No newline at end of file
...@@ -52,4 +52,10 @@ ...@@ -52,4 +52,10 @@
height:50rpx; height:50rpx;
background:linear-gradient(180deg,rgba(255,49,102,0.3),rgba(255,49,102,0.05)); background:linear-gradient(180deg,rgba(255,49,102,0.3),rgba(255,49,102,0.05));
border-radius:2rpx; border-radius:2rpx;
}
.show{
display:show;
}
.hide{
display:none;
} }
\ No newline at end of file
...@@ -47,14 +47,33 @@ Page({ ...@@ -47,14 +47,33 @@ Page({
}, },
bindPreviewVideo(e) { bindPreviewVideo(e) {
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress; let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction: 0 });
this.setData({ this.setData({
videoState: true, videoState: true,
playVideoSrc: playVideoSrc playVideoSrc: playVideoSrc
}) })
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.play(); this.videoContext.play();
}, },
/**视屏进入、退出全屏 */
fullScreen(e) {
var isFull = e.detail.fullScreen;
//视屏全屏时显示加载video,非全屏时,不显示加载video
this.setData({
videoState: isFull
})
if (isFull == false) {
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.pause();
this.videoContext.exitFullScreen();
}
},
bindwaiting(e) {
console.log(e)
},
modeImg1(e) { modeImg1(e) {
let img = e.currentTarget.dataset.item.ImgList; let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({ wx.previewImage({
......
...@@ -48,10 +48,11 @@ ...@@ -48,10 +48,11 @@
</view> </view>
</view> </view>
</view> </view>
<view hidden="{{!videoState}}" class="video_box"> <view class='{{videoState?"show":"hide"}}' >
<video id="prew_video" <video id="prew_video"
show-fullscreen-btn="fasle" src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen" bindfullscreenchange="fullScreen"
src="{{playVideoSrc}}"></video> autoplay="true"
<image bindtap="closeVideo" class="closeImg" src="../../../images/index/close.png"></image> loop='true'
></video>
</view> </view>
\ No newline at end of file
...@@ -78,4 +78,10 @@ ...@@ -78,4 +78,10 @@
line-height:90rpx; line-height:90rpx;
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
}
.show{
display:show;
}
.hide{
display:none;
} }
\ No newline at end of file
...@@ -47,14 +47,33 @@ Page({ ...@@ -47,14 +47,33 @@ Page({
}, },
bindPreviewVideo(e) { bindPreviewVideo(e) {
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress; let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction: 0 });
this.setData({ this.setData({
videoState: true, videoState: true,
playVideoSrc: playVideoSrc playVideoSrc: playVideoSrc
}) })
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.play(); this.videoContext.play();
}, },
/**视屏进入、退出全屏 */
fullScreen(e) {
var isFull = e.detail.fullScreen;
//视屏全屏时显示加载video,非全屏时,不显示加载video
this.setData({
videoState: isFull
})
if (isFull == false) {
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.pause();
this.videoContext.exitFullScreen();
}
},
bindwaiting(e) {
console.log(e)
},
modeImg1(e) { modeImg1(e) {
let img = e.currentTarget.dataset.item.ImgList; let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({ wx.previewImage({
......
...@@ -51,10 +51,11 @@ ...@@ -51,10 +51,11 @@
</view> </view>
</view> </view>
</view> </view>
<view hidden="{{!videoState}}" class="video_box"> <view class='{{videoState?"show":"hide"}}' >
<video id="prew_video" <video id="prew_video"
src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen" bindfullscreenchange="fullScreen"
show-fullscreen-btn="fasle" autoplay="true"
src="{{playVideoSrc}}"></video> loop='true'
<image bindtap="closeVideo" class="closeImg" src="../../../images/index/close.png"></image> ></video>
</view> </view>
\ No newline at end of file
...@@ -74,4 +74,10 @@ ...@@ -74,4 +74,10 @@
line-height:90rpx; line-height:90rpx;
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
}
.show{
display:show;
}
.hide{
display:none;
} }
\ No newline at end of file
...@@ -39,24 +39,39 @@ Page({ ...@@ -39,24 +39,39 @@ Page({
this.getPinglunList(); this.getPinglunList();
}, },
closeVideo() {
this.setData({
videoState: false,
})
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.pause();
},
bindPreviewVideo(e) { bindPreviewVideo(e) {
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress; let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction:0});
this.setData({ this.setData({
videoState: true, videoState: true,
playVideoSrc: playVideoSrc playVideoSrc: playVideoSrc
}) })
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.play(); this.videoContext.play();
}, },
/**视屏进入、退出全屏 */
fullScreen(e) {
var isFull = e.detail.fullScreen;
//视屏全屏时显示加载video,非全屏时,不显示加载video
this.setData({
videoState: isFull
})
if (isFull == false) {
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.pause();
this.videoContext.exitFullScreen();
}
},
bindwaiting(e){
console.log(e)
},
modeImg1(e) { modeImg1(e) {
let img = e.currentTarget.dataset.item.ImgList; let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({ wx.previewImage({
......
...@@ -50,11 +50,11 @@ ...@@ -50,11 +50,11 @@
</view> </view>
</view> </view>
<view hidden="{{!videoState}}" class="video_box"> <view class='{{videoState?"show":"hide"}}' >
<video id="prew_video" <video id="prew_video"
autoplay="true" src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen" bindfullscreenchange="fullScreen"
show-fullscreen-btn="fasle" autoplay="true"
src="{{playVideoSrc}}"></video> loop='true'
<image bindtap="closeVideo" class="closeImg" src="../../../images/index/close.png"></image> ></video>
</view> </view>
\ No newline at end of file
...@@ -73,4 +73,10 @@ ...@@ -73,4 +73,10 @@
line-height:90rpx; line-height:90rpx;
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
}
.show{
display:show;
}
.hide{
display:none;
} }
\ No newline at end of file
...@@ -47,14 +47,33 @@ Page({ ...@@ -47,14 +47,33 @@ Page({
}, },
bindPreviewVideo(e) { bindPreviewVideo(e) {
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress; let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction: 0 });
this.setData({ this.setData({
videoState: true, videoState: true,
playVideoSrc: playVideoSrc playVideoSrc: playVideoSrc
}) })
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.play(); this.videoContext.play();
}, },
/**视屏进入、退出全屏 */
fullScreen(e) {
var isFull = e.detail.fullScreen;
//视屏全屏时显示加载video,非全屏时,不显示加载video
this.setData({
videoState: isFull
})
if (isFull == false) {
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.pause();
this.videoContext.exitFullScreen();
}
},
bindwaiting(e) {
console.log(e)
},
modeImg1(e) { modeImg1(e) {
let img = e.currentTarget.dataset.item.ImgList; let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({ wx.previewImage({
......
...@@ -50,10 +50,11 @@ ...@@ -50,10 +50,11 @@
</view> </view>
</view> </view>
<view hidden="{{!videoState}}" class="video_box"> <view class='{{videoState?"show":"hide"}}' >
<video id="prew_video" <video id="prew_video"
show-fullscreen-btn="fasle" src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen" bindfullscreenchange="fullScreen"
src="{{playVideoSrc}}"></video> autoplay="true"
<image bindtap="closeVideo" class="closeImg" src="../../../images/index/close.png"></image> loop='true'
></video>
</view> </view>
\ No newline at end of file
...@@ -66,4 +66,10 @@ ...@@ -66,4 +66,10 @@
line-height:90rpx; line-height:90rpx;
text-align: center; text-align: center;
font-size: 30rpx; font-size: 30rpx;
}
.show{
display:show;
}
.hide{
display:none;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment