javascript - 如何添加全宽视频标签?
问题描述
我想在div
那个id是使用javascript的视频中附加全宽的视频标签。你可以帮帮我吗?
let video = document.createElement("video")
video.width = 320;
video.height = 180;
video.style.background = "black"
document.getElementById("video").append(video);
<html>
<body style="background: lightgrey">
<div class="container">
<div id="video"></div>
</div>
</body>
</html>
解决方案
<video width="100%" height="auto" controls>
<source src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4">
message if vodeo does not show
</video>
推荐阅读
- python - Beautiful Soup - 使用 find_all 从多个网页中提取文本
- javascript - (GDrive API)用户无需登录即可下载文件需要访问令牌
- javascript - ES 模块何时可以导入名为 export 的 CommonJS?
- excel - 带日期的 Excel 通配符
- java - Spring Security:@PreAuthorized(hasAuthority) 以列表为参数
- size - Teradata 问题 - 多个商店和多个项目
- python - 无法将 LabJack U3 模型正确加载到 PyCharm
- c# - 禁用JS chrome selenium c#
- c - 使用定点而不是浮点计算信号频率
- java - 登录到一个页面,然后获取该登录名并自动登录到其他页面,而无需再次输入用户/密码