I hava a single HTML with many youtube players.
I'm suscribing to the onStateChange to get notified when the user plays a video.
function onYouTubePlayerReady(playerid) {
var player = document.getElementById("playerA");
player.addEventListener("onStateChange", "callback");
}
Now the callback get the newState as parameter.
function callback(newState) {
...
}
This works ok with only one player. But with many players, how can I know wich player raised the StateChange event? Callback just have one parameter.
Is there a way to know which player raised the event form callback or i have to set uo a diferent callback for each one?