Files
ArtPlayer/packages/artplayer-plugin-gif
2019-11-20 09:49:52 +08:00
..
2019-11-20 09:49:52 +08:00
2019-06-12 15:24:34 +08:00
2018-12-06 11:01:24 +08:00
2018-12-06 11:01:24 +08:00
2019-11-20 09:49:22 +08:00
2019-05-09 21:18:12 +08:00

artplayer-plugin-gif

Gif plugin for ArtPlayer, use gifshot as a dependency

Demo

Checkout the demo from Github Pages

Install

Install with npm

$ npm install artplayer-plugin-gif

Or install with yarn

$ yarn add artplayer-plugin-gif
import artplayerPluginGif from 'artplayer-plugin-gif';

Or umd builds are also available

<script src="artplayer-plugin-gif.js"></script>

Will expose the global variable to window.artplayerPluginGif.

Usage

This will add a button called "GIF" in the bottom control bar.

var art = new Artplayer({
    container: '.artplayer-app',
    url: 'path/to/video.mp4',
    controls: [
        {
            name: 'gif',
            position: 'right',
            html: '创建GIF',
            mounted: $gif => {
                art.plugins.artplayerPluginGif.attach($gif);
            },
        },
    ],
    plugins: [artplayerPluginGif],
});

Or can be called via api

art.plugins.artplayerPluginGif.create(
    {
        // some configuration
        // https://github.com/yahoo/gifshot#options
    },
    function(imageUrl) {
        console.log(imageUrl);
    },
);

License

MIT © Harvey Zack