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

cve-connector

v0.5.1

Published

UE Web 开发套件

Readme

Connector 是用于 UE5 像素流播放的插件,包含 <cve-player> 组件,15 个 Controller ,点/线/面/体 4 种 Features ,及若干云渲染相关方法。

版本变更

[0.5.0]

破坏性变更

  • 方法: 移除 sendCommand 方法,Web 端调用 UE 的自定义指令使用 executeCustomCommand
  • 事件: 移除原方位角变化事件 yaw,替换为 azimuthchange
  • 接口: PointText01 的自定义参数重做,具体参数见 features.md 文档

新增

  • 方法: Web 端调用 UE 的自定义指令的方法 executeCustomCommand

  • 事件: 方位变化事件 azimuthchange

  • 接口: TimeController 新增方法 enableTimeChangeEventdisableTimeChangeEvent,用于控制 UE 端时间变化主动推送至 Web 端事件的启用或禁用

  • 接口: ViewController 新增方法 enableAzimuthChangeEventdistableAzimuthChangeEvent,用于控制 UE 端视角方位角变化主动推送至 Web 端事件的启用或禁用

说明:

  • azimuthchangetimechange 事件默认不生效,避免在多数情况下,UE 端向 Web 端推送过多消息的问题

  • Web 端监听时间变化事件,需先调用 TimeController.enableTimeChangeEvent() 方法,再执行 listen('timechange', callback)

  • Web 端监听方位变化事件,需先调用 ViewController.enableAzimuthChangeEvent() 方法,再执行 listen('azimuthchange', callback)

修复

  • 缺陷: 调用点线面体数据构造方法,返回对象的 Parameters 属性默认值为 {} 空对象,无需手动添加此属性

其他

  • 特性: 日志的默认级别调整为2,默认包含 Web 端向 UE 端发送的指令、UE 端向 Web 端的指令响应消息、UE 端向 Web 端主动推送的 Action 相关消息

[0.4.0]

破坏性变更

  • 特性: PixelStreaming 官方依赖升级到 5.5 版本,云渲染管理器中信令服务必须升级到 5.5 才可用

新增

  • 接口: Measure Controller 新增 start、cancel、clear、clearAll 方法,支持测距、测高、测面积
  • 事件: 测量事件 measurefinish

[0.3.11]

新增

  • 方法: useWebBrowser,基于新版本 CVE 套件,Web 卡片的通讯方案
  • 方法: useWebView2,基于新版本 CVE 套件,使用 UE 内嵌入 Web 开发模式的通讯方案
  • 接口: RenderController,一维水动力可视化相关方法(创建、删除、更新、显示、隐藏)

修复

  • 接口:GisController 相关变量类型校正,引用类型 => 基本类型

使用

安装

  • npm
npm install cve-connector@latest
  • yarn
yarn add cve-connector@latest

集成到 Web 页面

  • 在 HTML 模板内使用之前,必须先引入!
  • <cve-player> 的高度不能为 0!
  • 基于模板渲染设置事件回调函数时(以 Vue2 为例):
<cve-player
  application-name="HdecUnrealHaining"
  matchmaker-url="http://localhost:1234"
  @error="onError"
  @start="onStart"
>
</cve-player>

<script type="module">
import { defineContainer } from 'cve-connector'

defineContainer()

export default {
  methods: {
    onStart(evt) {
      console.warn('start ===> ', evt.detail)
    },
    onError(evt) {
      console.error('error ===> ', evt.message)
    },
  }
}
</script>
  • 不基于前端框架的集成示例
<!-- HTML Template -->
<cve-player
  application-name="HdecUnrealHaining"
  matchmaker-url="http://localhost:1234"
>
</cve-player>

<script type="module">
import { defineContainer } from 'cve-connector'

defineContainer((player) => {
  player.addEventListener('start', (evt) => {
    console.warn('start ===> ', evt.detail)
  })
  player.addEventListener('error', (evt) => {
    console.error('error ===> ', evt.message)
  })
})
</script>

属性

<cve-player
  application-name="HdecUnrealPinglu"
  aspect-ratio="auto"
  matchmaker-url="http://39.170.3.124:80/"
  volume="0.3"
>
</cve-player>

application-name

  • 必要属性
  • UE 应用名称,联系 UE 研发人员确认
  • 无默认值

aspect-ratio

  • 可选属性
  • 云渲染视口纵横比例
  • 设置 aspect-ratioauto 时,heightwidth 比例应一致或不设置
  • 示例: 'auto', '16 / 9', '4 / 3'
  • 默认值: 'auto'
  • 补充三种使用情况说明
  • 1、不设置height、width、aspect-ratio
  • 2、设置height、width,但不设置 aspect-ratio
  • 3、不设置height、width,设置 aspect-ratio

matchmaker-url

  • 可选属性
  • 云渲染源地址,协议://主机:端口/路径
  • 无默认值

signaling-url

  • 可选属性
  • 信令服务地址,协议://主机:端口/路径
  • 无默认值

volume

  • 可选属性
  • UE 音量
  • 默认值: 0.3

事件

CvePlayer 扩展了 HTMLELment,有更多的事件回调。

| Event | Description | | ------- | ------------------ | | command | Web 发送指令到 UE | | error | 云渲染异常 | | message | UE 传递消息到 Web | | start | 云渲染开始 | | stop | 云渲染结束 |

  • 全局环境下,有且仅有一个 player 元素,请导入后使用;
  • player 可能为空(尚未初始化),请注意校验;
export class CvePlayer extends HTMLELment {
  oncommand?: (evt: CustomEvent<UIDescriptor>) => void
  onerror?: (evt: ErrorEvent) => void
  onmessage?: (evt: CustomEvent<UIDescriptor>) => void
  onstart?: (evt: CustomEvent<number>) => void
  onstop?: (evt: CustomEvent<string>) => void
}
export let player: CvePlayer | undefined

云渲染控制

connect2Matchmaker

import { connect2Matchmaker } from 'cve-connector'
// 运行云渲染程序,使用绑定的源地址和应用名称
connect2Matchmaker()

connect2Signaling

import { connect2Signaling } from 'cve-connector'
// 输入像素流实例地址,重新渲染
connect2Signaling('http://localhost:8081')

defineContainer

import { defineContainer } from 'cve-connector'
// 云渲染插件初始化后,立即执行回调函数
defineContainer(async () => {
  if (!player) {
    return
  }

  player.onstart = () => {
    const reference: CVE.GeoReference = {
      IsOriginLocationInProjectedCRS: true,
      OriginCenter: [116, 39, 100],
    }
    GisController.config(reference)
  }
})

disconnect

import { disconnect } from 'cve-connector'
// 停止渲染
disconnect()

listen

import { listen } from 'cve-connector'
// 监听鼠标点击事件
listen('mouseclick', function(e) {
  console.log(e)
})

requestInstance

import { requestInstance } from 'cve-connector'
// 获取云渲染实例
requestInstance('http://127.0.0.1:8080', 'HdecUnrealDemo')

unlisten

import { unlisten } from 'cve-connector'
// 取消监听鼠标点击事件
unlisten('mouseclick', function(e) {
  console.log(e)
})

useWebBrowser

import { useWebBrowser } from 'cve-connector'
// 基于新版本 CVE 套件,Web 卡片的通讯方案
useWebBrowser()

useWebView2

import { useWebView2 } from 'cve-connector'
// 基于新版本 CVE 套件,使用 UE 内嵌入 Web 开发模式的通讯方案
useWebView2()

补充说明

关于 Controller 和 Feature 的内容,请查看 cve-connector 插件 /docs 目录下相关文档。