1 Star 0 Fork 0

shark-dynamics/web_video_player

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
renderer.js 659 Bytes
一键复制 编辑 原始数据 按行查看 历史
hy 提交于 2022-12-28 17:19 +08:00 . modify player
class Renderer {
constructor(name) {
this.rendererName = name;
this.lastRenderTime = performance.now();
this.fps = 0;
}
updateChromeSize(width, height) {
this.chromeWidth = width;
this.chromeHeight = height;
}
registerFpsCallback(callback) {
this.fpsCallback = callback;
}
render(frame) {
let currentTime = performance.now();
let duration = (currentTime - this.lastRenderTime);
this.fps++;
if (duration > 1000) {
this.lastRenderTime = currentTime;
this.fpsCallback(this.fps);
this.fps = 0;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/shark-dynamics/web_video_player.git
git@gitee.com:shark-dynamics/web_video_player.git
shark-dynamics
web_video_player
web_video_player
master

搜索帮助