使用 iframe 播放视频时全屏不工作

时间:2021-02-24 11:37:12

标签: html reactjs iframe html5-video

我想在 iframe 播放器中允许全屏视频。你可以看到我的代码here

  function App() {
   return (
    <div className="App">
      <iframe
        height={"315px"}
        allowfullscreen
        webkitallowfullscreen
        mozallowfullscreen
        oallowfullscreen
        msallowfullscreen
        width={"560px"}
        src={`https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4`}
      />
    </div>
  );
}

1 个答案:

答案 0 :(得分:0)

allowFullScreen - 如果设置,则应用 allowFullScreen 参数(在 HTML5 中已弃用)。如果设置,则添加 allow="fullscreen"。

相关问题