Interactive Embeded Frame not always working on firefox

Sometimes, especially on firefox, I’m gettting Error Code #2000 on the player.

This is the relevant code:

var options = {
        width: "80%",
        height: "100%",
        video: video_id,
    };

player = new Twitch.Player("<player div ID>", options);

video_id is in the form v{id} for example “v320872711”

I see this error in the console:

Firefox can’t establish a connection to the server at wss://pubsub-edge.twitch.tv/v1. player.020840bcd6a7644842b9.js:28:42919

And also

Invalid operation: t.channel is not implemented 2 player.020840bcd6a7644842b9.js:11:140372

Sounds like you are having connectivity issues. As you are failing to connect to Twitch

No, everything else is working correctly. And this is working on every other browser I think. Other people have told me my web app does the same for them on firefox.