我正在使用iframe播放youtube视频。它显示全屏图标,但点击显示“全屏不可用”。我正在使用全屏幕,但它仍然不工作。下面是我已经尝试过的代码。
代码1。
<iframe width="760" height="415" id={showVid.id} title={showVid.title} src={showVid.link} allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"></iframe>代码2。
<iframe width="760" height="415" id={showVid.id} title={showVid.title} src={showVid.link} allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture fullscreen"></iframe>发布于 2020-08-08 17:11:17
取决于您正在使用的浏览器,您可能需要打开iframe的其他设置,请参阅:YouTube iframe embed - full screen以获得深度答案。
发布于 2021-07-19 16:33:27
确保在youtube的src属性中使用https。
<iframe allow="fullscreen;" src="https://www.youtube.com/embed/{video.id}"></iframe>我使用"//www.youtube.com“链接在本地开发,而全屏对我来说是行不通的!
发布于 2020-08-08 17:39:28
iframe{
width : 100%
}然后使用javascript将缩放属性设置为缩放= 1;
https://stackoverflow.com/questions/63318113
复制相似问题