Twitch.player not firing events (again)

Thanks again Barry, I have done a lot more testing but still finding an issue, even with your test page (loaded on my server - I’ll explain why).

Firstly, I checked the two versions of the JS file and they are identical so that is a red herring.

You’re right about the OFFLINE message, this does work but takes a while as our stream is not ended gracefully (the camera will just be turned off). I can work with this and just reload the page when the OFFLINE event is triggered.

So the fault now appears to be replicated as follows (in both Chrome and Edge browsers).

  1. Open a new TAB or Browser
  2. Load the page BEFORE the stream is ONLINE
  3. Start the Stream
  4. No ONLINE message is triggered and nothing is displayed in the player
  5. If you reload the page / browser, the ONLINE event is detected and the stream is shown
  6. Subsequent OFFLINE messages are received.
  7. If the stream is put ONLINE it now works and will continue to work.

Summary, the fault only appears when the browser is first opened and it does this with your code. A subsequent reload after the stream has started, kicks it into action. I can’t replicate this with your Github example and the page loads with your stream, changing the stream has the effect of reloading and jumping to step 5 above. I have taken your code (html page) and placed in on another server it is 100% the same except for the channel option.

I will continue to look for solutions, it may be a timing thing on how a page loads… perhaps you can confirm this with your stream (by loading the page first when the stream is OFFLINE and then starting the stream)
THX again
Nathan