I'm facing an interesting issue. I've implemented FancyBox lightbox to showcase a "video" tag when users click on the image thumbnail, and it functions well with all varieties of HTML5 video. The challenge arises when testing in browsers older than IE9, as the flash fallback fails to load.
To automatically detect the "video" tag and create a flash fallback "object" if needed, I have utilized the HTML5Media.info HTML5 video JavaScript plugin. However, this linked file cannot be edited since it doesn't reside on my server.
The problem seems to stem from the "display: none;" property on the enclosing DIV.
Although solutions like
height: 0; width: 0; overflow: hidden;
have been suggested, they are not viable in my situation. Since the flash object/embed is dynamically generated based on the user's browser and FancyBox depends on "display: none;", these won't work. Modifying FancyBox across the site to accommodate this specific issue would involve unnecessary effort.
I am seeking a way through JavaScript or jQuery to detect whether the surrounding DIV is set to display none or not, and then initiate loading the flash video once the DIV becomes visible.
Is there a possibility of achieving this using an AJAX call?
If you have any insights on how to tackle this, please share. I'm still learning JavaScript and any guidance is valuable!
I regret not providing a reference link due to confidentiality reasons related to the project.