Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#9 | Fitvids_and_JQuery1.9-2304575-9.patch | 864 bytes | stupiddingo |
Comments
Comment #1
codenamerhubarb CreditAttribution: codenamerhubarb commentedI'm also experiencing this issue.
Comment #2
jfrederick CreditAttribution: jfrederick commentedAlso experiencing this.
Comment #3
DerekAhmedzai CreditAttribution: DerekAhmedzai commentedWhat version of jquery are you using?
Comment #4
MXTUsing jQuery 1.8 -> works
Using jQuery 1.9.1 -> doesn't works
Using jQuery 1.10.2 -> doesn't works
Comment #5
Christopher Riley CreditAttribution: Christopher Riley commentedAs 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.
Comment #6
Mark_L6n CreditAttribution: Mark_L6n commentedWhoa, 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).
Comment #7
webservant316 CreditAttribution: webservant316 commentedSame 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.
Comment #8
webservant316 CreditAttribution: webservant316 commentedPlease note this jquery restriction on the fitvids homepage and readme file.
Comment #9
stupiddingo CreditAttribution: stupiddingo commentedIn 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.
Comment #10
stupiddingo CreditAttribution: stupiddingo commentedUpdating status.
Comment #11
MXTPatch in #9 resolves the issue in my case.
Thank you very much!
Comment #12
codenamerhubarb CreditAttribution: codenamerhubarb commentedExcellent, thanks stupiddingo. Working for me now with jQuery 1.10.
Comment #13
robertom CreditAttribution: robertom commentedThanks stupiddingo,
#9 works well
Comment #14
Outdoor Ed CreditAttribution: Outdoor Ed commentedRather 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
Comment #15
webservant316 CreditAttribution: webservant316 commented#9 works for me. Thanks!
Comment #16
zengenuity CreditAttribution: zengenuity commented#9 is working for me with jQuery 1.10. Thanks.
Comment #17
rkent_87 CreditAttribution: rkent_87 commented#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/
Comment #19
DerekAhmedzai CreditAttribution: DerekAhmedzai commentedThanks stupiddingo, I've committed your patch and there's a new release on the way (updated dev release is there now)
Comment #20
DerekAhmedzai CreditAttribution: DerekAhmedzai commentedThere's a new release available
Comment #21
DerekAhmedzai CreditAttribution: DerekAhmedzai commentedSorry 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 :)