Embedding twitch channel and expectations

You shouldn’t be listening to this message in the first place.

It’s not a bug or problem to be fixed. It’s just how the embed works.

document.getElementById(‘theplayer’).textContent = ‘’;

or change channels Twice.

An embed should also start playing when the stream goes live. So you can listen for the PLAYING event.

You are bound wrong.

See Twitch Embed example

  player.addEventListener(Twitch.Embed.VIDEO_PLAY, function() {
    log('The video is playing');
  })

Or bind to for Twitch.Player.ONLINE

Will report when a video is playing (ie the stream is live)

You are bound to every message the embed sends instead of a specific player event. Hence the “spam” in your console. As your logic is wrong.