小编cai*_*y20的帖子

使用video.js时,为什么全屏按钮在iframe中不起作用?

我使用video.js进行视频播放.当使用iframe,点击全屏按钮按预期工作.但是,使用iframe时,全屏按钮不起作用.为什么是这样?

video.js的主页是http://videojs.com/

iframe页面的代码是:

<!DOCTYPE html>
<html>
<head>
  <title>Demo</title>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
  <iframe src="sco01-m.htm" id="cw" name="cw" width="100%" height="1000px;"        scrolling="no" frameborder="0"></iframe>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

sco01-m.htm页面的代码是:

<!DOCTYPE html>
<html>
<head>
  <title>Demo</title>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  <link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
  <script src="http://vjs.zencdn.net/c/video.js"></script>
<body>
  <div align="center">
    <video id="my_video_1" class="video-js vjs-default-skin" controls
      preload="auto" width="800" height="600" poster="1.jpg"
      data-setup="{}">
      <source src="A-2-4.mp4" type='video/mp4'>
      <source src="oceans-clip.webm" type='video/webm'>
    </video>
  </div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

sco01-m.htm页面可以使用全屏按钮,但iframe页面无法使用.

iframe fullscreen video.js

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

fullscreen ×1

iframe ×1

video.js ×1