vue-video-input =============
Last updated a year ago by npm.creador .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vue-video-input 
SYNC missed versions from official npm registry.


Video file input Vue.js component with video canvas preview, drag and drop, information detection, gif preview creation and more.



npm install --save vue-video-input


yarn add vue-video-input


  <div class="hello">    
      mensaje="DRAG VIDEO" 
import VideoInput from 'vue-video-input'

export default {
  name: 'app',
  data () {
    return {
  components: {
  methods: {
    onInfo (video) {
      console.log('New video selected!')
      if (video.base64) {
        console.log('Base64 of video loaded.', video.base64)
      } else {
        console.log('FileReader API not supported: use the <form>, Luke!')

You can also use it directly in the browser through unpkg's CDN (or jsDelivr):

<!DOCTYPE html>
  <script src=""></script>
  <script src=""></script>
  <title>In the browser!</title>
  <div id="app">
    <p>{{ message }}</p>
    var app = new Vue({
      el: '#app',
      data: {
        message: 'Hello Vue!'
      components: {
        'video-input': VideoInput


  • ancho, alto: (pixels, optional) the maximum width and height of the preview container. The video will be resized and centered to cover this area. Either ancho or alto is required.
  • margin: (pixels, optional) the margin around the preview container. Default value: 0.
  • radio: (percentage, optional) The border-radius value for the container. Set radius="50" to get a circular container. Default value: 0.
  • mensaje: (string, optional) Message to display inside container when no video has being selected.
  • tipo: (media type, optional) the accepted video type(s), e.g. video/mp4, video/avi, etc. Default value: 'video/*'.
  • maxmb: (MB, optional) the maximum accepted file size in megabytes.
  • duracion: (int, optional) the amount of seconds the video must have. Default -1=disabled.
  • ratio: (string, optional) the required aspect ratio the video must have.
  • preview_ancho: (pixels, optional) the width for the gif preview file to be created.
  • preview_alto: (pixels, optional) the height for the gif preview file to be created.


  • info: emitted on (successful) video change. Passes an object with the fields: mbytes (amount of megabytes that the video has), duracion (amount of seconds the video has), ratio (aspect ratio of the video), ancho (original width of video), height (original height of video), base64 (Base64 Data URI string with video data).
  • change: emitted on (successful) video change. Passes a field called 'archivo' with the input object file.
  • preview: emitted while the animated gif datafile is being and/or has finished created, along with an object with creando (true is gif preview is still being created), preview (Base64 Data URI string with GIF data).
  • error: emitted on error, along with an object with tipo (maxmb, ratio, formato), mensaje.


  • Translate properties/events to English
  • Add tests


All contributions are welcome, as long as they are within the scope of the project. Please open a new issue before submitting a pull request.

You should follow the Javascript Standard Style guidelines:

Current Tags

  • 1.0.1                                ...           latest (a year ago)

2 Versions

  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (9)
Dependents (0)

Copyright 2014 - 2016 © |