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

SyntaxError: invalid regexp group #2396

Closed
nerofix opened this issue Jan 10, 2022 · 2 comments
Closed

SyntaxError: invalid regexp group #2396

nerofix opened this issue Jan 10, 2022 · 2 comments

Comments

@nerofix
Copy link

nerofix commented Jan 10, 2022

function parseHash(url) in plyr.js

const regex = /^.*(?:vimeo.com\/|video\/)(?:\d+)(?:\?.*&*h=|\/)+(?<hash>[\d,a-f]+)/;

This regex is no valid javascript in some browsers (such as PaleMoon) and causing the player not to load.
Removing this function from plyr.js will fix, but I recommend to update the regex to a more browser compatible javascript code.

Best regards.

@fekle
Copy link
Contributor

fekle commented Feb 18, 2022

I'm seeing the same issue, this seems to be caused by the use of Named Regexp Capture Groups (https://caniuse.com/mdn-javascript_builtins_regexp_named_capture_groups).
I submitted a PR in order to resolve this issue: #2426

@sampotts
Copy link
Owner

Thanks for your work on this. It's released in v3.7.0 🎉

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