npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

video-animation-player-tc

v0.2.11

Published

webgl动画特效组件

Downloads

5

Readme

VAP

License

简介

VAP是企鹅电竞实现融合礼物特效的组件,将图片/文字与原始mp4视频融合在一起,支持透明度,项目详细介绍请参考 VAP

一、使用(参考demo) 🔧

1、安装

npm i video-animation-player

2、创建实例

import Vap from 'video-animation-player'
# init
let vap = new Vap(options)

3、实例方法

# 实例方法
1、on(): 绑定h5 video事件或者自定义事件(frame: 接收当前帧和播放时间戳)  如on('playering', function() {// do some thing})
2、destroy():销毁实例,清除video、canvas等
3、pause():暂停播放
4、play():继续播放
5、setTime(s):设置播放时间点(单位秒)

4、实例参数

参数名 | 含义 | 默认值 ---- | --- | --- container | dom容器 | null src | mp4视频地址 | '' config | 配置json对象(详情见下文)| '' width | 宽度 | 375 height | 高度 | 375 fps | 动画帧数(生成素材时在工具中填写的fps值) | 20 mute | 是否对视频静音 | false loop | 是否循环播放 | false type | 组件基于type字段做了实例化缓存,不同的VAP实例应该使用不同的type值(如0、1、2等)| undefined beginPoint | 起始播放时间点(单位秒),在一些浏览器中可能无效 | 0 fontStyle | 融合字体样式用法参考 | '' accurate | 是否启用精准模式(使用requestVideoFrameCallback提升融合效果,浏览器不兼容时自动降级) | false precache | 是否预加载视频资源(默认关闭,即边下边播) | false onDestory | 组件销毁时回调 | undefined onLoadError | 加载失败回调 | undefined ext(无固定名) | 融合参数(和json配置文件中保持一致)| ''

注意:默认字体大小是根据文字个数动态变化的,会保证文字全部展示出来,如果通过fontStyle参数设置字体大小后,可能出现文字展示不全的现象

二、素材

内容格式固定,使用VAP素材生成工具生成

三、实现原理

使用webgl texture获取video和图片/文字的纹理,并在shader中进行自定义融合,