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

hwplayer

v1.0.5

Published

huawei live web player hwplayer

Downloads

8

Readme

hwplayer

将华为的直播web播放脚本hwplayer转为npm包

目前暂时只支持播放mp4

安装

npm i hwplayer

引入

import { hwplayerloaded, HWPlayer } from "hwplayer";

使用方法

hwplayerloaded(function () {
  let options = {
    //是否显示控制栏,包括进度条,播放暂停按钮,音量调节等组件
    controls: true,
    autoplay: true,
    userId: "playerDemo01",
    domainId: "hwPlayer",
    width: 375,
    height: 212,
    playbackRates: [0.5, 1, 1.5, 2],
    loop: true,
    muted: true,
  };
  let player = new HWPlayer("test", options, () => {
    //播放器已经准备好了
    player.src({
      src:
      "https://35.cdn-vod.huaweicloud.com/asset/ba4f5df688f4ed6f569470d688ec4a22/c5d8003cb1d108035d3a902adb2bc5cc.mp4", //视频地址
      type: "video/mp4",
    });
    // "this"指向的是HWPlayer的实例对象player
    player.play();
    // 使用事件监听
    player.on("ended", function () {
      //播放结束了
      console.log("end playing");
    });
    player.on("play", function () {
      console.log("start playing");
    });
  });
});