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

zlm-client

v1.0.0

Published

基于ZLMediakit的,原本的js只能用js对象引入的方式,这个项目是基于esmodule的方式,方便在项目中引入

Readme

zlm-client

根据zlmediakit-client的修改版本,原本这个项目很多问题,但是无法提交issue,无奈之下只能自己修改

Install

npm install zlm-client

Usage

import {Events, Endpoint} from "zlmrtc-client"

//对讲实例创建
const broadcastRtc = new Endpoint({
    debug: env,
    zlmsdpUrl: url,
    simulcast: false, // simulecast 错别字 fixed
    useCamera: false,
    audioEnable: false, // 一般不需要音频
    videoEnable: true, // false无法播放
    recvOnly: true, // 不然会请求分享屏幕的权限,很烦
});
// 不支持webrtc
broadcastRtc.on(Events.WEBRTC_NOT_SUPPORT, () => {
    console.log("不支持webrtc");
});

Endpoint Options

| 属性/参数 | 类型 | 描述 | | :--: |:------:|:-------------------------------------------------------| | element | Object | 用于显示接收到的远程媒体流的video元素 | | debug | Boolean | 指定是否启用调试模式。启用后输出调试日志,有助于问题的排查和调试 | | zlmsdpUrl | String | 指向用于SDP(会话描述协议)消息交换的服务器的URL。在WebRTC通信中,SDP消息用于协商媒体流的参数 | | simulcast | Boolean | 指定是否启用多路复用(Simulcast)。允许同时发送多个分辨率和比特率的视频流 | | useCamera | Boolean | 指定是否使用摄像头作为视频源。如果为false,可能需要使用屏幕共享或其他视频源 | | audioEnable | Boolean | 是否启用音频流 | | videoEnable | Boolean | 是否启用视频流 | | recvOnly | Boolean | 指定是否仅接收媒体流(即作为接收端)。如果为true,则不会发送本地媒体流到远端 | | resolution | Object | 指定期望的视频分辨率。包含w(宽度)和h(高度)属性。如果这两个值非零,则用于设置视频流的分辨率 | | usedatachannel | Boolean | 指定是否使用数据通道(DataChannel)。数据通道允许在WebRTC连接上直接发送和接收任意数据 | | videoId | String | 视频id | | audioId | String | 音频id |

Events Options

| 事件 | 描述 | | -- | --- | | WEBRTC_NOT_SUPPORT | 浏览器不支持WebRTC | | WEBRTC_ICE_CANDIDATE_ERROR | ICE候选收集过程中发生错误 | | WEBRTC_OFFER_ANSWER_EXCHANGE_FAILED | Offer/Answer交换失败 | | WEBRTC_ON_REMOTE_STREAMS | 接收到远程媒体流 | | WEBRTC_ON_LOCAL_STREAM | 获取到本地媒体流 | | WEBRTC_ON_CONNECTION_STATE_CHANGE | WebRTC连接状态发生变化 | | WEBRTC_ON_DATA_CHANNEL_OPEN | 数据通道成功打开 | | WEBRTC_ON_DATA_CHANNEL_CLOSE | 数据通道关闭 | | WEBRTC_ON_DATA_CHANNEL_ERR | 数据通道发生错误 | | WEBRTC_ON_DATA_CHANNEL_MSG | 接收到数据通道消息 | | CAPTURE_STREAM_FAILED | 捕获媒体流失败 |