HTML5 <video> Player Controls in Chrome Three Dots on the Right Open Blank Screen

北城以北 提交于 2020-02-24 05:50:06

问题


Can't seem to find an answer for this anywhere.

I am using a standard HTML5 tag to embed a video into page:

<video controls>
     <source src="video/intro-video.mp4" type="video/mp4"/>
</video>

However, in Chrome's default controls on the right, three dots show up (options), however, when you click on them, it goes to a blank screen and there's no way to get out if it except for refreshing the entire page.

How do you make the options either go away or prevent a blank screen?

Thank you.


回答1:


I know it's too late but it be useful for others, you can add "nodownload" in controls list which will hide the download option from the video and add "disablepictureinpicture" inside the video tag which will hide the picture in picture option and by this way the three dots gets hidden

<video width="100%" controls disablepictureinpicture controlslist="nodownload">

working sample




回答2:


if you disable the options, using the relevant exclusions from the list below, the dots should disappear:

<video controls controlsList="nofullscreen nodownload noremoteplayback">
</video>

See ControlsList for more details




回答3:


Ok, got it! It appears that "Options" button behaves differently based on how video element was embedded in the page. Essentially, it offers, Download or "Picture-in-Picture" features or both, which, if the page is a wide scrollable site with dynamically generated content, caused a blank screen when clicked, which was my issue. Two ways I can solve that problem:

  1. Embed video in a separate fixed container (like a modal pop-up)

  2. Use a disablePictureInPicture attribute to eliminate the Picture-in-Picture feature altogether. https://wicg.github.io/picture-in-picture/#dom-htmlvideoelement-disablepictureinpicture



来源:https://stackoverflow.com/questions/54507905/html5-video-player-controls-in-chrome-three-dots-on-the-right-open-blank-scree

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!