doushi7394 2016-01-06 06:41
浏览 193
已采纳

视频标签中的全屏按钮丢失

full screen button in video tag missing when page containing video is loaded externally on another pages div

I have a page external.php . In this page when i use the following code

echo 
   '<video width="400" controls>
  <source src="movie.mp4" type="video/mp4">
</video>';

i get a video with full screen button in it on chrome.But when i try to load this external.php on another page (home.php) div the video is coming but the full screen button is missing.But in IE there is no such problem.

  • 写回答

1条回答 默认 最新

  • doufan6033 2016-01-06 07:16
    关注

    You can either solve this via CSS OR Fullscreen API.

    1. CSS

    I think you can accomplish this by changing the css for the #document fragments, these are DOM1 specs and supported by all browsers, but about the styling, I'm not sure. The following solution is webkit specific.

    You need just to write this code in your css:

    video::-webkit-media-controls-fullscreen-button {}
    

    2. Full screen API

    If you want to accomplish it by Fullscreen API check below demo first:

    Demo Full screen video

    As you can see a very simple demo showing HTML5 video in full screen, make sure you're using Chrome dev, webkit or firefox nightly.

    For more detail you can check it here. Browsers may provide a user interface, but shouldn't provide a programmable one.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?