项目作者: herrmannplatz

项目描述 :
Capture preview image from a video file
高级语言: JavaScript
项目地址: git://github.com/herrmannplatz/poster-image.git
创建时间: 2017-01-06T22:07:02Z
项目社区:https://github.com/herrmannplatz/poster-image

开源协议:MIT License

下载


poster-image

Capture preview image from a video file. Useful when dealing with videos uploaded by the user.

usage

HTML

  1. <script src="poster.js"></script>

Javascript

  1. poster(file).then(function(blob) {
  2. var image = new Image()
  3. image.src = URL.createObjectURL(blob)
  4. document.body.appendChild(image)
  5. })

browser support

Tested with latest Chrome, Firefox, Opera and Edge.

api

poster(file)

Create a video preview image from the given video file.

  • file - video of type File or Blob.

  • returns a Promise with the image data as Blob

license

See License