-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error rendering Twitch demo video #733
Comments
This can happen when
Is the ID not being set correctly in your DOM? |
I'd just like to chime in and say that I'm experiencing the same issue with all Twitch embeds. Here's a codesandbox if this helps. |
@SiroDiaz There must be something wrong with your specific environment or implementation. Your example code works fine for me in jsFiddle with @jackhenry Your example doesn't work because https://www.twitch.tv/p/watch/esfand isn't a valid Twitch URL. Visiting it gives me a 301 redirect to https://www.twitch.tv/p/watch/esfand which then returns a 404 page. |
@cookpete i think the same. I'm going yo try others things. If i don't solve the problem i will notice you more about muy environment |
@cookpete Sorry, I was in a rush. Try this I've double checked that link and that's the same format for the twitch urls I've been using. The issue is with the controls property. If set to false, I just get a black screen. If it's set to true, it works. You can replace the url with any other url and the issue should be the same. Also note, I've only got this issue with embedded twitch live streams. Not embedded twitch videos. |
So it only breaks for live streams when |
@cookpete You're probably right. The Twitch Dev team is notorious for introducing breaking bugs without any notice. It appears to be an issue with the format of the url used for the iframe. This doesn't work: https://player.twitch.tv/?allowfullscreen&video=&channel=yogscast&!playsinline&!autoplay&!muted&!controls&origin=http%3A%2F%2Flocalhost%3A3000 This does work https://player.twitch.tv/?allowfullscreen&video=&channel=yogscast&!playsinline&!autoplay&!muted&origin=http%3A%2F%2Flocalhost%3A3000 The only difference between the two is The first url is what React-Player generates if the controls property is set to false. |
controls property for twitch player must be true if url is for a channel. Otherwise, video will not load in iframe.
controls property for twitch player must be true if url is for a channel. Otherwise, video will not load in iframe.
I found the error @cookpete . I'm using next.js for server side rendering. When the player is rendered in the browser Twitch works perfectly, but when the page is reloaded, it says: So, what conclusion? I'm going to investigate if my server is wrong (for example render twice or redux error with second rendering) but could you check if something in react-player has incompatibilities with server side rendering with nextjs? Edit: I have tried with youtube, vimeo and other providers and zero errors with server side rendering, but i think it is due to div id dependency with Twitch player. |
Example here: nextjs with Twitch video |
Current Behavior
When i set the demo Twitch url in my local project the player is not rendered. With YouTube, Vimeo and Dailymotion it works. I'm using the latest version of react-player (1.13.0).
Expected Behavior
Render the player and the video normally.
Steps to Reproduce
Environment
Other Information
The text was updated successfully, but these errors were encountered: