fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

Breaks Vimeo video URL in iframe

Open Hrvoje opened this issue 4 years ago • 4 comments

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:

  1. Go to http://montazstroj.skin29.net/projekti/u-osnivanju-u-likvidaciji/
  2. 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 vimeo-regex-bug-2020-07-28_15-02

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>

Hrvoje avatar Jul 28 '20 13:07 Hrvoje

Client requested to change the code - so no longer live on the site at the mentioned URL

Hrvoje avatar Jul 28 '20 13:07 Hrvoje

Using this regex ^.+vimeo.com\/(\/)?([\d]+)(.*)?fixed the problem for me, however I only tested 5-10 videos.

nate-thomas avatar Sep 03 '20 05:09 nate-thomas

Thanks @nate-thomas this does fix the issue with the script for me to

Hrvoje avatar Sep 03 '20 13:09 Hrvoje

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.

shadtek avatar Feb 26 '21 15:02 shadtek