Foliovision › Forums › FV Player › Troubleshooting › New lightbox doesn’t work on my website
-
-
Hello Ákos,
as you are a Pro user I checked your site briefly. I see that your theme (Jupiter) is already using fancyBox library which FV Player is using as well. And that is causing the issue, it just reports:
“fancyBox already initialized”
Please switch back to the release version for now and we will ensure FV Player’s fancyBox plays well with other plugins.
Thanks,
MartinHello Ákos,
I checked this and it’s going to be tricky with the styling, if your theme is bundling the fancyBox styling in it.
But you can check with this new plugin version here: https://github.com/foliovision/fv-wordpress-flowplayer/archive/fancybox-fix.zip Just reinstall the plugin from that ZIP file. To do that you will have to first deactivate and delete the current FV Player plugin you are using. WordPress will warn you that you might loose settings and data, but it’s not the case with out plugin, no settings now videos will be lost. Or you can just replace the plugin files via FTP.
Thanks,
MartinHi Martin,
I’ve the same problem. I already use fancybox.I installed version attached on post above but it’s version 6.6.6 not fixing for 7.2.3.727.
Another thing I notice is that if I click on upgrade now from version 6.6.6 once clicked I get alert, if I click on ok nothing happen. I did a screenrecording: https://drive.google.com/file/d/1rJ1V-31na40MmcD99EXxRbNQKz1RFjmY/view
Let me know. Thanks
DavidHello David,
to update FV Player please click the upgrade link with right mouse button and select the option to open the link in new browser tab. There was a nasty bug like that in last version 6 release of FV Player. So we put in a written message suggesting the above as well. You should be seeing it too.
If that won’t fix the issue, please provide a link to the page where we can see the failure.
Thanks,
MartinHello David,
do you use any other plugin which works with fancyBox?
Do you see any error on the browse console? First open the console according to the instructions here: https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors#Step_3:_Diagnosis Then open your page where you can see the issue, try to open lightbox and see if you get any error.
Thanks,
MartinHello David,
I tried to reproduce the bug, so I installed some plugins. First it was “ARI Fancy Lightbox”. Once it was activated I was getting “fancyBox already initialized” on console, but the lightbox still worked. The styling was a bit off though. That plugin uses fancyBox 3.2.10 while FV Player has 3.4.1, so that could be the reason for the styling mismatch.
Next I tried to use “Easy FancyBox” alongside FV Player. Not only I saw that message again, but also clicking FV Player didn’t open the lightbox at all. So that’s a problem. It was using fancyBox 1.3.23 which is really outdated – I can see 1.3 versions were released in 2010.
Next, “FancyBox for WordPress” is using fancyBox 1.3.8.
What is the fancyBox script version in your theme? Perhaps FV Player needs to detect other plugins loading fancyBox and prevent it. The last two plugins which I mentioned also seem to load fancyBox in a non-standard way, not using WordPress API which is a problem too.
Thanks,
MartinHi Martin,
thank you for your reply and sorry for delay.
I use fancybox ver 2.1.5 (I haven’t updated to the new version yet) in my custom theme and I include it via wp_enqueue_script (I get script on cdnjs).
I use fancy to load course page in overlay. This page include video. I think that style and script loaded from fv crash my site.
I analyzed the code, removed fv script and style and everithing’s fineCan you add option to disable fancybox? Fancybox is used to load video in overlay and if someone doesn’t need this function, can save bandwidth without loading these 2 extra files (or if someone use older version of fancybox) like Load FV Flowplayer JS everywhere option in integrations/compatibility blocks
What do you think? Iit could be a good idea?
Sorry, no, I’ll try to explain better.
If someone doesn’t need overlay function or if someone use an older version of fancybox, you can add a new option “Disable Fancybox library” in integrations/compatibility block settings so everyone can disable foliovision fancybox loaded library (and use their own).
Thanks
Hello David,
it you don’t enable Settings -> FV Player -> Sidewide Flowplayer Defaults -> “Use video lightbox for images as well” the fancyBox from FV Player won’t load, unless you are viewing a post with [fvplayer] shortcode which uses the lightbox attribute.
Please check. I don’t see a need for “Disable Fancybox library” checkbox.
Thanks,
MartinHi Martin,
I already have this setting disabled but fancybox library are still loaded:
/fv-wordpress-flowplayer/css/fancybox.css
and
/fv-wordpress-flowplayer/js/fancybox.jsThis breaks default fancybox style so, with “Disable Fancybox library”, I can avoid library loading and use fancybox like before.
Thanks
DavidSorry Martin,
I’ve “Use video lightbox for images as well” unchecked but “Load FV Flowplayer JS everywhere” checked. I have no lightbox attribute in shortcode.
I do not use fv_fancybox so I would like to check “Disable Fancybox library” to avoid library inclusion and use “standard” plugin option instead of call
function remove_fv_fancybox(){
wp_dequeue_script( ‘fv_player_lightbox’ );
wp_dequeue_style( ‘fv_player_lightbox’ );
}
add_action(‘wp_footer’,’remove_fv_fancybox’,10);
in my custom functions.php.Thanks
Hello David,
that is correct use of that setting.
We could add the “Disable Fancybox library” setting, but in general we would like to remove some settings and not add new.
Perhaps the “Load FV Flowplayer JS everywhere” setting could be changed into “Ajax Support” and then enabling that would give you a list of things you would like to support in Ajax loaded FV Player:
* Vimeo videos (load Dash.js)
* HLS videos (load HLS.js)
* Lightbox (load fancyBox)Or we could improve our code to load these scripts on demand, but that can get tricky.
I will have to check this with Alec.
For now you can keep using that PHP code.
Thanks,
MartinHi David,
I really dislike the idea of selectively loading scripts. That’s a support nightmare. If a publishers chooses not to use FV Player Video Lightbox (due to their own tastes or a conflict with an out of date Fancybox js), then the publisher only needs to disable the FV Player Video Lightbox.
What I’d like to do on our end, is make it easier to handle these Fancybox issues. There’s no reason for three versions of a single library to load (and every performance reason not to do it), even if with a different prefix.
Martin and I will work on reducing the Fancybox conflicts.
Our plugin is too complicated already. We have to simplify, not make it even more complex.
Thanks though for the detailed notes. Martin will work with you on resolving this Fancybox compatibility issue.
Hello Alec,
I was looking into this:
* ARI Fancy Lightbox registers the Fancybox script as “ari-fancybox” and it’s version 3.2.10
* Easy FancyBox uses “jquery-fancybox” and it’s version 1.3.23
* FancyBox for WordPress uses “fancybox” and it’s version 1.3.8So for the first case we could use the script which that plugin registers as we use version 3.4.1. So it should work, although possibly with some small design glitches as we rely on the newer Fancybox 3.4.1 styling a bit. And then if we do that we still have to stick our JavaScript somewhere – additional JS file – meaning more requests on pageload.
For the later two cases it’s impossible to fix. We could only add a code to our plugin which prevents these old versions from loading in order to not break the FV Player lightbox functions. But then it’s hard to guarantee that it these plugins keep working.
It would help if there would be a single popular plugin or theme for which we would have to fix these issues as multiple users would complain about these issues.
Thanks,
MartinHi, Martin
Today I tried to update my FV PLayer to the last version to check whether the FancyBox incompatibility between your player and the popular Jupiter theme, which uses this lightbox, had been resolved. Sadly, the lightbox feature of FV Player doesn’t work in an updated Jupiter installation.
Console:
TypeError: e.fancybox.getInstance is not a function
fancybox.js:12:20427
<anonymous> https://mysite.com/wp-content/plugins/fv-wordpress-flowplayer/js/fancybox.js?ver=7.4.6.727:12
jQuery 2
dispatch
handle
JQMIGRATE: Migrate is installed, version 1.4.1 jquery-migrate.min.js:2:552
23423 full-scripts.6.4.0.js:2:1042
fancyBox already initialized fancybox.js:11:589
onmozfullscreenchange is deprecated. fv-flowplayer.min.js:10:7644
onmozfullscreenerror is deprecated. fv-flowplayer.min.js:10:7644
Loading failed for the <script> with source “https://www.google-analytics.com/analytics.js”. remember-love:1:1
Loading failed for the <script> with source “https://www.google-analytics.com/analytics.js”. remember-love:1:1
Content Security Policy: Ignoring “’unsafe-inline’” within script-src: ‘strict-dynamic’ specified
Content Security Policy: Ignoring “https:” within script-src: ‘strict-dynamic’ specified
Content Security Policy: Ignoring “http:” within script-src: ‘strict-dynamic’ specified
Error: Cannot set user agent for iframe with location different to this page content.js:150:25
uncaught exception: null
Loading failed for the <script> with source “https://google-analytics.com/ga.js”. remember-love:1:1
ready for rock full-scripts.6.4.0.js:5:8904
TypeError: e.fancybox.getInstance is not a function
2 fancybox.js:12:20427There have been some ideas in this thread to work around this issue. Are you considering work on this incompatibility? Jupiter is a rather popular theme…
Thanks,
AkosHi Akos,
Thanks for the issue report.
I’d suggest you disable the built-in Lightbox in the Jupiter theme. If you’d like us to customize the Jupiter theme for you to disable FancyBox, please pick up a pro support incident and we’d be happy to work with you hands-on to resolve your issue.
Thanks for being part of Foliovision!
Hi Martin,
You wrote:
For the later two cases it’s impossible to fix. We could only add a code to our plugin which prevents these old versions from loading in order to not break the FV Player lightbox functions. But then it’s hard to guarantee that it these plugins keep working.
I’m strongly against running multiple lightboxes. People should either use the FV Player lightbox (FancyBox) or the other lightboxes. If publishers feel they need two lightboxes what they really need is a developer to sort out which lightbox they should use.
FV Player’s lightbox functionality should be flexible enough to work in anyone else’s lightbox (albeit with slight design changes).
WordPress is heavy and overloaded with scripts enough not to be adding two lightboxes!
Hello Akos,
it’s not clear if you need the theme lightbox functionality or not.
Will enabling Settings -> FV Player -> Integrations/Compatibility -> “Remove fancyBox” (description reads “Use if FV Player lightbox is not working and you see a “fancyBox already initialized” message on JavaScript console”) fix the issue for you?
Thanks,
MartinThanks for the replies!
On my test site I checked the ‘Remove FancyBox’ setting, everything else under ‘Compatibility’ is unchecked. It’s the same result if I check ‘Load FV Flowplayer JS everywhere’.
The sound of the video plays but no lightbox appears. The console still reports ‘fancyBox already initialized’.I am using the theme’s lightbox for photo galleries, so disabling the script would not work for me. I am thinking however, maybe it’s possible to skip loading the FV Player FancyBox script, but still use it.
THanks,
AkosHello Ákos,
we would like to test if FV Player could work with other lightbox plugins out there and not load its own copy of Fancybox library in these cases.
you sent us a link to your staging site privately – the challenge here is that your website uses fancyBox 2 while FV Player is using version 3.
Your theme is also bundling the Fancybox script and so FV Player is not able to remove it, which is too bad, as your photo gallery functions might work just fine with fancyBox 3 provided by FV Player.
Could you please install a new development version of FV Player from this link? https://github.com/foliovision/fv-wordpress-flowplayer/archive/fancybox-2-fallback.zip To do that you will have to first deactivate and delete the current FV Player plugin you are using. WordPress will warn you that you might loose settings and data, but it’s not the case with our plugin, no settings now videos will be lost. Or you can just replace the plugin files via FTP.
That new function supports fallback to fancyBox 2 – so the video lightbox should be working with it on your staging website.
Thanks,
MartinHi Martin,
If someone is using a theme with an old and tired version of FancyBox, it’s really up to the that publisher to modify the theme to use our up-to-date version of FancyBox. Modifying a theme isn’t that difficult. Just turn off the FancyBox in the theme or rip it out of the theme manually.
David’s issues where he needs some of the FV Player javascript and doesn’t need other parts of it is a more interesting case. We should review that in person.
Hi Martin,
This version works because there is no conflict between the scripts. Thanks for the effort!
I tested, maybe if I deactivate the theme script minifying, the theme won’t bundle the fancyBox script. Are you saying that FV Player could/should/would be able to remove it in this case? (the lightbox didn’t work) Is there a setting I need to enable for that?
Anyway, thanks. I presume you won’t roll back to fancyBox v2 just for me :)
Alec, I understand your point of view, of course.
I wrote Artbees, the developer company of the Jupiter theme to inquire whether they are planning to update the script in question.
Thanks again for the workaround!Hello Ákos,
did deactivate the theme script minifying solve the issue? You can reinstall FV Player from wordpress.org and enable the Settings -> FV Player -> Integrations/Compatibility -> “Remove fancyBox” setting in it and you should see – do you get photos in lightbox and video in lightbox as well?
You should be using a separate plugin for the JS minification. WP Rocket does a great job in that aspect. Although what you really need to speed up your website is asynchronous CSS and deferred JavaScript loading, which is also in capabilities of that plugin.
Thanks,
Martin