Embedding Twitch player without need for a API call


I have embedded twitch video player using the Interactive Frames for Live Streams.

<script src= "https://player.twitch.tv/js/embed/v1.js"></script>
<div id="<player div ID>"></div>
<script type="text/javascript">
  var options = {
    width: <width>,
    height: <height>,
    channel: "<channel ID>",
    video: "<video ID>",
    collection: "<collection ID>",
  var player = new Twitch.Player("<player div ID>", options);

There is an unexpected API call being requested at some point from the video script and the request returns 401.
I understand that the request requires a client ID on the request header, but my point is I’m not interested in consuming any API and all I need is just embedding the player to my page.

How can this API calls be avoided?
Is it mandatoy that I have to register and get a client ID for simple embedding?


You can’t the Player is doing it internally

No. As the embed code doesn’t need you to declare a ClientID

In that case this will be a JS exception on client, request error on console and
warning that a promise is failed to resolved

Thats expected.

The player embeds the Twitch Website in an iFrame.

That iFrame may throw any or all sorts of kinds of errors. And you don’t have to worry about it.

It’s pretty “standard” when embedding stuff from other places for that to happen, and you just don’t need to worry about it.

Additionally see also:

Which may fix and/or break more stuff, or cause more or less errors in the console. Which you also don’t need to worry about.

Any errors the player throws are sandboxed to the iFrame and won’t effect the website you are embedding into

@BarryCarlyon Thanks for your prompt response

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