项目作者: Phoenix35

项目描述 :
A javascript parser for matroska files (up-to-date mk-parser)
高级语言: HTML
项目地址: git://github.com/Phoenix35/mkinfo.js.git
创建时间: 2018-03-08T14:26:40Z
项目社区:https://github.com/Phoenix35/mkinfo.js

开源协议:

下载


Matroska EBML Parser - mkinfo.js

An offline JavaScript parser for matroska files (up-to-date mk-parser).
This is not a substitute for the amazing MediaInfo program.

Coming soon™

Installation

  1. // At the moment, there is no named export
  2. import mkinfo from "./lib/mkParser.mjs"

:warning: The sources heavily rely on ES6. It should work on modern browsers.
:information_source: For older browsers, a Babel-transpiled bundle is shipped in Releases.

How to use

The main function is new() (I have to find a better name).
It receives a Blob (the matroska file) as a single argument and returns a Promise resolving with the infos (graph below).

  1. // e.g. <input type='file' multiple>
  2. document.querySelector('input[type="file"]').addEventListener(
  3. 'change',
  4. function () {
  5. filesArray = [...this.files]
  6. Promise.all(filesArray.map(f => mkinfo.new(f)))
  7. .then(
  8. resolvedInfos => {
  9. for (file of resolvedInfos)
  10. console.log(file.infos)
  11. },
  12. console.error
  13. )
  14. },
  15. false
  16. )

Graph

Soon™

License

Creative Commons License
mkinfo.js by Phoenix35 is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.