let top = document.getElementById('videoPlayer').parentElement.getBoundingClientRect().top;
//console.log(top);
//console.log(JSON.stringify(videoPlayer));
top = top + 'px';
videoPlayer = plus.video.getVideoPlayerById('videoPlayer');
if (!videoPlayer) {
videoPlayer = new plus.video.createVideoPlayer('videoPlayer', {
src: videoUrl,
top: top,
left: '3%',
width: '94%',
height: '200px',
position:'static'
});
plus.webview.currentWebview().append(videoPlayer);
} else {
_that.closeVideo();
videoPlayer = new plus.video.createVideoPlayer('videoPlayer', {
src: videoUrl,
top: top,
left: '3%',
width: '94%',
height: '200px',
position:'static'
});
plus.webview.currentWebview().append(videoPlayer);
}
videoPlayer.addEventListener('fullscreenchange', function (e) {
if (e.detail.fullScreen) {
plus.screen.lockOrientation('landscape');
} else {
plus.screen.lockOrientation('portrait');
}
}, false);
closeVideo = () => {
if (videoPlayer) {
videoPlayer.close();
videoPlayer = null;
plus.webview.currentWebview().remove(videoPlayer);
}
};
7***@qq.com
- 发布:2020-09-08 16:19
- 更新:2021-08-14 17:05
- 阅读:892