WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: Easy FancyBox] Combination with automated youtube thumbnails

[Resolved] [Plugin: Easy FancyBox] Combination with automated youtube thumbnails

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author RavanH

    @ravanh

    It depends on how WP Youtube Lite works… Can it simply create a thumbnail that is linked directly to the Youtube page itself?

    If so, then adding Easy FancyBox with Youtube plus Auto-detect enabled should work just fine 🙂

    If it can only do a thumnail that when clicked, opens the Youtube movie ‘in place’ it might be more difficult to make the two plugins work together…

    Plugin Author RavanH

    @ravanh

    Else, you might find http://wordpress.org/extend/plugins/video-thumbnails/ usefull. Apparently it automatically gets a thumbnail for the linked (or only embedded?) video and adds it to the media library. You can then use this thumbnail to insert in your post and link it to the original Youtube URL.

    Easy FancyBox will then handle the rest 🙂

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    Thanks for the fast response! 🙂 In the meantime, I’ve asked the developer of WP youtube lyte and he mentioned the following solution (might be of interest for other users of easy fancybox as well, who want to achieve the same):

    open up lyte/lyte-min.js and change

    tH.innerHTML="<iframe id=\"iF_" + vid + "\" width=\"" + tH.clientWidth + "px\" height=\"" + aHgh + "px\" src=\""+eU+"autoplay="+aP+"&wmode=opaque&rel=0&egm=0&iv_load_policy=3&hd="+hidef+qsa+"\" frameborder=\"0\" style=\"" + aSt + "\"></iframe>"

    into

    jQuery.fancybox("<iframe id=\"iF_" + vid + "\" width=\"" + tH.clientWidth + "px\" height=\"" + aHgh + "px\" src=\""+eU+"autoplay="+aP+"&wmode=opaque&rel=0&egm=0&iv_load_policy=3&hd="+hidef+qsa+"\" frameborder=\"0\" style=\"" + aSt + "\"></iframe>");
    
    remove the code tH.onclick="";

    It works fine for me now with easy fancybox 🙂

    Plugin Author RavanH

    @ravanh

    Hey, thanks for sharing 🙂

    Some warnings though:

    If ever FancyBox gets disabled on your site (by accident, forgetfulness or after a failed upgrade for example) then the youtube lyte plugin will not work anymore. Maybe you could use this as a fallback:

    if( jQuery().fancybox )
    {
        jQuery.fancybox("<iframe id=\"iF_" + vid + "\" width=\"" + tH.clientWidth + "px\" height=\"" + aHgh + "px\" src=\""+eU+"autoplay="+aP+"&wmode=opaque&rel=0&egm=0&iv_load_policy=3&hd="+hidef+qsa+"\" frameborder=\"0\" style=\"" + aSt + "\"></iframe>");
    } else {
        tH.innerHTML="<iframe id=\"iF_" + vid + "\" width=\"" + tH.clientWidth + "px\" height=\"" + aHgh + "px\" src=\""+eU+"autoplay="+aP+"&wmode=opaque&rel=0&egm=0&iv_load_policy=3&hd="+hidef+qsa+"\" frameborder=\"0\" style=\"" + aSt + "\"></iframe>";
    }

    and something similar for the removal of tH.onclick …

    Another thing to remember is that your customisations will get overwritten on an upgrade of the youtube lyte plugin.

    Excellent improvement, thanks a lot for sharing this! That performs flawlessly and it’s a good backup solution 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] [Plugin: Easy FancyBox] Combination with automated youtube thumbnails’ is closed to new replies.