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

fix: allow unlisted vimeo video urls when loading using data attributes (#2504) #2505

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fresswolf
Copy link

Link to related issue (if applicable)

#2504

Also see #2322 which fixed the issue, except for the case when data attributes are used.
Also this old ticket #593 can probably be closed with this fix.

Summary of proposed changes

This allows us to use URLs of unlisted Vimeo videos in the data-plyr-embed-id data attribute. Currently, data-plyr-embed-id does work with full vimeo URLs like this
<div id="player" data-plyr-provider="vimeo" data-plyr-embed-id="https://vimeo.com/40648169"></div>
but it doesn't work when the URL contains an additional hash (unlisted video):
<div id="player" data-plyr-provider="vimeo" data-plyr-embed-id="https://vimeo.com/729894358/7767dc808d"></div>

I found an undocumented data attribute called data-plyr-embed-hash which can be used to set the hash separately. But if we allow setting full URLs using the data-plyr-embed-id attribute, I would expect to be able to pass the URL including the hash to this attribute without having to care about the privacy settings of the video myself.

// In case hash is not explicitly set as attribute we try to parse it from the id attribute
if (!hash) {
hash = parseHash(source);
alert(hash);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need to remove the alert() here?

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

Successfully merging this pull request may close these issues.

2 participants