Read metadata from mkv-file, such as subtitles and audio-tracks (js/ts)

I’m currently experimenting with reading metadata from matroska-files in JS, like subtitles and audio-tracks. Been at it for some time now but everything seem deprecated and not working like intended. I’m pretty new to file-reading and such but I figure there must be a way since the information are in there.

I have a large mkv file 2gb-ish that contains several audio-tracks and subtitle-tracks. How in the world can I change the tracks in a browser, is it even possible? Surely it must be. There are no native method of doind this in <video>-tag. I’m using ReactPlayer and in the docs you can change subtitles, but then you need the subtitles-file (but, the subtitles are inside the file :mind-blown:)

So, anyone have experience with these kind of stuff in nodeJS or just plain JS?

/T

I’ve tried numerous of packages from npm but none of them seem to work like intended. Or i’m just to novice to understand how to use them correctly.