@eyevinn/whpp-client

中文文档
0.1.2发布于 2022/08/17MITTypeScriptESM + CJS零依赖近 30 天下载 2.8万

WebRTC HTTP Playback Protocol client library

原始使用文档
文档目录4 节
  1. Usage
  2. Options
  3. Examples
  4. About Eyevinn Technology

WHPP Client Library

License: MIT Slack

A Node / JS library for WebRTC HTTP Playback Protocol

For more information about WHIP and WHPP read this blog post.

Usage

npm install --save @eyevinn/whpp-client

Example on how to implement the WHPP library in browser.

import { WHPPClient } from "@eyevinn/whpp-client";

const video = document.querySelector("video");
const peer = new RTCPeerConnection({ iceServers: [{ urls: "stun:stun.l.google.com:19302" }] });
peer.ontrack = (ev) => {
  if (ev.streams && ev.streams[0]) {
    video.srcObject = ev.streams[0];
  }
};
const client = new WHPPClient(peer, "http://localhost:8001/broadcaster/channel/test");
await client.connect();

Options

{
  debug?: boolean; // Use debug logging
  noIceTrickle?: boolean; // Wait for all ICE candidates to be gathered
  timeout?: number; // Timeout for gathering ICE candidates
  useLegacyContentType?: boolean; // WHPP endpoints that does not support the `whpp+json` content type
}

Examples

ExampleDescriptionSource
npm run example:webWHPP implementation in browserexamples/web.html

About Eyevinn Technology

Eyevinn Technology is an independent consultant firm specialized in video and streaming. Independent in a way that we are not commercially tied to any platform or technology vendor.

At Eyevinn, every software developer consultant has a dedicated budget reserved for open source development and contribution to the open source community. This give us room for innovation, team building and personal competence development. And also gives us as a company a way to contribute back to the open source community.

Want to know more about Eyevinn and how it is to work here. Contact us at [email protected]!

版本与发布记录

@eyevinn/whpp-client 共发布 3 个版本,首次发布于 2022/06/26;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.1.2latest2022/08/174 年前
0.1.12022/06/264 年前
0.1.02022/06/264 年前

关于 @eyevinn/whpp-client 的常见问题

@eyevinn/whpp-client 是什么?

WebRTC HTTP Playback Protocol client library

如何安装 @eyevinn/whpp-client?

在项目目录运行 npm install @eyevinn/whpp-client,或使用 pnpm add / yarn add / bun add。

@eyevinn/whpp-client 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@eyevinn/whpp-client 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@eyevinn/whpp-client 可以商用吗?

@eyevinn/whpp-client 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@eyevinn/whpp-client 的下载量有多少?

根据 npm 官方下载统计,@eyevinn/whpp-client 在 2026/10/14 – 2026/11/12 这 30 天内被下载 27,573 次,日均约 919 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@eyevinn/whpp-client 还在维护吗?

最新版本 0.1.2 发布于 2022/08/17(4 年前);至今共发布 3 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/06/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。