Git Product home page Git Product logo

filepond-plugin-media-preview's Introduction

Media Preview plugin for FilePond

License: MIT npm version

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.

Quick Start

Install using npm:

npm install filepond-plugin-media-preview

Then import in your project:

import * as FilePond from 'filepond';
import FilePondPluginMediaPreview from 'filepond-plugin-media-preview';

Register the plugin:

FilePond.registerPlugin(FilePondPluginMediaPreview);

Create a new FilePond instance as normal.

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.

Configuration

Both the video and audio preview can be enabled or disabled. Use the following options:

const pond = FilePond.create({
    name: 'filepond',
    allowVideoPreview: true,    // default true
    allowAudioPreview: true     // default true
});

Default styles

Be sure to include this lib's styles, by importing the minified css.

import 'filepond-plugin-media-preview/dist/filepond-plugin-media-preview.min.css';

Demo

View the demo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.