Commit 28e3b7d7 authored by Mac's avatar Mac

全屏问题解决

parent 49d3b3dc
......@@ -26,6 +26,7 @@ Page({
videoContext:'',
playVideoSrc:'',
videoState: false,
videoState_t:false
},
videoContext: null,
......@@ -69,17 +70,35 @@ Page({
msg:msg
})
},
bindPreviewVideo(e) {
let playVideoSrc =this.data.msg.VideoAddress;
let playVideoSrc = this.data.msg.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.play();
this.videoContext.requestFullScreen({ direction: 0 });
this.setData({
videoState: true,
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) {
var status = e.detail.fullScreen;
......
<view hidden="{{videoState}}" class="clock">
<view hidden="{{videoState_t}}" class="clock">
<view style="padding:30rpx;position:relative">
<image style="width:70rpx;height:70rpx;position: absolute;" src="../../images/index/adress.png"></image>
<view class="title">
......@@ -45,11 +45,11 @@
<view class="hr"></view>
<view bindtap="tiJiao" class="sumbitBtn">提交</view>
</view>
<view hidden="{{!videoState}}" class="video_box">
<view class='{{videoState?"show":"hide"}}' >
<video id="prew_video"
autoplay="true"
bindfullscreenchange="fullScreen"
show-fullscreen-btn="fasle"
src="{{playVideoSrc}}"></video>
<image bindtap="closeVideo" class="closeImg" src="../../images/index/close.png"></image>
src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen"
autoplay="true"
loop='true'
></video>
</view>
\ No newline at end of file
......@@ -97,4 +97,10 @@
height: 40rpx;
right: -20rpx;
top: -20rpx;
}
.show{
display:show;
}
.hide{
display:none;
}
\ No newline at end of file
......@@ -40,16 +40,34 @@ Page({
this.videoContext.pause();
},
bindPreviewVideo(e) {
console.log("eee",e);
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction:0});
this.setData({
videoState: true,
playVideoSrc: playVideoSrc
})
this.videoContext = wx.createVideoContext('prew_video');
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) {
let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({
......
......@@ -25,10 +25,11 @@
<view wx:else style="padding-top:280rpx;text-align:center">
<image style="width:438rpx;height:215rpx" src="../../images/index/nodata.png"></image>
</view>
<view hidden="{{!videoState}}" class="video_box">
<view class='{{videoState?"show":"hide"}}' >
<video id="prew_video"
show-fullscreen-btn="fasle"
src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen"
src="{{playVideoSrc}}"></video>
<image bindtap="closeVideo" class="closeImg" src="../../images/index/close.png"></image>
autoplay="true"
loop='true'
></video>
</view>
\ No newline at end of file
......@@ -52,4 +52,10 @@
height:50rpx;
background:linear-gradient(180deg,rgba(255,49,102,0.3),rgba(255,49,102,0.05));
border-radius:2rpx;
}
.show{
display:show;
}
.hide{
display:none;
}
\ No newline at end of file
......@@ -47,14 +47,33 @@ Page({
},
bindPreviewVideo(e) {
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction: 0 });
this.setData({
videoState: true,
playVideoSrc: playVideoSrc
})
this.videoContext = wx.createVideoContext('prew_video');
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) {
let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({
......
......@@ -48,10 +48,11 @@
</view>
</view>
</view>
<view hidden="{{!videoState}}" class="video_box">
<view class='{{videoState?"show":"hide"}}' >
<video id="prew_video"
show-fullscreen-btn="fasle"
src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen"
src="{{playVideoSrc}}"></video>
<image bindtap="closeVideo" class="closeImg" src="../../../images/index/close.png"></image>
autoplay="true"
loop='true'
></video>
</view>
\ No newline at end of file
......@@ -78,4 +78,10 @@
line-height:90rpx;
text-align: center;
font-size: 30rpx;
}
.show{
display:show;
}
.hide{
display:none;
}
\ No newline at end of file
......@@ -47,14 +47,33 @@ Page({
},
bindPreviewVideo(e) {
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction: 0 });
this.setData({
videoState: true,
playVideoSrc: playVideoSrc
})
this.videoContext = wx.createVideoContext('prew_video');
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) {
let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({
......
......@@ -51,10 +51,11 @@
</view>
</view>
</view>
<view hidden="{{!videoState}}" class="video_box">
<view class='{{videoState?"show":"hide"}}' >
<video id="prew_video"
src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen"
show-fullscreen-btn="fasle"
src="{{playVideoSrc}}"></video>
<image bindtap="closeVideo" class="closeImg" src="../../../images/index/close.png"></image>
autoplay="true"
loop='true'
></video>
</view>
\ No newline at end of file
......@@ -74,4 +74,10 @@
line-height:90rpx;
text-align: center;
font-size: 30rpx;
}
.show{
display:show;
}
.hide{
display:none;
}
\ No newline at end of file
......@@ -39,24 +39,39 @@ Page({
this.getPinglunList();
},
closeVideo() {
this.setData({
videoState: false,
})
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.pause();
},
bindPreviewVideo(e) {
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction:0});
this.setData({
videoState: true,
playVideoSrc: playVideoSrc
})
this.videoContext = wx.createVideoContext('prew_video');
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) {
let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({
......
......@@ -50,11 +50,11 @@
</view>
</view>
<view hidden="{{!videoState}}" class="video_box">
<view class='{{videoState?"show":"hide"}}' >
<video id="prew_video"
autoplay="true"
src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen"
show-fullscreen-btn="fasle"
src="{{playVideoSrc}}"></video>
<image bindtap="closeVideo" class="closeImg" src="../../../images/index/close.png"></image>
</view>
\ No newline at end of file
autoplay="true"
loop='true'
></video>
</view>
......@@ -73,4 +73,10 @@
line-height:90rpx;
text-align: center;
font-size: 30rpx;
}
.show{
display:show;
}
.hide{
display:none;
}
\ No newline at end of file
......@@ -47,14 +47,33 @@ Page({
},
bindPreviewVideo(e) {
let playVideoSrc = e.currentTarget.dataset.item.VideoAddress;
this.videoContext = wx.createVideoContext('prew_video');
this.videoContext.requestFullScreen({ direction: 0 });
this.setData({
videoState: true,
playVideoSrc: playVideoSrc
})
this.videoContext = wx.createVideoContext('prew_video');
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) {
let img = e.currentTarget.dataset.item.ImgList;
wx.previewImage({
......
......@@ -50,10 +50,11 @@
</view>
</view>
<view hidden="{{!videoState}}" class="video_box">
<view class='{{videoState?"show":"hide"}}' >
<video id="prew_video"
show-fullscreen-btn="fasle"
src="{{playVideoSrc}}"
bindfullscreenchange="fullScreen"
src="{{playVideoSrc}}"></video>
<image bindtap="closeVideo" class="closeImg" src="../../../images/index/close.png"></image>
autoplay="true"
loop='true'
></video>
</view>
\ No newline at end of file
......@@ -66,4 +66,10 @@
line-height:90rpx;
text-align: center;
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