An offline JavaScript parser for matroska files (up-to-date mk-parser).
This is not a substitute for the amazing MediaInfo program.
// At the moment, there is no named export
import mkinfo from "./lib/mkParser.mjs"
ℹ️ For older browsers, a Babel-transpiled bundle is shipped in Releases.
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
)
Soon™
mkinfo.js by Phoenix35 is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.