Hi all,

I'm using jQuery update module and I've noticed that FitVids does not work if I use jQuery >= 1.9 in my site.

The following javascript error is triggered:

Error: Syntax error, unrecognized expression: iframe[src*='player.vimeo.com'],iframe[src*='youtube.com'],iframe[src*='youtube-nocookie.com'],iframe[src*='kickstarter.com'][src*='video.html'],object,embed,
http://mysite/sites/all/modules/contrib/jquery_update/replace/jquery/1.9...
Line 4

Thank you for resolving this.

CommentFileSizeAuthor
#9 Fitvids_and_JQuery1.9-2304575-9.patch864 bytesstupiddingo
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

codenamerhubarb’s picture

I'm also experiencing this issue.

jfrederick’s picture

Also experiencing this.

DerekAhmedzai’s picture

What version of jquery are you using?

MXT’s picture

Using jQuery 1.8 -> works
Using jQuery 1.9.1 -> doesn't works
Using jQuery 1.10.2 -> doesn't works

Christopher Riley’s picture

As a quick workaround until there is time for this module to get updated I followed the steps listed at http://www.samwirch.com/blog/responsive-videos-fitvidjs-and-drupal-7 and its working however you do not get the benefits of what the module offers.

Mark_L6n’s picture

Whoa, glad I found this issue! Same for me, did not work with jQuery 1.9; changed setting in jQuery update to 1.8 and it now works. jQuery 1.10 did not work either.
(Using FitVids 7.x-1.15, Video Embed Field 7.x-2.0-beta7, FlexSlider 7.x-2.0-alpha3).

webservant316’s picture

Same here. Took me all afternoon to discover that jquery_update + fitvids did not work...unless I scaled back to jquery 1.8. Hope this gets fixed.

webservant316’s picture

Please note this jquery restriction on the fitvids homepage and readme file.

stupiddingo’s picture

In Jquery 1.9 or greater, jquery.fitvids.js throws an error when presented with a .fitVids({customSelector: []}) rather than .fitVids({customSelector: null})

You can see the error is related to the jquery.fitvids.js custom selector by adding any domain to the Custom iframe URLs textarea in the admin interface. With any domain entered, videos become response in JQuery 1.9+ and all errors disappear from console log.

The attached patch tests for an empty array and allows null rather than empty array to be passed as a custom selector if the Custom iframe URLs textarea is left blank.

Tested in JQuery 1.5, 1.7, 1.8. 1.9 and 1.10.

stupiddingo’s picture

Status: Active » Needs review

Updating status.

MXT’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #9 resolves the issue in my case.

Thank you very much!

codenamerhubarb’s picture

Excellent, thanks stupiddingo. Working for me now with jQuery 1.10.

robertom’s picture

Thanks stupiddingo,

#9 works well

Outdoor Ed’s picture

Rather than applying the #9 patch I simply added a URL in the Custom iframe URLs text box and that solved the problem. For safety I used the URL for my own site and FitVids now works with jQuery 1.10

webservant316’s picture

#9 works for me. Thanks!

zengenuity’s picture

#9 is working for me with jQuery 1.10. Thanks.

rkent_87’s picture

#14 and #9 work for me. Worth mentioning that if you are editing the file manually, edit the fitvids.js in sites/all/modules/fitvids/ and not the one in /libraries/

DerekAhmedzai’s picture

Thanks stupiddingo, I've committed your patch and there's a new release on the way (updated dev release is there now)

DerekAhmedzai’s picture

Status: Reviewed & tested by the community » Fixed

There's a new release available

DerekAhmedzai’s picture

Sorry if you've upgraded to 1.16 already, but it had a problem with custom domains - see #2388103: Update to v 1.16 broke iplayerhd video fitting

1.17 is out now :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.