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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sentinel-lab/video-react

v4.0.0

Published

Sentinel Video Player React inline 组件:直连 player-core 的高性能接入方式

Readme

@sentinel-lab/video-react

Sentinel Video Player 的 React inline 消费面(L7)。直连 player-core + player-ui,不走 iframe,首帧最快。

对外只有一个组件 <VideoPlayer /> + 一个命令句柄。见 ADR-001。

什么时候用它

| 场景 | 选这个包 | |:---|:---| | 追求首帧速度、宿主同为 React | ✅ 本包 | | 需要和宿主页面样式/状态深度联动 | ✅ 本包 | | 要把播放器和宿主隔离(第三方内容、CSS 冲突) | ❌ 用 @sentinel-lab/video-react-frame | | 宿主是 Vue | ❌ 用 @sentinel-lab/video-vue(inline,本包的镜像)或 @sentinel-lab/video-vue-frame(iframe) |

安装

pnpm add @sentinel-lab/video-react

peer:react >=18react-dom >=18

用法

import { VideoPlayer, type VideoPlayerHandle } from '@sentinel-lab/video-react'
// 别漏 —— 少了它播放器照样能播,但控件是散的。引擎样式和覆盖层样式都拼在这一份里,
// 不需要另外装 xgplayer
import '@sentinel-lab/video-react/style.css'
import { useRef } from 'react'

function Player() {
  const ref = useRef<VideoPlayerHandle>(null)

  return (
    <VideoPlayer
      ref={ref}
      source="https://cdn.example.com/live/master.m3u8"
      autoplay
      muted
      onReady={({ duration, quality, subtitles }) => {
        // quality / subtitles 是可切档位与字幕轨清单,团队层据此渲染菜单
      }}
      onError={(err) => {
        // err.code 是 protocol 注册的 E_* 错误码,err.retryable 指示是否可重试
      }}
    />
  )
}

命令走句柄,不走 props:

await ref.current?.play()
ref.current?.seek(30)
ref.current?.setQuality('auto')
ref.current?.setSubtitle(1)       // id 来自 onReady 的 subtitles[]
await ref.current?.enterFullscreen()

边界

  • 只做技术——播放能力、事件、命令、容错。品牌 UI(结束覆盖层、清晰度菜单、皮肤)归团队封装层,不在本包(ADR-021)
  • props 面刻意和 react-frame 对齐(去掉 iframe 专属的 origin / version),团队封装层在 inline / iframe 间切换成本最低(cross-mode-parity 测试保障)
  • 认证只支持签名 URL,不接受自定义请求头(ADR-022)
  • getPlayerHandle() 是逃生舱,返回底层 player-core 句柄,给需要绕过 React 直接下命令的高级场景

相关

MIT