Video.js - 使其响应不同尺寸
Video.js - Making it responsive in different sizes
目前我有一个 Video.js 视频播放器,当我在 mobiles/tablets 上观看它时,我设法让它响应,但是当我在桌面上观看它时,视频播放器延伸到相同 width/height 作为我的容器。如何在桌面上指定固定的 width/height 并在 mobiles/tablets 上查看时将其缩小?
index.php
<div class="content">
<video id="my-video" class="video-js vjs-default-skin vjs-16-9 vjs-big-play-centered" controls preload="auto" poster="" data-setup="{}">
<source src="video.mp4" type='video/mp4'>
<p class="vjs-no-js">
To view this video please enable JavaScript and consider upgrading to a web browser that supports HTML5 video.</a>
</p>
</video>
</div>
在 css 中使用媒体查询并将容器 class 宽度和高度更改为固定值
/* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */
@media (min-width:481px) { /* css in here */ }
/* tablet, landscape iPad, lo-res laptops ands desktops */
@media (min-width:961px) { /* css in here */ }
/* Desktop up */
@media (min-width:1025px) { .container { width: 300px; height:300px; } }
目前我有一个 Video.js 视频播放器,当我在 mobiles/tablets 上观看它时,我设法让它响应,但是当我在桌面上观看它时,视频播放器延伸到相同 width/height 作为我的容器。如何在桌面上指定固定的 width/height 并在 mobiles/tablets 上查看时将其缩小?
index.php
<div class="content">
<video id="my-video" class="video-js vjs-default-skin vjs-16-9 vjs-big-play-centered" controls preload="auto" poster="" data-setup="{}">
<source src="video.mp4" type='video/mp4'>
<p class="vjs-no-js">
To view this video please enable JavaScript and consider upgrading to a web browser that supports HTML5 video.</a>
</p>
</video>
</div>
在 css 中使用媒体查询并将容器 class 宽度和高度更改为固定值
/* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */
@media (min-width:481px) { /* css in here */ }
/* tablet, landscape iPad, lo-res laptops ands desktops */
@media (min-width:961px) { /* css in here */ }
/* Desktop up */
@media (min-width:1025px) { .container { width: 300px; height:300px; } }