Broken twitch embed user login

I have embed the twitch channel player in my page.
When the unauthenticated user tries to chat, it is prompted with the login modal.

After inserting credentials, the following error is displayed on the javascript console and the chat area goes black.

Refused to display ‘Twitch’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’.

ALSO, the event Twitch.Embed.AUTHENTICATE never gets fired.

embed.addEventListener(Twitch.Embed.AUTHENTICATE, function(user) {
  console.log(user.login + ' just logged in');
});

I am using this script:

<script src="https://embed.twitch.tv/embed/v1.js"></script>

I find the documentation confusing and broken. At times it mixes things that exist on the script at https://embed.twitch.tv/embed/v1.js, other times from an older script at http://player.twitch.tv/js/embed/v1.js.
This is very frustrating and I wast time having to figure out what works and what doesn’t.

BTW, the documentation for the player api regarding layout says that the default option is ‘video-and-chat’, but after inspection upon the javascript, it should have been ‘video-with-chat’.

This is the script I am talking about: Twitch

The documentation is a mess honestly :face_with_head_bandage:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.