-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f8b9cf
commit 7397160
Showing
7 changed files
with
168 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,125 @@ | ||
<div align="center"> | ||
<a href="https://github.com/vortesnail/qier-player"> | ||
<img src="website/public/img/logo.svg" height="140" width="140"/> | ||
<img src="website/docs/public/logo.svg" height="140" width="140" /> | ||
</a> | ||
<h4>qier-player</h4> | ||
<br> | ||
<a href="https://www.npmjs.com/package/qier-player"> | ||
<img src="https://img.shields.io/npm/v/qier-player?style=flat-square&logo=npm"> | ||
</a> | ||
<a href="https://unpkg.com/qier-player@latest/dist/umd/index.min.js"> | ||
<br /> | ||
<a href="https://www.npmjs.com/package/qier-player"> | ||
<img src="https://img.shields.io/npm/v/qier-player?style=flat-square&logo=npm" /> | ||
</a> | ||
<a href="https://unpkg.com/qier-player@latest/dist/umd/index.min.js"> | ||
<img | ||
src="http://img.badgesize.io/https://unpkg.com/qier-player@latest/dist/umd/index.min.js?compression=gzip&style=flat-square" | ||
alt="Gzip Size"> | ||
</a> | ||
<a href="https://app.codacy.com/project/badge/Grade/042def878d8f49039cd4cde757fa1e5c"> | ||
<img src="https://img.shields.io/codacy/grade/042def878d8f49039cd4cde757fa1e5c?logo=codacy&style=flat-square"> | ||
</a> | ||
<a href="https://github.com/umijs/dumi"> | ||
<img src="https://img.shields.io/badge/docs%20by-dumi-blue?logo=dumi&style=flat-square"> | ||
</a> | ||
alt="Gzip Size" | ||
/> | ||
</a> | ||
<a href="https://app.codacy.com/project/badge/Grade/042def878d8f49039cd4cde757fa1e5c"> | ||
<img src="https://img.shields.io/codacy/grade/042def878d8f49039cd4cde757fa1e5c?logo=codacy&style=flat-square" /> | ||
</a> | ||
</div> | ||
|
||
<div align="center"> | ||
<a href="https://github.com/vortesnail/qier-player/blob/master/README-zh-Cn.md"> | ||
<a href="https://github.com/vortesnail/qier-player/blob/master/README-zh-Cn.md"> | ||
简体中文 | ||
</a> | ||
| English | ||
</div> | ||
|
||
## Introduction | ||
|
||
`qier-player` is a simple and easy-to-use h5 video player with highly customizable UI and rich features. | ||
`qier-player` 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 | ||
|
||
<a src="https://vortesnail.github.io/qier-player/guide/what-is-qier-player" style="max-width:620px;"> | ||
QierPlayer Documentation | ||
</a> | ||
|
||
## Screenshot | ||
## Screenshots | ||
|
||
<div align="center"> | ||
<img src="./website/public/img/screenshot-shadow.png" style="max-width:620px;"> | ||
<img src="./website/docs/public/screenshot.png" style="max-width:620px;" /> | ||
</div> | ||
|
||
## Quick Start | ||
|
||
### Install | ||
### Installation | ||
|
||
npm package install: | ||
Install via npm: | ||
|
||
```bash | ||
npm install --save qier-player | ||
```shell | ||
npm install qier-player | ||
# or | ||
yarn add qier-player | ||
# or | ||
pnpm install qier-player | ||
``` | ||
|
||
### Use | ||
### Usage | ||
|
||
```js | ||
import Player from 'qier-player'; | ||
|
||
const player = new Player({ | ||
src: 'https://vortesnail.github.io/qier-player-demo/static/media/video480p.d116ba09.mp4', | ||
src: 'https://vortesnail.github.io/qier-player/test-video_1080p.mp4', | ||
}); | ||
|
||
player.mount('#app'); | ||
``` | ||
|
||
## Danmaku | ||
|
||
The Danmaku feature is available as a separate library [@qier-player/danmaku](https://www.npmjs.com/package/@qier-player/danmaku). It is essentially independent of the video player and only requires a container. | ||
|
||
### Installation | ||
|
||
Install via npm: | ||
|
||
```shell | ||
npm install @qier-player/danmaku | ||
# or | ||
yarn add @qier-player/danmaku | ||
# or | ||
pnpm install @qier-player/danmaku | ||
``` | ||
|
||
### Usage | ||
|
||
```js | ||
import Player, { EVENT } from 'qier-player'; | ||
import Danmaku from '@qier-player/danmaku'; | ||
|
||
const player = new Player({ | ||
src: 'https://vortesnail.github.io/qier-player/test-video_1080p.mp4', | ||
}); | ||
|
||
player.mount('#app'); | ||
|
||
// Create a container for Danmaku | ||
const danmuWrapper = document.createElement('div'); | ||
danmuWrapper.style.cssText = 'position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden;'; | ||
player.el.appendChild(danmuWrapper); | ||
|
||
// Danmaku instance | ||
const danmaku = new Danmaku(danmuWrapper, { | ||
eventProxyElement: danmuWrapper, | ||
}); | ||
|
||
player.on(EVENT.PLAY, () => { | ||
danmaku.start(); | ||
}); | ||
|
||
player.on(EVENT.PAUSE, () => { | ||
danmaku.stop(); | ||
}); | ||
|
||
danmaku.add( | ||
{ | ||
text: 'The weather is nice today, hello everyone', | ||
color: '#fff', | ||
}, | ||
'rolling', | ||
); | ||
``` | ||
|
||
For more detailed usage, refer to [Danmaku](https://vortesnail.github.io/qier-player/guide/danmaku). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Danmaku {#danmaku} | ||
|
||
TODO |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 弹幕 {#danmaku} | ||
|
||
还未编写 |