WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] Combination with automated youtube thumbnails (6 posts)

  1. fancyfan
    Member
    Posted 2 years ago #

    I'd love to have automated youtube thumbnails in the youtube player design. After clicking on one of the thumbs, the "real" youtube player should pop up in the easy fancybox.

    Ideally, the easy fancybox would be combined with the wp youtube-lyte plugin . Is that possible?

    It would be perfect to have automated and clickable youtube thumbnails that open up the player in a fancybox.

    Otherwise, it is a lot of work to manually create the thumbs and link them to the fancybox.

    I'd love to achieve something like on this site (scroll down a bit): http://www.mydealz.de/20527/panasonic-lumix-dmc-tz22-ab-149e-super-zoom-kamera/ The youtube-thumb seems to be automated and the actual video is opened in a fancybox.

    http://wordpress.org/extend/plugins/easy-fancybox/

  2. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    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...

  3. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    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 :)

  4. fancyfan
    Member
    Posted 2 years ago #

    [ 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 :)

  5. RavanH
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  6. fancyfan
    Member
    Posted 2 years ago #

    Excellent improvement, thanks a lot for sharing this! That performs flawlessly and it's a good backup solution :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic