编程代码

plyr player rotate screen when fullscreen in mobile.(H5播放器在移动设备中全屏时旋转屏幕)

gyue2345·2022-09-18·18 次阅读··

   评分 0 次,平均分 0.0    抢沙发   隐藏边栏   黑色模式


// fullscreen enter on mobile device
player.on('enterfullscreen', event => {
	try {
		screen.orientation.lock('landscape');
	} catch (e) {}
});
// when exit fullscreen
player.on('exitfullscreen', event => {
	try {
		screen.orientation.lock('portrait');
	} catch (e) {}
});

plyr player rotate screen when fullscreen in mobile.(H5播放器在移动设备中全屏时旋转屏幕)


// Mobile devices hide the current playback time
const currentTime_btn = document.querySelector("#playerCnt > div > div.plyr__controls > div.plyr__controls__item.plyr__time--current.plyr__time");
player.on('playing', (event) => {
  window.setInterval(function () {
    var winwidth = $(window)
      .width();
    if (winwidth < 640) {
      currentTime_btn.style = `display:none;`;
    } else {
      currentTime_btn.style = `display:block;`;
    }
  }, 1000);
});

https://movie.ljy2345.com/vodplay/41330-1-1.html

赞赏
  

除特别注明外,本站所有文章均为LJY IT BLOG原创,转载请注明出处来自https://www.ljy2345.com/2022/09/plyr-player-rotate-screen-when-fullscreen-in-mobile/

博 主作者: 关注:6    粉丝:1最后编辑于:2022年9月18日
LJY IT BLOG的站长。

扫一扫打赏

支付宝扫一扫打赏

微信扫一扫打赏

view comments - NOTHING
🌙
😃

切换注册
忘记密码 ?

×

您也可以使用第三方帐号快捷登录

切换登录

×
扫一扫二维码分享
下载海报
  切换主题 | SCHEME TOOL