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

dt-record-controller

v1.0.4

Published

send command to dengta recording service to control start/stop

Downloads

15

Readme

v1.0.4

  • 加入retry允许重试

v1.0.3

  • 更新readme

v1.0.2

  • 去掉端口特性,默认4444端口

v1.0.1

  • 修复url里有#时取参数无效的bug
  • 修复stopRecord的bug

v1.0.0

第一版上线

如何安装

使用如下命令安装

npm install dt-record-controller --save

如何使用

  1. 引入库里的三个函数,分别是初始化,开始录制命令,结束录制命令
import { initRecordController, startRecord, stopRecord, retry } from "dt-record-controller";
  1. 在页面执行入口处,如create,mount这里,首选执行
initRecordController()
  1. 在需要开始录像的地方执行
startRecord()
  1. 在需要结束录像的地方执行
stopRecord()
  1. 如果在加载阶段捕获到错误,需要重试,可以发起重试
retry()

示例代码

<template>
  <div class="video_holder">
    <img :src="gif" alt="" class="the_gif" />
  </div>
</template>

<script>
import { initRecordController, startRecord, stopRecord } from "dt-record-controller";

export default {
  data() {
    return {
      gif: require("./200w.webp"),
    };
  },
  methods: {
    async sleep(seconds) {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve();
        }, seconds);
      });
    },
  },
  async mounted() {
    //初始化录制器
    initRecordController();

    //这里模拟的是预加载过程
    //需要预加载好字体,图片,视频,数据等所有需要录制的资源,避免录制开始后才开始加载
    await this.sleep(Math.random() * 10 * 1000);

    //发送开始录制命令,如果超过3分钟未发送开始命令,会让录制任务失败
    startRecord();

    //这里模拟的是视频录制中
    await this.sleep(Math.random() * 10 * 1000);

    //发送结束录制命令,如果超过10分钟未发送结束命令,会让录制任务失败
    stopRecord();
    
  },
};
</script>

如何调试

页面里使用如上语句后,即可在浏览器f12的console一栏看到每个命令的执行打印。
==============initRecordController==============
==============StartRecord==============
==============StopRecording==============
如看到打印,说明代码使用无误;
如未看到,说明未按预期执行开始命令或结束命令,请自行检查逻辑!