mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 19:41:25 -08:00
完成gif插件
This commit is contained in:
1 parent
d535423dd8
commit
c9dfc883ab
11 files changed
+352
-54
No files matched your search
@@ -1,3 +1,63 @@
|
||||
# artplayer-plugin-gif
|
||||
Gif plugin for ArtPlayer
|
||||
|
||||
Gif plugin for ArtPlayer, use [gifshot](https://github.com/yahoo/gifshot) as a dependency
|
||||
|
||||
## Demo
|
||||
|
||||
[Checkout the demo](https://artplayer.org/gif/) from Github Pages
|
||||
|
||||
## Install
|
||||
|
||||
Install with `npm`
|
||||
|
||||
```
|
||||
$ npm install artplayer-plugin-gif
|
||||
```
|
||||
|
||||
Or install with `yarn`
|
||||
|
||||
```
|
||||
$ yarn add artplayer-plugin-gif
|
||||
```
|
||||
|
||||
```js
|
||||
import artplayerPluginGif from 'artplayer-plugin-gif';
|
||||
```
|
||||
|
||||
Or umd builds are also available
|
||||
|
||||
```html
|
||||
<script src="artplayer-plugin-gif"></script>
|
||||
```
|
||||
|
||||
Will expose the global variable to `window.artplayerPluginGif`.
|
||||
|
||||
## Usage
|
||||
|
||||
This will add a button called "GIF" in the bottom control bar.
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: 'path/to/video.mp4',
|
||||
plugins: [artplayerPluginGif],
|
||||
});
|
||||
```
|
||||
|
||||
Or can be called via api
|
||||
|
||||
```js
|
||||
art.plugins.artplayerPluginGif.create(
|
||||
{
|
||||
// some configuration
|
||||
// https://github.com/yahoo/gifshot#options
|
||||
},
|
||||
function(imageUrl) {
|
||||
console.log(imageUrl);
|
||||
},
|
||||
);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Harvey Zack](https://www.zhw-island.com/)
|
||||
Reference in new issue
Block a user