=> {
media.addEventListener('click', e => {
callbacks[0]();
});
};
When I call media_player multiple times, and I click on one of the medias, the other one's callback function is being executed. Why?!
media_player(media, [() => {console.log('Call 1');}]);
media_player(media, [() => {console.log('Call 2');}]);
media_player(media, [() => {console.log('Call 3');}]);
When I click on media 1, the Call 2 message appears!
Wdym when you click On what do you click?
I mean when I have for example 10 medias, and I click on the forth one, the call back of the first one is being executed!
The code is huge, when I try to reproduce the problme, I can't! But it's exactly what I'm saying.
Обсуждают сегодня