
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
react-av-timeline
Advanced tools
一根时间线

npm install react-av-timeline
首先引入组件,由于css未注入,需要手动引入css
import { Timeline } from 'react-av-timeline';
import 'react-av-timeline/dist/index.css';
<Component items={[{
time:1,
content:'这是第一秒展示的内容',
style:{
background: "#EAEAAD"
}
},{
time:69,
content:'这是第69秒展示的内容'
}]}
currentTime={0}
scale={0.5}
totalTime={91} />
效果如图

适合类似导播台自动化等序列化的场景,将时间线垂直展示

// 注意,引入方式不一样,非default导出
import { Vertical } from 'react-av-timeline';
import 'react-av-timeline/dist/index.css'
基本参数与普通时间线一致,请参考API
<Vertical height={190} left={20} items={[{
time:1,
content:'这是第一秒展示的内容',
style:{
background: "#EAEAAD"
}
},{
time:69,
content:'这是第69秒展示的内容'
}]} currentTime={currentTime} scale={10} totalTime={100} />
可以结合audio或video,通过监听timeupdate事件,实时更新currentTime,实现同步播放
如example/App.tsx或者https://cnb.cool/arsrna/visualize-music
interface PropsType {
/**时间轴 */
items: itemsType[],
/**时间轴样式 */
itemStyle?: CSSProperties,
/**当前时间点 */
currentTime: number,
/**总时长 */
totalTime: number,
/**缩放比例 */
scale?: number,
/**时间轴指示器属性 */
indicator?: HTMLAttributes<HTMLDivElement>
}
interface itemsType {
/**时间点 */
time: number,
/**该点对应的样式 */
style?: CSSProperties,
/**该点对应的文字 */
content?: ReactNode
}
PropsType & {
/**保留前几个项目 */
prev?: number
/**距离左边距 */
left?: number,
/**总高度 */
height?: CSSProperties['height']
}
FAQs
React 音视频时间线组件
We found that react-av-timeline demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.