Shared eventEmitter #503
-
I'm building a multitrack app, and I wish to known if is it possible to have a shared EventEmitter to centralize the time update and other actions for each instance of Peaks.js Maybe passing in options: import EventEmitter from 'eventemitter3';
const myEventEmitter = new EventEmitter();
const myPlayer = new MyPlayer(myEventEmitter);
// And for each track in Multitrack that will belongs to a Peaks instance
Peaks.init({
eventEmitter: myEventEmitter,
player: myPlayer
}); I had think in make a PR but I thought that was better before to ask if is it possible or have any limitation to implement it |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
This sounds interesting... there was a previous discussion in #432. Are you using multiple Peaks instances, for each track? I wonder if it's possible to ensure they're synchronized by using a shared |
Beta Was this translation helpful? Give feedback.
I made this example to show how it might work. This is based on the external player demo page, so uses Tone.js.