3.5.31 • Published 3 years ago

artplayer-tool-thumbnail v3.5.31

Weekly downloads
21
License
MIT
Repository
github
Last release
3 years ago

artplayer-tool-thumbnail

thumbnail tool for ArtPlayer

Demo

Checkout the demo from Github Pages

Install

Install with npm

$ npm install artplayer-tool-thumbnail

Or install with yarn

$ yarn add artplayer-tool-thumbnail
import ArtplayerToolThumbnail from 'artplayer-tool-thumbnail';

Or umd builds are also available

<script src="artplayer-tool-thumbnail"></script>

Will expose the global variable to window.ArtplayerToolThumbnail.

Usage

<input class="file" type="file" />
var thumbnail = new ArtplayerToolThumbnail({
    fileInput: document.querySelector('.file'),
    delay: 300,
    number: 60,
    width: 160,
    height: 90,
    column: 10,
});

// Dynamic configuration parameters, return the instance itself
thumbnail.setup({
    delay: 500,
    number: 100,
    width: 200,
    height: 10,
    column: 10,
});

// Start creating a preview, return the promise when the task completed
thumbnail.start();

// Start download preview, return the instance itself
thumbnail.download();

// Events
thumbnail.on('file', file => {
    console.log('The video file has been read successfully');
});

thumbnail.on('video', video => {
    console.log('Building a video player successfully');
    console.log('Now you can call the thumbnail.start()');
});

thumbnail.on('canvas', canvas => {
    console.log('Building a canvas successfully');
});

thumbnail.on('update', (url, percentage) => {
    console.log('Generating preview image, returning preview url and percentage');
});

thumbnail.on('done', () => {
    console.log('One task processing completed');
});

thumbnail.on('download', name => {
    console.log('Download the preview');
});

Example

<input class="file" type="file" />
var thumbnail = new ArtplayerToolThumbnail({
    fileInput: document.querySelector('.file'),
});

thumbnail.on('video', () => {
    thumbnail
        .setup({
            delay: 500,
            number: 100,
            width: 200,
            height: 10,
            column: 10,
        })
        .start()
        .then(() => {
            thumbnail.download();
        });
});

License

MIT © Harvey Zack

3.5.31

3 years ago

3.5.29

3 years ago

3.5.28

3 years ago

3.5.30

3 years ago

3.5.27

3 years ago

3.5.26

3 years ago

3.5.24

3 years ago

3.5.23

3 years ago

3.5.22

3 years ago

3.5.21

3 years ago

3.5.20

3 years ago

3.5.19

4 years ago

3.5.18

4 years ago

3.5.17

4 years ago

3.5.15

4 years ago

3.5.14

4 years ago

3.5.13

4 years ago

3.5.12

4 years ago

3.5.11

4 years ago

3.5.10

4 years ago

3.5.9

4 years ago

3.5.5

4 years ago

3.5.8

4 years ago

3.5.4

4 years ago

3.5.2

4 years ago

3.5.1

4 years ago

3.4.2

4 years ago

3.4.1

4 years ago

3.3.3

4 years ago

3.3.2

4 years ago

3.3.1

4 years ago

3.2.6

4 years ago

3.2.5

4 years ago

3.2.4

4 years ago

3.2.3

4 years ago

3.1.19

4 years ago

3.1.18

5 years ago

3.1.17

5 years ago

3.1.16

5 years ago

3.1.15

5 years ago

3.1.14

5 years ago

3.1.13

5 years ago

3.1.12

5 years ago

3.1.10

5 years ago

3.1.9

5 years ago

3.1.8

5 years ago

3.1.7

5 years ago

3.1.6

5 years ago

3.1.5

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago