How can I access/get a player that already created?
In my case want add event listener on a player already create like this : https://developers.google.com/youtube/iframe_api_reference#Example_Video_Player_Constructors
The player is a local variable so it seems if I haven't global variable to reference it I can't access to this player outside the function.
To understand my problem, there is a website with an Youtube iframe wich defines a player locally in a function. I don't want create a new player on this iFrame and add event listener like this : https://developers.google.com/youtube/iframe_api_reference#Adding_event_listener player.addEventListener(event:String, listener:String):Void
I want add event listener to keep listener already defined when the player was created.
I don't want change the code wich declare the player because my code is in Google Tag Manager and it will add behavior on players already defined. Google Tag Manager
I'm pratically sure I can access player from iFrame but I don't find how... Or with the object window['YT'] defined in the script : iframe_api
Thanks
Regards
Thomas