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

rc-dplayer

v1.0.0

Published

This is a wrapper of [DPlyer](https://github.com/DIYgod/DPlayer);

Downloads

355

Readme

rc-dplayer

This is a wrapper of DPlyer;

It contains hls.js and flv.js,you can play your video directly.

As of version 1.0.0, the HLS protocol supports HEVC encoding.

Since Chrome 107 version supports HEVC hardware decoding function, this project upgrades hls.js and realizes HLS + HEVC video stream playback based on hardware decoding capability

Install

npm

npm install rc-dplayer

pnpm

pnpm add rc-dplayer

Examples

import { Player as RcDPlayer } from "rc-dplayer";

const App = () => {
  return (
    <RcDPlayer
      src="/test.mp4"
      options={{
        autoplay: true,
      }}
      onLoad={(dp) => {
        console.log("DPlayer instance", dp);
      }}
      onError={(event) => {
        console.error("error", event);
      }}
    />
  );
};

Props

| name | type | description | default | | ----------------- | --------------------- | ------------------------------------------------ | --------------- | | src | string | Video source . | - | | mseType | MseType | MSE type . | MseType.default | | autoLoad | boolean | Auto load video when it`s true and src exits. | true | | options | DPlayerOptions | The other options of DPlayer . | - | | customControllers | CustomController[] | Custom controller | - | | onLoad | (dp: DPlayer) => void | Callback of player loaded | - |

Events

Support HTML media events and DPlayer events.

// React DPlayer Events
export interface DPlayerEventsProps {
  onScreenshot?: (blobUrl: string) => void;
  onThumbnailsShow?: () => void;
  onThumbnailsHide?: () => void;
  onDanmakuShow?: () => void;
  onDanmakuHide?: () => void;
  onDanmakuClear?: () => void;
  onDanmakuLoaded?: () => void;
  onDanmakuSend?: () => void;
  onDanmakuOpacity?: () => void;
  onContextmenuShow?: () => void;
  onContextmenuHide?: () => void;
  onNoticeShow?: () => void;
  onNoticeHide?: () => void;
  onQualityStart?: () => void;
  onQualityEnd?: () => void;
  onDestroy?: () => void;
  onFullscreen?: () => void;
  onFullscreenCancel?: () => void;
  onSubtitleShow?: () => void;
  onSubtitleHide?: () => void;
  onSubtitleChange?: () => void;
}

Interface

export enum MseType {
  hls = "m3u8",
  flv = "flv",
  default = "default",
}
type ControllerPosition = "left" | "right";

export interface CustomController {
  key: Key;
  position: ControllerPosition;
  component: ReactNode;
  onClick?: (event: ReactMouseEvent<HTMLDivElement, MouseEvent>) => void;
}

Ref methods

| name | type | description | | ---- | -------------------------------------------- | ------------------------ | | load | (url?: string, mseType?: MseType) => DPlayer | Load video by yourself . |

License

rc-dplayer is released under the MIT license.