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 🙏

© 2024 – Pkg Stats / Ryan Hefner

inl-util

v0.0.9

Published

工业工具库

Downloads

3

Readme

工业 util 库

WebRtc 视频播放[美腾]

import { webRtcMt } from "inl-util";
import { WebRtc } from "inl-util/dist/types/src/webRtc";

// 自动播放 不需要手动播放
const wr = new webRtcMt(opt as WebRtc);

// 只提供了停止播放方法,可传入 视频id dom id,来关闭指定播放器,如果不传会关闭全部视频
// 停止播放
wr.stopPlay();

参数描述(WebRtc)

export interface WebRtc {
  el: HTMLElement;
  w?: number;
  h?: number;
  autoPlay: boolean;
  plays: PlayVideoArgs | Array<PlayVideoArgs>;
  endpointConfig?: EndpointConfig;
}

| 参数 | 说明 | 类型 | 默认值 | | :------------: | :----------------------------------------------------- | :--------------------------------------: | ------ | | el | 父级别盒子(暂时无效,可用 body 代替) | HTMLElement | 必填 | | w | 视频窗口宽度 | Number | auto | | h | 视频窗口高度 | Number | auto | | autoPlay | 自动播放(目前无法更改,全部自动播放) | boolean | true | | plays | 播放视频源信息 PlayVideoArgs | PlayVideoArgs 、 Array<PlayVideoArgs> | null | | endpointConfig | 视频配置类型 | EndpointConfig | {} |

参数描述(PlayVideoArgs)

export interface PlayVideoArgs {
  videoElm: string;
  mediaServerAddr: string;
  cameraUserName: string;
  cameraPwd: string;
  cameraIp: string;
  cameraRtspPort: string;
  cameraChannel: string;
  cameraStream: string;
  codeStream: string;
}

| 参数 | 说明 | 类型 | 默认值 | | :-------------: | :----------- | :-------------: | ------ | | videoElm | domId | string | | | mediaServerAddr | 媒体服务地址 | string | | | cameraUserName | 用户名 | string | | | cameraPwd | 密码 | string | | | cameraIp | 相机 Ip | string | | | cameraRtspPort | 相机 端口 | Number | | | cameraChannel | 相机 通道 | string | | | cameraStream | 相机 Stream | string | | | codeStream | 相机 码流 | 'main' | 'sub' | |

参数描述(EndpointConfig)

export interface EndpointConfig {
  debug: boolean;
  simulcast: boolean;
  useCamera: boolean;
  audioEnable: boolean;
  videoEnable: boolean;
  recvOnly: boolean;
}

| 参数 | 说明 | 类型 | 默认值 | | :---------: | :------------------------- | :--------: | ------ | | debug | 是否输出 log | boolean | | | simulcast | 是否本地流和远程流同时播放 | boolean | | | useCamera | 是否使用用户相机 | boolean | | | audioEnable | 是否启用音频 | boolean | | | videoEnable | 是否启用视频 | boolean | | | recvOnly | 只接收数据 | boolean | |