admin管理员组文章数量:1125904
By default, Vidstack zooms/crops a vertical YouTube video into a 16/9 aspect ratio:
If the height: 1000%
styling is disabled, the vertical video is contained as desired. However, unwanted elements like the "more videos" UI are added when the video is paused.
Is there a way to both contain the vertical video in a 16/9 frame and hide the "more videos" UI?
The player should support both vertical and horizontal videos so hard-coding the width and height in CSS is not acceptable. However, dynamically setting the width and height based on the video is acceptable (if this information is available).
If the following CSS is added, the vertical video fits, but I am unable to reduce the height of the player (to the same height as a 16/9 video) without introducing cropping/zooming.
media-player {
aspect-ratio: 9/16;
}
The screen captures above used this minimal source code:
<html>
<head>
<link rel="stylesheet" href=".css" />
<link rel="stylesheet" href=".css" />
</head>
<script src="; type="module"></script>
<media-player src="youtube/IF_7SLHdreQ">
<media-provider></media-provider>
<media-video-layout></media-video-layout>
</media-player>
</html>
References:
本文标签: htmlHow to contain vertical YouTube video in Vidstack (without quotmore videosquot UI)Stack Overflow
版权声明:本文标题:html - How to contain vertical YouTube video in Vidstack (without "more videos" UI) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736676277a1947198.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论