Skip to content

A javascript parser for matroska files (up-to-date mk-parser)

Notifications You must be signed in to change notification settings

Phoenix35/mkinfo.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

⚠️ The sources heavily rely on ES6. It should work on modern browsers.
ℹ️ 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).

// e.g. <input type='file' multiple>
document.querySelector('input[type="file"]').addEventListener(
  'change',
  function () {
    filesArray = [...this.files]

    Promise.all(filesArray.map(f => mkinfo.new(f)))
    .then(
      resolvedInfos => {

        for (file of resolvedInfos)
          console.log(file.infos)

      },
      console.error
    )
  },
  false
)

Graph

Soon™

License

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

About

A javascript parser for matroska files (up-to-date mk-parser)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages