Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
react-sequence-frame-player
Advanced tools
提供两种使用方式:hook `useReactSequenceFramePlayer()` 和 组件式 `<ReactSequenceFramePlayer />`。
提供两种使用方式:hook useReactSequenceFramePlayer()
和 组件式 <ReactSequenceFramePlayer />
。
https://www.npmjs.com/package/react-sequence-frame-player
https://github.com/wxad/react-sequence-frame-player
import {
useReactSequenceFramePlayer,
IReactSequenceFramePlayerHookProps,
} from 'react-sequence-frame-player';
const baseProps: Partial<IReactSequenceFramePlayerHookProps> = {
// 图片地址数组,如果 urls?.length > 0,pattern 参数无效
// urls: [],
// 图片地址 pattern,其中必须包含 %d 或 %02d 或 %04d,以指定序号的规则是几位数,组件会依靠此规则请求图片
pattern:
'https://wxa.wxs.qq.com/wxad-design/yijie/bm23-test-2/mengxin/images/_1-61__%d.webp',
// 序列帧总数,如果 urls?.length > 0,此参数无效
total: 60,
// 序列帧 fps
fps: 30,
// 序列帧开始序号,默认为 0
// startIndex: 0,
// 是否自动播放
autoPlay: false,
// 是否循环播放
loop: true,
// 是否显示第一帧
showFirstFrame: true,
// 准备好后的回调,代表所有图片已加载完成
onReady: () => {},
// 开始播放时的回调
onStart: () => {},
// 播放进度回调,参数为 0 ~ 1 的小数
onProgress: progress => {},
// 播放完成时的回调,注意当 loop 为 true 时,此回调不会触发
onEnd: () => {},
// 播放循环回调,参数为当前循环次数
onLooped: loop => {},
};
const { dom, play, pause } = useReactSequenceFramePlayer({
...baseProps,
});
import {
ReactSequenceFramePlayer,
IReactSequenceFramePlayerRef,
IReactSequenceFramePlayerHookProps,
} from 'react-sequence-frame-player';
return (
<ReactSequenceFramePlayer
ref={playerRef}
width={300}
height={300}
{...baseProps}
/>
);
FAQs
提供两种使用方式:hook `useReactSequenceFramePlayer()` 和 组件式 `<ReactSequenceFramePlayer />`。
The npm package react-sequence-frame-player receives a total of 1 weekly downloads. As such, react-sequence-frame-player popularity was classified as not popular.
We found that react-sequence-frame-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.