video标签如何隐藏全屏按钮、去掉画中画和下载功能,进入全屏、退出全屏

video::-webkit-media-controls-fullscreen-button {
     display: none;
}

 2、去掉画中画和下载功能

controlsList="nodownload"   disablePictureInPicture

  

 

原生video标签隐藏底部功能按钮

3、进入全屏

  //进入全屏
    requestFullScreen() {
      var de = document.documentElement;
      if (de.requestFullscreen) {
        de.requestFullscreen();
      } else if (de.mozRequestFullScreen) {
        de.mozRequestFullScreen();
      } else if (de.webkitRequestFullScreen) {
        de.webkitRequestFullScreen();
      }
    },

4、退出全屏

  //退出全屏
    exitFullscreen() {
      var de = document;
      if (de.exitFullscreen) {
        de.exitFullscreen();
      } else if (de.mozCancelFullScreen) {
        de.mozCancelFullScreen();
      } else if (de.webkitCancelFullScreen) {
        de.webkitCancelFullScreen();
      }
    },

  

posted @ 2021-12-31 10:44  carrie_zhao  阅读(6653)  评论(0编辑  收藏  举报