Skip to content
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

YouTube Live URLs fail canPlay check #1580

Closed
okcscott opened this issue Feb 10, 2023 · 3 comments
Closed

YouTube Live URLs fail canPlay check #1580

okcscott opened this issue Feb 10, 2023 · 3 comments

Comments

@okcscott
Copy link

Current Behavior

YouTube's live URL format (ex: https://youtube.com/live/AbCdE1Fgh2i) fails the pattern check if you use ReactPlayer.canPlay().

Expected Behavior

ReactPlayer.canPlay("https://youtube.com/live/AbCdE1Fgh2i") should return true

Steps to Reproduce

Pass "https://youtube.com/live/AbCdE1Fgh2i" into ReactPlayer.canPlay(url)

Environment

  • URL attempting to play: Any YouTube video containing live instead of watch in the URL. This is not my video but an example https://youtube.com/live/WrFhI8AxpOc
  • Browser: Chrome Version 108.0.5359.98
  • Operating system: macOS Monterey

Other Information

The product I work on allows users to embed a video into their instance. We use ReactPlayer.canPlay(url) to validate a form field. The form field is showing a validation error anytime someone uses a /live URL.

@cookpete
Copy link
Owner

canPlay returns false because that URL cannot be played – youtube.com/live URLs are not supported. I’ll see how easy it would be to add support for them.

@vincentwinkel
Copy link

Should I open a new issue for this bug or it's the same logics?

// The 2 urls target the same video
console.log(ReactPlayer.canPlay('https://youtube.com/w/lthffObMcw0')); // false
console.log(ReactPlayer.canPlay('https://www.youtube.com/watch?v=lthffObMcw0')); // true

@leojuriolli7
Copy link

Just ran into this issue aswell. It would be nice to have youtube.com/live URL support, if it isn't too hard to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants