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

@vmaos/web-cast-sdk

v1.0.2

Published

VMAOS 官方 Web 端云手机投屏与实时操控 SDK

Readme

@vmaos/web-cast-sdk

VMAOS 官方 Web 端云手机投屏与实时操控 SDK

快速上手

安装/引入

npm install @vmaos/web-cast-sdk

import { UniSDK } from '@vmaos/web-cast-sdk/uni-sdk';

初始化配置

| 属性 | 描述 | 必填 | | :--- | :--- | :--- | | mountedElement | 挂载节点,支持 HTMLElement 实例或选择器/节点 ID。 | 必填 | | connectConfig | 连接配置信息,通过后端提供的连接配置接口获取。 | 必填 | | isGroup | 是否开启群控。默认为 false。 | 可选 | | enabledDebug | 是否开启调试模式/日志输出。默认为 false。 | 可选 | | disabledVerticalSwipe | 是否阻止竖向滑动。默认为 false。 | 可选 | | disabled | 是否禁用键盘事件处理。默认为 false。 | 可选 | | enabledIMEKeyboard | 是否开启 IME 输入法键盘映射。默认为 false。 | 可选 | | cursorType | 鼠标形状样式,默认为 default。可选值及对应枚举:• default: UniSDK.CURSOR_TYPE.DEFAULT_CURSOR• circle: UniSDK.CURSOR_TYPE.CIRCLE_CURSOR• triangle: UniSDK.CURSOR_TYPE.TRIANGLE_CURSOR | 可选 |

实例方法

| 方法 | 描述 | | :------------- | :------------- | | goHome | 返回首页 (对应 Android Home 键) | | goTask | 任务列表 (对应 Android 任务键) | | goBack | 返回 (对应 Android 返回键) | | enableAudio | 开启音频 | | disableAudio | 禁用音频 | | sendClipboardData | 发送剪切板数据 | | openIMEKeyboard | 开启键盘映射 | | closeIMEKeyboard | 关闭键盘映射 | | switchToGestureNavigation | 切换手势导航 | | switchToThreeButtonNavigation | 切换三按钮导航 | | changeLevel | 设置清晰度,通过 UniSDK.CLARITY_LEVEL 访问对应的支持清晰度,目前支持流畅、标清、超清 | | destroy | 销毁 SDK 实例 |

事件监听 (Events)

通过 player.addListener(event, callback) 进行监听:

| 事件枚举 (UniSDK.EVENTS) | 回调参数 | 描述 | | :--- | :--- | :--- | | CONNECTED | - | 建立连接成功 | | LOADED_SUCCESS | - | 投屏加载成功 | | LOADED_FAILURE | error: any | 投屏加载失败 | | STOP_CONNECT | - | 连接断开 | | STATISTIC_INFO | info: StatisticInfo | 实时统计信息更新 (含 framesPerSecond, bitrate, lostRate, currentRoundTripTime, averageDecodeTime) | | CLARITY_LEVEL_CHANGE | level: number | 清晰度变更通知 | | ERROR | error: Error | 投屏相关错误 |

错误码

| 错误码 | 左对齐 | 等级 | |:------|:--------------|:--:| | 10001 | WebSocket连接失败 | 高 | | 10002 | WebSocket已关闭 | 高 | | 10003 | 创建offer失败 | 高 | | 10004 | 处理offer失败 | 高 | | 10005 | 创建answer失败 | 高 | | 10006 | 处理answer失败 | 高 | | 10007 | 设置本地描述失败 | 高 | | 10008 | 设置远端描述失败 | 高 | | 10009 | 处理 ICE 交换失败 | 高 | | 10010 | ICE 状态异常 | 高 | | 10011 | 摄像头异常 | 高 | | 10012 | 云机已关机或者不存在 | 高 | | 10013 | 信令通道错误 | 低 | | 10014 | webrtc统计信息获取失败 | 低 |

完整示例

  const config = {} // 通过提供的连接配置接口获取 connectConfig 配置

  const player = new UniSDK({
      mountedElement: "#player-mounted",  // 挂载节点,可以是 HTMLElement 或者 节点 ID
      isGroup: false, // 群控模式,默认 false
      disabled: true, // 禁用键盘事件
      enabledDebug: process.env.NODE_ENV !== 'production', // 开发环境下开启日志,默认 false
      disabledVerticalSwipe: false, // 是否阻止竖向滑动默认 false
      enabledIMEKeyboard: false,     // 是否开启键盘映射,默认 false
      cursorType: UniSDK.CURSOR_TYPE.CIRCLE_CURSOR, // 光标类型,默认 CIRCLE_CURSOR
      connectConfig: {
        ...config
      }
  });

  player.addListener(UniSDK.EVENTS.CONNECTED, () => {
      console.log('建立连接');
  });

  player.addListener(UniSDK.EVENTS.LOADED_SUCCESS, () => {
      console.log('投屏成功');
  });

  player.addListener(UniSDK.EVENTS.LOADED_FAILURE, (error: any) => {
      console.log('投屏失败', error);
  });

  player.addListener(UniSDK.EVENTS.STATISTIC_INFO, (info: any) => {
      console.log('统计信息', info); // 参考上面的统计信息表格
  });

  player.addListener(UniSDK.EVENTS.CLARITY_LEVEL_CHANGE, (level: number) => {
      console.log('清晰度更新', level);
  });
  
  player.init();