fancybox
fancybox copied to clipboard
Breaks Vimeo video URL in iframe
Describe the bug Using the fancyBox version v3.5.7, there are thumbnails wrapped inside a a tag with URLs of vimeo videos. When the link is clicked some videos load without any issues bus some return either an error from vimeo stating that the video is not available or play a completely different video, not even from the same user.
To Reproduce Steps to reproduce the behavior:
- Go to http://montazstroj.skin29.net/projekti/u-osnivanju-u-likvidaciji/
- Scroll down to the section named "Video" and try clicking on the third video (should open the https://vimeo.com/431431349/624d13bcb3 instead opens the https://player.vimeo.com/video/624 video )
Expected behavior
The vimeo regex ^.+vimeo.com\/(.*\/)?([\d]+)(.*)?
does not correctly extract the video ID, here are some of the vimeo video links on that page
Works: https://vimeo.com/418545272/d020d2e04a https://vimeo.com/295539609
Does not work: https://vimeo.com/295539609 https://vimeo.com/431430936/0b374fcb9c https://vimeo.com/436521985/3c81242f6d https://vimeo.com/329169729/1a5f18ea88
Screenshots
Desktop (please complete the following information):
- OS: any OS
- All Browsers
Additional context
here is a code snipped from the page how the HTML and data attribiutes are set up:
<a href="https://vimeo.com/431431349/624d13bcb3" data-fancybox="video"><img src="http://montazstroj.skin29.net/wp-content/uploads/2020/05/912687767_295x166-12.jpg" alt=""></a>
Client requested to change the code - so no longer live on the site at the mentioned URL
Using this regex ^.+vimeo.com\/(\/)?([\d]+)(.*)?
fixed the problem for me, however I only tested 5-10 videos.
Thanks @nate-thomas this does fix the issue with the script for me to
Using this regex
^.+vimeo.com\/(\/)?([\d]+)(.*)?
fixed the problem for me, however I only tested 5-10 videos.
Thanks @nate-thomas your regex worked for me.