Commit ed2c911f authored by Mac's avatar Mac

放大处理

parent 7b66b442
......@@ -181,10 +181,13 @@
</view>
<view class="inter-r-t" v-if="x.fileType==2">
<view class="inter-r-t-l" style="position: relative;">
<video id="myVideo" :src="x.files[0]" style="width: 70px;height: 70px;" :controls='false'
:show-center-play-btn='false'></video>
<video :id="'myVideo'+i" :src="x.files[0]" style="width: 70px;height: 70px;"
:controls='controls'
:show-center-play-btn='false'
:show-fullscreen-btn='false'
@fullscreenchange='videoControl'></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"
@click.stop="enlarge(x.files[0])">
@click.stop="enlarge(x.files[0],i)">
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
</view>
</view>
......@@ -273,6 +276,7 @@
nowbofo: false,
Messagecount:0,
playindex:0,
controls:false,
}
},
created() {
......@@ -401,12 +405,26 @@
}
});
},
enlarge(file) {
enlarge(file,i) {
// 全屏
uni.navigateTo({
url: '/pages/friendcircle/enlargevideo?file=' + file
})
innerAudioContext.stop();
this.videoContext = uni.createVideoContext('myVideo'+i);
this.videoContext.requestFullScreen({
direction:0
})
// uni.navigateTo({
// url: '/pages/friendcircle/enlargevideo?file=' + file
// })
},
videoControl(e){
if(e.detail.fullScreen==false){
this.videoContext.stop()
this.controls=false
}else{
this.videoContext.play()
this.controls=true
}
},
//语音播放
playVoice(x,i) {
......
......@@ -219,7 +219,11 @@
</view>
<view class="imgmode" v-if="detial.fileType==2">
<view style="width: 100px;height:120px;margin-bottom: 6px;position: relative;">
<video id="myVideo" :src="detial.files[0]" style="width: 100%;height: 100%;" :controls='false' :show-center-play-btn='false'></video>
<video id="myVideo" :src="detial.files[0]" style="width: 100%;height: 100%;"
:controls='controls'
:show-center-play-btn='false'
:show-fullscreen-btn='false'
@fullscreenchange='videoControl'></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"
@click.stop="enlarge(detial.files[0])">
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
......@@ -335,6 +339,7 @@
show:false,
user:'',//点击用户保存的数据
UserId:0,
controls:false,//显示默认控件
}
},
onLoad(options) {
......@@ -381,14 +386,7 @@
current: index,
});
},
enlarge(file) {
// 全屏
innerAudioContext.stop();
uni.navigateTo({
url: '/pages/friendcircle/enlargevideo?file=' + file
})
},
//语音播放
playVoice(x) {
let that = this
......@@ -518,6 +516,24 @@
data: this.user.item.content,
});
},
enlarge(file) {
// 全屏
innerAudioContext.stop();
this.videoContext = uni.createVideoContext('myVideo');
this.videoContext.requestFullScreen({
direction:0
})
},
videoControl(e){
if(e.detail.fullScreen==false){
this.videoContext.stop()
this.controls=false
}else{
this.videoContext.play()
this.controls=true
}
}
}
}
......
......@@ -175,9 +175,12 @@
<view style="width: 150px; height: 200px;position: relative;margin-right: 20px;">
<video id="myVideo" :src="addMsg.FileList[0]"
@error="videoErrorCallback" :controls='false' :show-center-play-btn='false' ></video>
controls='controls'
:show-center-play-btn='false'
:show-fullscreen-btn='false'
@fullscreenchange='videoControl' ></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;" @click="enlarge()">
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;" @click="enlarge(addMsg.FileList[0])">
<u-icon name="play-circle-o" :size="70" color="#FFF"></u-icon>
</view>
</view>
......@@ -304,7 +307,8 @@
nowbofo:false,//播放状态
videoContext:null,
gifshow:false,
playshow:false
playshow:false,
controls:false,//显示默认控件
}
},
......@@ -651,13 +655,24 @@
});
},
enlarge(){
enlarge(file) {
// 全屏
uni.navigateTo({
url: '/pages/friendcircle/enlargevideo?file='+this.addMsg.FileList[0]
innerAudioContext.stop();
this.videoContext = uni.createVideoContext('myVideo');
this.videoContext.requestFullScreen({
direction:0
})
},
videoControl(e){
if(e.detail.fullScreen==false){
this.videoContext.stop()
this.controls=false
}else{
this.videoContext.play()
this.controls=true
}
}
}
}
......
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