最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - video.js - width="100%" height="100%" is not working? - Stack Overflow

programmeradmin1浏览0评论

<body>

<link href="//mysite/player/video-js/video-js.min.css" rel="stylesheet">
<link href="//mysite/css/op.css" rel="stylesheet">

<script src="//mysite/video-js/video.min.js"></script>

<div align="center">
<video id="myvideo" class="video-js vjs-default-skin vjs-big-play-centered" controls
 preload="auto" poster="IMG-LINK"
data-setup="{}">
 <source src="VIDEO-LINK" type="video/mp4" width="100%" height="100%">
</video>

</body>

<body>

<link href="//mysite./player/video-js/video-js.min.css" rel="stylesheet">
<link href="//mysite./css/op.css" rel="stylesheet">

<script src="//mysite./video-js/video.min.js"></script>

<div align="center">
<video id="myvideo" class="video-js vjs-default-skin vjs-big-play-centered" controls
 preload="auto" poster="IMG-LINK"
data-setup="{}">
 <source src="VIDEO-LINK" type="video/mp4" width="100%" height="100%">
</video>

</body>

how to fix this with JW Player is working perfect with Video.js that can't be 100% full scern

Share Improve this question asked Jan 28, 2018 at 1:54 user9273738user9273738 2
  • 1 If i remember correctly, the width and height must be applied to video not source and the value must be in pixels. See more here : w3schools./tags/att_video_width.asp – Mojo Allmighty Commented Jan 28, 2018 at 1:57
  • 1 Like that is working, but the style css is not working anymore now is simple video – user9273738 Commented Jan 28, 2018 at 2:03
Add a ment  | 

4 Answers 4

Reset to default 1

Try this way:

<video style="width: 100%; height: 100%" id="myvideo" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto" poster="IMG-LINK" data-setup="{}">
 <source src="VIDEO-LINK" type="video/mp4">
</video>

It will work if you put width="100%" height="100%" in "video" tag not in "source" tag.

<video id="myvideo" class="video-js vjs-default-skin vjs-big-play-centered" controls
 preload="auto" poster="IMG-LINK"
data-setup="{}" width="100%" height="100%">
 <source src="VIDEO-LINK" type="video/mp4">
</video>

Just use the fluid option

<video class="video-js" data-setup='{"fluid": true}'>
    <source src="http://vjs.zencdn/v/oceans.mp4" type="video/mp4">
</video>

<body>

<link href="//mysite./player/video-js/video-js.min.css" rel="stylesheet">
<link href="//mysite./css/op.css" rel="stylesheet">

<script src="//mysite./video-js/video.min.js"></script>

<div align="center">
<video id="myvideo" class="video-js vjs-default-skin vjs-big-play-centered" controls
 preload="auto" poster="IMG-LINK"
data-setup="{}">
 <source src="VIDEO-LINK" type="video/mp4" width="100%" height="100%">
</video>

</body>

<video id="myvideo" class="video-js vjs-default-skin vjs-big-play-centered" controls
 preload="auto" poster="IMG-LINK"
data-setup="{}" width="100%" height="100%">
 <source src="VIDEO-LINK" type="video/mp4">
</video>

Please check images which I attached.

发布评论

评论列表(0)

  1. 暂无评论