项目作者: vortesnail

项目描述 :
:clapper: A lightweight and sophisticated React-based H5 video player / 简单易用的h5播放器
高级语言: JavaScript
项目地址: git://github.com/vortesnail/qier-player.git






QierPlayer








Gzip Size




Introduction

QierPlayer is a simple and easy-to-use H5 video player with a highly customizable UI and rich features, supporting Danmaku (bullet comments).

Documentation and Demo

QierPlayer Documentation

Screenshots



Quick Start

Installation

Install via npm:

  1. npm install qier-player
  2. # or
  3. yarn add qier-player
  4. # or
  5. pnpm install qier-player

Usage

  1. import Player from 'qier-player';
  2. const player = new Player({
  3. src: 'https://vortesnail.github.io/qier-player/test-video_1080p.mp4',
  4. });
  5. player.mount('#app');

Danmaku

The Danmaku feature is available as a separate library @qier-player/danmaku"">@qier-player/danmaku. It is essentially independent of the video player and only requires a container.

Installation

Install via npm:

  1. npm install @qier-player/danmaku
  2. # or
  3. yarn add @qier-player/danmaku
  4. # or
  5. pnpm install @qier-player/danmaku

Usage

  1. import Player, { EVENT } from 'qier-player';
  2. import Danmaku from '@qier-player/danmaku';
  3. const player = new Player({
  4. src: 'https://vortesnail.github.io/qier-player/test-video_1080p.mp4',
  5. });
  6. player.mount('#app');
  7. // Create a container for Danmaku
  8. const danmuWrapper = document.createElement('div');
  9. danmuWrapper.style.cssText = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden;';
  10. player.el.appendChild(danmuWrapper);
  11. // Danmaku instance
  12. const danmaku = new Danmaku(danmuWrapper, {
  13. eventProxyElement: danmuWrapper,
  14. });
  15. player.on(EVENT.PLAY, () => {
  16. danmaku.start();
  17. });
  18. player.on(EVENT.PAUSE, () => {
  19. danmaku.stop();
  20. });
  21. danmaku.add(
  22. {
  23. text: 'The weather is nice today, hello everyone',
  24. color: '#fff',
  25. },
  26. 'rolling',
  27. );

For more detailed usage, refer to Danmaku.