diff --git a/README.md b/README.md index e31c530..c598525 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,43 @@ # Media Preview plugin for FilePond +[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/nielsboogaard/filepond-plugin-media-preview/blob/master/LICENSE) [![npm version](https://badge.fury.io/js/filepond-plugin-media-preview.svg)](https://badge.fury.io/js/filepond-plugin-media-preview) The Media Preview plugin will kick in automatically when the uploaded file is of type video or audio and render a preview player inside the file item. -[Demo](https://nielsboogaard.github.io/filepond-plugin-media-preview/) \ No newline at end of file + + + +## Quick Start + +Install using npm: + +```bash +npm install filepond-plugin-media-preview +``` + +Then import in your project: + +```js +import * as FilePond from 'filepond'; +import FilePondPluginMediaPreview from 'filepond-plugin-media-preview'; +``` + +Register the plugin: +```js +FilePond.registerPlugin(FilePondPluginMediaPreview); +``` +Create a new FilePond instance as normal. +```js +const pond = FilePond.create({ + name: 'filepond' +}); + +// Add it to the DOM +document.body.appendChild(pond.element); +``` + The preview will become active when uploading an video or audio file. + + +## Demo +[View the demo](https://nielsboogaard.github.io/filepond-plugin-media-preview/) \ No newline at end of file diff --git a/demo.gif b/demo.gif new file mode 100644 index 0000000..1bc5913 Binary files /dev/null and b/demo.gif differ