mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 13:21:20 -08:00
fix readme
This commit is contained in:
1 parent
8e825effdb
commit
00d8b77e89
2 files changed
+9
-51
No files matched your search
@@ -36,6 +36,7 @@
|
|||||||
| [artplayer-plugin-backlight](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-plugin-backlight) | Backlight plugin for ArtPlayer | [demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-plugin-backlight.js&example=backlight) |
|
| [artplayer-plugin-backlight](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-plugin-backlight) | Backlight plugin for ArtPlayer | [demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-plugin-backlight.js&example=backlight) |
|
||||||
| [artplayer-plugin-playlist](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-plugin-playlist) | Playlist plugin for ArtPlayer | [demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-plugin-playlist.js%0A.%2Funcompiled%2Fartplayer-plugin-playlist.css&example=playlist) |
|
| [artplayer-plugin-playlist](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-plugin-playlist) | Playlist plugin for ArtPlayer | [demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-plugin-playlist.js%0A.%2Funcompiled%2Fartplayer-plugin-playlist.css&example=playlist) |
|
||||||
| [artplayer-tool-thumbnail](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-tool-thumbnail) | Thumbnail tool for ArtPlayer | [demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-tool-thumbnail.js&example=thumbnail) |
|
| [artplayer-tool-thumbnail](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-tool-thumbnail) | Thumbnail tool for ArtPlayer | [demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-tool-thumbnail.js&example=thumbnail) |
|
||||||
|
| [artplayer-tool-github](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-tool-github) | Github api tool for ArtPlayer | [demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-tool-github.js%0A.%2Funcompiled%2Fartplayer-plugin-danmu.js&example=github) |
|
||||||
| [artplayer-react](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-react) | React Component for Artplayer | [demo](https://codesandbox.io/s/n74859y9rl) |
|
| [artplayer-react](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-react) | React Component for Artplayer | [demo](https://codesandbox.io/s/n74859y9rl) |
|
||||||
| [artplayer-vue](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-vue) | Vue Component for Artplayer | [demo](https://codesandbox.io/s/6z76lm109n) |
|
| [artplayer-vue](https://github.com/zhw2590582/ArtPlayer/tree/master/packages/artplayer-vue) | Vue Component for Artplayer | [demo](https://codesandbox.io/s/6z76lm109n) |
|
||||||
|
|
||||||
|
|||||||
@@ -1,79 +1,36 @@
|
|||||||
# artplayer-plugin-danmu
|
# artplayer-plugin-github
|
||||||
|
|
||||||
Danmu plugin for ArtPlayer
|
Danmu plugin for ArtPlayer
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
|
|
||||||
[Checkout the demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-plugin-danmu.js&example=danmu) from Github Pages
|
[Checkout the demo](https://artplayer.org/?libs=./uncompiled/artplayer-tool-github.js%0A./uncompiled/artplayer-plugin-danmu.js&example=github) from Github Pages
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
Install with `npm`
|
Install with `npm`
|
||||||
|
|
||||||
```
|
```
|
||||||
$ npm install artplayer-plugin-danmu
|
$ npm install artplayer-plugin-github
|
||||||
```
|
```
|
||||||
|
|
||||||
Or install with `yarn`
|
Or install with `yarn`
|
||||||
|
|
||||||
```
|
```
|
||||||
$ yarn add artplayer-plugin-danmu
|
$ yarn add artplayer-plugin-github
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import artplayerPluginBacklight from 'artplayer-plugin-danmu';
|
import ArtplayerToolGithub from 'artplayer-plugin-github';
|
||||||
```
|
```
|
||||||
|
|
||||||
Or umd builds are also available
|
Or umd builds are also available
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="artplayer-plugin-danmu.js"></script>
|
<script src="artplayer-plugin-github.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
Will expose the global variable to `window.artplayerPluginDanmu`.
|
Will expose the global variable to `window.ArtplayerToolGithub`.
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
```js
|
|
||||||
var art = new Artplayer({
|
|
||||||
container: '.artplayer-app',
|
|
||||||
url: 'path/to/video.mp4',
|
|
||||||
plugins: [artplayerPluginDanmu({
|
|
||||||
danmus: [], // Can be an array or return the promised function or danmuku xml url
|
|
||||||
speed: 5, // Animation time
|
|
||||||
opacity: 1, // Opacity
|
|
||||||
color: '#fff', // Font color
|
|
||||||
size: 25, // Font size
|
|
||||||
maxlength: 50, // The maximum number of words in the danmu
|
|
||||||
margin: [10, 20], // Margin top and margin bottom
|
|
||||||
})],
|
|
||||||
});
|
|
||||||
|
|
||||||
// Send danmu
|
|
||||||
art.plugins.artplayerPluginDanmu.emit({
|
|
||||||
text: '666', // Danmu text
|
|
||||||
time: 5, // Video time
|
|
||||||
color: '#fff', // Danmu color
|
|
||||||
size: 25, // Danmu size
|
|
||||||
border: '#fff' // Danmu border color
|
|
||||||
});
|
|
||||||
|
|
||||||
// Start danmu
|
|
||||||
art.plugins.artplayerPluginDanmu.start();
|
|
||||||
|
|
||||||
// Stop danmu
|
|
||||||
art.plugins.artplayerPluginDanmu.stop();
|
|
||||||
|
|
||||||
// Hide danmu
|
|
||||||
art.plugins.artplayerPluginDanmu.hide();
|
|
||||||
|
|
||||||
// Show danmu
|
|
||||||
art.plugins.artplayerPluginDanmu.show();
|
|
||||||
|
|
||||||
// Config danmu
|
|
||||||
art.plugins.artplayerPluginDanmu.config({
|
|
||||||
// option
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user