Dynamic metro objects for multiple video players in JS

Conall Ó Maoláin's icon

Hello!

I'm a bit stuck. I'm trying to playback multiple video files using midi. When a folder is loaded into the JS program, a jit.movie object is created for each video in the folder. The issue comes from how to play each video. I don't seem to be able to use timeouts with JS in max so I have a counter object in the patch to count through the frames of each video, however, I can only do this for one video at a time and can't play them back polyphonically.
Any hints or solutions would be fantastic!

Thanks :)

Max Patch
Copy patch and select New From Clipboard in Max.
videoPlayer.js
js 0.75 KB
organize-video.js
js 1.20 KB

Source Audio's icon

to keep your player exactly as is, (not using other means of playback

but keep that frame count)

you could count movies in the folder and create as many poly instances of

that frame counter.

And post frame count for each instance when loading movies.

It would be easier to transpose input notes to start with poly~ instance 1 = movie 1

instead of using -60 in js code ...

Conall Ó Maoláin's icon

Getting the frame count of each video when they are loaded makes way more sense, thank you.
I've not used poly~ before but is this the kind of thing you meant? The videos can play "polyphonically" but the frame rate is really slow.

Max Patch
Copy patch and select New From Clipboard in Max.
Max Patch
Copy patch and select New From Clipboard in Max.
organize-video.js
js 1.16 KB

Source Audio's icon

I will mod your js code and patches to do what I meant.

but I can't give you advices when it comes to optimised video playback

and in first place populating jit.world with movie instances and their locations,

transparency etc.

Not my field of interest.

So ... that part will remain as is,

but handling of loading videos, getting frame count and playback using poly voices should be better.

I will also add "mpg4" filetype to "mooV"

I'l be back with the files later today.

Source Audio's icon

try this.

I have renamed jit.word to avoid confusion with your original code.

midi input is limited from note 60 up to number of loaded videos.

VP.zip
zip 3.77 KB


Conall Ó Maoláin's icon

That's exactly what I wanted!
Thank you so much :)