javascript - 如何在浏览器 (Chrome) 中从我的应用创建视频?
问题描述
如何从 Javascript 中的 div(或其他 DOM 元素)中运行的动画创建视频文件。例如:
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: red;
position: relative;
animation-name: example;
animation-duration: 4s;
animation-delay: 0s;
}
@keyframes example {
0% {background-color:red; left:0px; top:0px;}
25% {background-color:yellow; left:200px; top:0px;}
50% {background-color:blue; left:200px; top:200px;}
75% {background-color:green; left:0px; top:200px;}
100% {background-color:red; left:0px; top:0px;}
}
</style>
</head>
<body>
<p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p>
<div></div>
</body>
</html>
所以,我希望将这个动画保存在 .avi 或 .mp4 之类的文件中……我做了很多研究,但没有得到满意的解决方案。就像 html2canvas() 之类的东西,似乎只是为了打印。PS:在 Javascript 中(使用任何库、插件?)
解决方案
推荐阅读
- php - Microsoft Graph API - 分页大型集合
- python - 添加 QWebEngineView 时 PyQt5 GUI 缩放问题和指针未对齐
- javascript - 拨打 tcp 127.0.0.1:5500:连接:连接被拒绝
- android - 为什么我的 pagedList 没有通过 LiveData 方法 .observe 更新?
- java - Jacoco gradle 离线检测问题
- oauth - 谷歌云 OAuth 验证
- php - 我可以在 MYSQ ON 语句中使用 IN 运算符吗
- python - 如何从 JSON 格式的后响应中访问数据
- java - 为行的某些类型实现分页
- node.js - 在节点js中使用函数