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

webrtc-screen-recorder

v1.0.0

Published

大屏响应式方案插件

Downloads

17

Readme

large-screen-height

介绍

适用大屏项目的响应式方案

安装教程

npm i webrtc-screen-recorder -s

API 说明


/**
 * 构造函数,初始化录制选项和相关变量
 * @param {Object} options - 用户自定义的录制选项
 默认的录制选项
 {
        // 视频录制的相关选项
        video: {
            cursor: 'always', // 鼠标状态
            frameRate: 30, // 视频帧率
        },
        // 是否录制音频
        audio: true,
        // MediaRecorder 的配置选项
        mediaRecorderOption: {
            videoBitsPerSecond: 2500000, // 视频比特率
            mimeType: 'video/webm', // 录制媒体的 MIME 类型
            audioBitsPerSecond: 128000, // 音频比特率,128 kbps
        },
        // 录制频率,每 1000 毫秒推流录制一次
        rcordFrequency: 1000,
        // 是否优先录制当前标签页
        preferCurrentTab: false,
 }
 */

 new Recorder(options)



/**
 * 启动屏幕录制功能
 * @param {Function} availableCallback - 当数据可用时调用的回调函数
 * @returns {Promise<boolean>} - 返回一个Promise,指示录制是否成功开始
 */
  start()

/**
 * 停止屏幕录制
 *
 * 本方法用于停止屏幕录制功能,清除当前的视频源和blob对象,并从WebScreenRecorder中获取停止录制后的视频数据
 * 它创建一个新的blob对象表示的视频源,并返回包含视频数据和视频源URL的对象
 *
 * @returns {Object} 包含视频blob对象和视频源临时URL的对象
 */
stop ()


/**
 * 下载录制的视频文件
 *
 * 该函数用于触发浏览器下载一个视频文件如果提供了文件名参数,则使用该名称作为下载文件的名称
 * 如果没有提供,则使用默认名称如果录制的视频数据(videoBlob)不存在,则在控制台输出错误信息
 * 并返回 false,表示下载失败如果视频数据存在,则创建一个临时的 URL 对象,生成一个隐藏的<a>标签
 * 用于下载,并在用户点击后触发下载功能,最后移除临时的 URL 对象和<a>标签
 *
 * @param {string} [name] - 可选参数,指定下载文件的名称如果没有提供,默认为'screen_recording'
 * @returns {boolean} - 返回 true 表示下载成功,返回 false 表示下载失败
 */

 downloadRecording()

使用说明

<script setup>
import Recorder from 'webrtc-screen-recorder'
const  webRtcRecorder = Recorder()
let callback = (blob,times) => {
    console.log('实时视频流blob,录制时间times')
}
<!-- 开始录制 -->
webRtcRecorder.start(callback)

<!-- 停止录制 -->
webRtcRecorder.stop()

<!-- 下载录制的视频 -->
webRtcRecorder.downloadRecording('视频名称')

</script>

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request