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

ueplayer

v1.0.6

Published

> 这是自定义的虚幻引擎像素流推送播放器,需要配合自建的Match Maker,不要浪费时间下载。

Downloads

361

Readme

如何使用

这是自定义的虚幻引擎像素流推送播放器,需要配合自建的Match Maker,不要浪费时间下载。

1 安装

使用pnpm从git仓库安装,具体的语法见:从git安装npm

pnpm install ueplayer

安装完成后的包名叫:ueplayer

2 更新与发布

这里分两种使用方式:

A. 通过 git 依赖安装

  1. 更新代码后运行 pnpm run build
  2. 提交并推送到 git 仓库
  3. 依赖仓库执行 pnpm update ueplayer 或重新安装

B. 发布到 npm(推荐)

  1. 先更新 package.jsonversion(或使用 npm version patch|minor|major
  2. 运行 pnpm run build
  3. 执行 npm publish(或 pnpm publish
  4. 依赖仓库执行 pnpm update ueplayer

版本维护说明

  • 如果走 npm 发布,每次发布都必须是新版本号(需要你自己维护)。
  • 如果走 git 依赖,版本号不会被 npm 校验,但建议保持递增,方便追踪。

3 使用

import { Player } from 'ueplayer'; // for vite user

import { Player, Resolutions } from 'ueplayer/build/player' // for webpack user
import 'ueplayer/build/style.css' // for webpack user

function onVideoReady(player: UePlayer) {
    console.log('player loaded and ready to use')
    setTimeout(() => {
        player.emitUIInteraction({
            command: 'freezeFrame',
            params: null
        })
    }, 5000)
}
<Player
    appName="haitai"
    resolution={'auto'}
    enableAudio={true}
    afkTimeoutSeconds={180}
    videoReadyCallback={onVideoReady}
/>

4 参数

注意:api可能随时更新

| 参数 | 类型 | 默认值 | 说明 | |--------------------|----------|------|-------------------------------| | appName | string | - | 应用名称,必填,具体应用名称需要参考数据库 | | resolution | string | auto | 分辨率,可选值:auto、4k、2k、1080p、720p | | enableAudio | boolean | false | 是否协商音频,开启后需要用户首次点击播放区域解锁声音 | | afkTimeoutSeconds | number | 180 | 用户无操作超时断开(最小 60 秒,实际使用 max(60, value)) | | videoReadyCallback | function | null | 视频加载完成后的回调函数,传入UePlayer参数 |

videoReadyCallback的签名如下:

type videoReadyCallback = (player: UePlayer) => void

interface UePlayer {
    emitUIInteraction(descriptor: {
        command: string;
        params: any;
    }): void;
    emitCommand(descriptor: any): void;
    on(command: string, listener: (para: CommonUeSendCommand) => void): void;
}

type CommonUeSendCommand = {
    command: string;
    results: any;
}

5 音频策略说明

  • enableAudio=false 时,前端不会协商音轨,UE 不会向浏览器发送音频。
  • enableAudio=true 时,前端会协商音轨,但浏览器仍需要用户首次点击播放器区域才能解锁播放(自动播放策略限制)。
  • UE 侧如果使用了 -NOSOUND-PixelStreamingWebRTCDisableTransmitAudio=true,即使前端开启音频也不会有声音。

6 AFK(空闲断开)

用户有任意输入会重置计时器;无输入达到 afkTimeoutSeconds 后:

  • 先向 UE 发送 freeze frame
  • 再主动关闭 WebRTC 与 WebSocket

7 UE 侧推荐参数

前端的 x-google-* 码率提示不一定能限制 UE 编码器输出,强制限码率建议在 UE 启动参数中配置

分档建议(单位:bps,1 Mbps = 1000000 bps):

| 目标 | PixelStreamingWebRTCMaxBitrate | PixelStreamingEncoderMaxBitrate | 备注 | |------|--------------------------------|---------------------------------|------| | 2K30 | 20000000 ~ 30000000 | 25000000 ~ 35000000 | 画质与带宽平衡 | | 2K60 | 30000000 ~ 50000000 | 35000000 ~ 60000000 | 动作场景更稳 | | 4K30 | 50000000 ~ 80000000 | 60000000 ~ 90000000 | 需要更高带宽 | | 4K60 | 80000000 ~ 120000000 | 90000000 ~ 140000000 | 高带宽场景 |

如果你的链路上限是 100Mbps 或需要转发,尽量取每档的下限。

推荐(2K60、100Mbps、可能走转发):

-PixelStreamingWebRTCMaxBitrate=25000000
-PixelStreamingEncoderMaxBitrate=30000000

更保守(带宽更紧张):

-PixelStreamingWebRTCMaxBitrate=20000000
-PixelStreamingEncoderMaxBitrate=25000000

音频建议:

  • 需要播放声音:不要设置 -NOSOUND-PixelStreamingWebRTCDisableTransmitAudio=true
  • 不需要麦克风回传:可保留 -PixelStreamingWebRTCDisableReceiveAudio=true