iOS video 播放横屏布局问题
系统:iOS 10.3.3
微信:WeChat 6.5.14
在小程序中播放横屏视频:
< video id = "video_8048" data-id = "video_8048" src = "https://pcmgrminiclubvideo-1252940971.file.myqcloud.com/group/src/10199/7838435773816479296.mp4" controls bindfullscreenchange = "fullScreenChange" bindended = "playEndEvt" objectFit = "cover" > |
var videoContext = wx.createVideoContext( 'video_8048' ); videoContext.requestFullScreen(); videoContext.play(); fullScreenChange: function (event) { if (!event.detail.fullScreen) { // 退出全屏 var id = event.target.id; var videoContext = wx.createVideoContext(id); videoContext.pause(); videoContext.exitFullScreen(); } }, playEndEvt: function (event) { var id = event.target.id; var videoContext = wx.createVideoContext(id); videoContext.pause(); videoContext.exitFullScreen(); }, |
调用
videoContext.pause();
videoContext.exitFullScreen();
播放后,待播放完毕后退出全屏,偶现小程序,微信都变成横屏布局模式,如下图: