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 🙏

© 2025 – Pkg Stats / Ryan Hefner

shixincube

v3.0.1

Published

魔方实时通信/协作引擎(Cube Engine)是一个全能力的实时云端协作引擎

Readme

魔方实时通信/协作引擎

魔方实时通信/协作引擎(Cube Engine)是一个全能力的实时云端协作引擎。功能包括音频通话、视频通话、即时消息、文件分享功能。支持 Android,iOS,Windows,Mac OS X,Linux 等操作系统,支持 Chrom、Firefox、Opera、Safari、IE 11、360安全浏览器等浏览器。

此文档是魔方引擎的 HTML5/JavaScript 使用手册。

入门指南

获取代码

在页面中引入魔方的 JavaScript 代码:

<script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/Genie-min.js"></script> <script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/cube-core.js"></script> <script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/cube-message.js"></script> <script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/cube-signaling.js"></script> <script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/cube-sipworker.js"></script> <script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/cube-whiteboard.js"></script> <script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/cube-instruction.js"></script> <script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/cube-file.js"></script> <script type="text/javascript" src="http://cube.getcube.cn/webSourceCode/dist/cube-rd.js"></script>

  • Genie.js 为引擎依赖库

  • cube-core.js 引擎核心库

  • cube-message.js 即时消息库

  • cube-signaling.js 音视频通话库

  • cube-sipworker.js 音视频会议库

  • cube-whiteboard.js 白板库

  • cube-instruction.js 指令传输库

  • cube-file.js 文件管理库

  • cube-rd.js 远程桌面库

  • 由于部分浏览器对摄像头的访问权限限制问题, 如果您需要使用音视频通话模块, 我们建议将脚本下载到本地使用, 并提供https安全连接的方式以供您的用户访问.

启动引擎

在页面初始化后调用 window.cube.startup() 进行引擎初始化。根据需要加载魔方的各子模块:

  • 加载消息模块: window.cube.loadMessager()
  • 加载音视频通话模块: window.cube.loadSignaling("local_video", "remote_video", "call_audio");
  • 加载会议模块: window.cube.loadConference("local_video", "remote_video", "call_audio", "local_canvas");
  • 加载白板模块: window.cube.loadWhiteboard("wb_canvas")
  • 加载指令模块: window.cube.loadInstruction();
  • 加载文件管理模块: window.cube.loadFileManager();
  • 加载远程桌面模块: window.cube.loadRemoteDesktop("remoteDesktopLib", "viewDom");

获取服务

魔方引擎通过获取各个模块的服务来获得应用与引擎之间的交互对象

  • 获得账号服务: window.cube.getUserService()
  • 获得群组服务: window.cube.getGroupService()
  • 获得消息服务: window.cube.getMessageService()
  • 获得音视频通话服务: window.cube.getCallService()
  • 获得媒体服务: window.cube.getMediaService()
  • 获得会议服务: window.cube.getConferenceService()
  • 获得白板服务: window.cube.getWhiteboardService()
  • 获得指令服务: window.cube.getInstructionService()
  • 获得文件管理服务: window.cube.getFileManagerService()
  • 获得远程桌面服务: window.cube.getRemoteDesktopService()

设置监听器

魔方引擎通过设置对应的监听器来获得引擎的工作状态。

  • 添加账号监听器: window.cube.getUserService.addListener()
  • 添加群组监听器: window.cube.getGroupService().addListener()
  • 添加消息监听器: window.cube.getMessageService().addListener()
  • 添加视频通话监听器: window.cube.getCallService().addListener()
  • 添加媒体探针: window.cube.getMediaService().addMediaProbe()
  • 添加会议监听器: window.cube.getConferenceService().addListener()
  • 添加白板监听器: window.cube.getWhiteboardService().addListener()
  • 添加指令监听器: window.cube.getInstructionService().addListener()
  • 添加文件管理监听器: window.cube.getFileManagerService().addListener()
  • 添加远程桌面监听器: window.cube.getRemoteDesktopService().addListener()