katiy
katiy
  • 发布:2023-07-21 10:01
  • 更新:2023-07-21 10:13
  • 阅读:244

video组件全屏后,IOS16真机测试,不显示返回按钮,并且关闭全屏后,APP不会返回竖屏显示,怎么解决?

分类:uni-app

播放视频的video组件,点击播放,全屏后,在IOS系统15.7.3上真机测试,返回后,APP没有返回竖屏显示。在IOS16+上,video组件,不显示操作按钮,并且点视频,会弹出拨打电话提示。APP也无法返回竖屏。

<view v-if="item.msg.type == 'video'" class="video-view" @longpress.stop="handleMsg_chat(item)" @tap="videoClickHandle(item)"></view>

<!-- 视频播放video 由于video组件会覆盖别的元素,只显示一个视频图片,点击图片,全屏显示视频播放-->
<video :src="onVideoSrc"
v-show="false"
controls
autoplay
object-fit="fill"
@fullscreenchange="screenChange"
@pause="videoPause"
style="width: 100vw; height: 100vh; " id="video_play" ></video>

videoClickHandle(e){
let _this = this;

    // 获取 video 上下文 videoContext 对象  
    _this.videoContext = uni.createVideoContext('video_play',_this)  
    // 获取视频地址  
    if(e.msg.data.indexOf('em-redirect=true') !== -1){  
        _this.onVideoSrc = e.msg.data  
    }else{  
        _this.onVideoSrc = e.msg.data+'?em-redirect=true&origin-file=true'  
    }  
    //console.log(e.msg.data+'?em-redirect=true&origin-file=true')  
    // 进入全屏状态  
    _this.videoContext.requestFullScreen();  
    //_this.videoPlay = true  
    _this.videoContext.play();  
},  
//当视频进入和退出全屏时触发  
screenChange(e){  
    let _this = this  
    let fullScreen = e.detail.fullScreen;  
    if (!fullScreen) {  
        _this.videoContext.pause();  
        //_this.videoPlay = false  
    }  
}
2023-07-21 10:01 负责人:无 分享
已邀请:
3***@qq.com

3***@qq.com

同缩小还有返回 回不到竖屏 样式是乱的 之前还是好的 就是更新出的bug

要回复问题请先登录注册