mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-30 20:21:20 -08:00
完成截图工具
This commit is contained in:
1 parent
0ba8efc2b9
commit
5078533ad8
14 files changed
+667
-305
No files matched your search
@@ -1,3 +1,78 @@
|
||||
# artplayer-plugin-danmu
|
||||
Danmu plugin for ArtPlayer
|
||||
# artplayer-tool-thumbnail
|
||||
thumbnail tool for ArtPlayer
|
||||
|
||||
## Demo
|
||||
|
||||
[Checkout the demo](https://artplayer.org/thumbnail/) from Github Pages
|
||||
|
||||
## Install
|
||||
|
||||
Install with `npm`
|
||||
|
||||
```
|
||||
$ npm install artplayer-tool-thumbnail
|
||||
```
|
||||
|
||||
Or install with `yarn`
|
||||
|
||||
```
|
||||
$ yarn add artplayer-tool-thumbnail
|
||||
```
|
||||
|
||||
```js
|
||||
import ArtplayerToolThumbnail from 'artplayer-tool-thumbnail';
|
||||
```
|
||||
|
||||
Or umd builds are also available
|
||||
|
||||
```html
|
||||
<script src="artplayer-tool-thumbnail"></script>
|
||||
```
|
||||
|
||||
Will expose the global variable to `window.ArtplayerToolThumbnail`.
|
||||
|
||||
## Usage
|
||||
|
||||
```html
|
||||
<input class="file" type="file">
|
||||
```
|
||||
|
||||
```js
|
||||
var thumbnail = new ArtplayerToolThumbnail({
|
||||
fileInput: document.querySelector('.file'),
|
||||
delay: 300,
|
||||
number: 60,
|
||||
width: 160,
|
||||
height: 90,
|
||||
column: 10,
|
||||
});
|
||||
|
||||
thumbnail.on('file', file => {
|
||||
console.log(file);
|
||||
});
|
||||
|
||||
thumbnail.on('video', video => {
|
||||
console.log(video);
|
||||
thumbnail.start();
|
||||
});
|
||||
|
||||
thumbnail.on('canvas', canvas => {
|
||||
console.log(canvas);
|
||||
});
|
||||
|
||||
thumbnail.on('update', (percentage, url) => {
|
||||
console.log(percentage, url);
|
||||
});
|
||||
|
||||
thumbnail.on('download', name => {
|
||||
console.log(name);
|
||||
});
|
||||
|
||||
thumbnail.on('done', () => {
|
||||
console.log('done');
|
||||
});
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Harvey Zack](https://www.zhw-island.com/)
|
||||
Reference in new issue
Block a user