addEventListener Not Working

I wouldn’t use events for that. Since then you are fighting autoplay/muted logic in browsers even more so.

Either just show the player regardless of stream status, as doing it pure player reading you have to show the player, wait for it to read the status, then show/hide then you don’t know if autoplay was aborted by the browser or not.

I’d pull the data from the API or via Webhooks and frontend based on that so if the page is open and the stream state changes the palyer wouldn’t appear until reload

Additionally if you hide the player via CSS, there is no guarantee the browser will allow the player to auto play when the stream goes live, blocking the event triggers.