|
@@ -174,8 +174,24 @@ Page({
|
|
|
// this.storeBindings.destroyStoreBindings();
|
|
|
},
|
|
|
changeFull(e) {
|
|
|
- let playerList = this.data.playerList[this.data.bigIndex];
|
|
|
- this.rotate();
|
|
|
+ let verticalFullScreen = this.data.bigIndex === -1;
|
|
|
+ if(!verticalFullScreen) {
|
|
|
+ let currentBigerPlayer = this.data.playerList[this.data.bigIndex];
|
|
|
+ // let livePlayerContext = EduTRTC.getInstance().getPlayerInstance(playerList.id);
|
|
|
+ const {videoWidth, videoHeight} = currentBigerPlayer.netStatus;
|
|
|
+ if(videoWidth && videoHeight && videoHeight > videoWidth) {
|
|
|
+ verticalFullScreen = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(verticalFullScreen) {
|
|
|
+ this.setData({
|
|
|
+ isFull: !this.data.isFull
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.rotate();
|
|
|
+ }
|
|
|
+ // let playerList = this.data.playerList[this.data.bigIndex];
|
|
|
+ // this.rotate();
|
|
|
// if (this.data.bigIndex==-1 || playerList.userID.indexOf("student") !=-1
|
|
|
// || playerList.userID.indexOf("guest_") !=-1 ){
|
|
|
// this.setData({
|
|
@@ -290,9 +306,16 @@ Page({
|
|
|
let that = this;
|
|
|
let playerList = this.data.playerList[this.data.bigIndex];
|
|
|
let livePlayerContext = wx.createLivePlayerContext(playerList.id);
|
|
|
- console.log(livePlayerContext)
|
|
|
+ // let livePlayerContext = EduTRTC.getInstance().getPlayerInstance(playerList.id);
|
|
|
+ const {videoWidth, videoHeight} = playerList.netStatus;
|
|
|
+ // if(!videoWidth || !videoHeight) {
|
|
|
+ // toast("网络状态不好,请稍后再试!");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ const direction = videoWidth && videoHeight > videoWidth? 0 : 90;
|
|
|
livePlayerContext.requestFullScreen({
|
|
|
- direction:90,
|
|
|
+ // direction: 90,
|
|
|
+ direction,
|
|
|
success(res) {
|
|
|
that.setData({isRotate:true})
|
|
|
},
|
|
@@ -309,16 +332,22 @@ Page({
|
|
|
let that = this;
|
|
|
let playerList = this.data.playerList[this.data.bigIndex];
|
|
|
let livePlayerContext = wx.createLivePlayerContext(playerList.id);
|
|
|
- console.log(livePlayerContext)
|
|
|
- livePlayerContext.exitFullScreen({
|
|
|
- success(res) {
|
|
|
- that.setData({isRotate:false})
|
|
|
- },
|
|
|
- fail(e){
|
|
|
- toast("屏幕旋转失败,请稍后重试")
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
- })
|
|
|
+ // 解决退出全屏后 屏幕还是在旋转状态的问题 --- start
|
|
|
+ livePlayerContext.requestFullScreen({
|
|
|
+ direction: 0
|
|
|
+ });
|
|
|
+ // 解决退出全屏后 屏幕还是在旋转状态的问题 --- end
|
|
|
+ wx.nextTick(() => {
|
|
|
+ livePlayerContext.exitFullScreen({
|
|
|
+ success(res) {
|
|
|
+ that.setData({isRotate:false})
|
|
|
+ },
|
|
|
+ fail(e){
|
|
|
+ toast("屏幕旋转失败,请稍后重试")
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
|