• Resolved dogel

    (@dogel)


    Hi,

    I just wonder if there is any way to choose/upload my own thumbnail image for the displayed player preview when using You Tube Lyte? Or use another image/frame from the Youtube movie instead of the official one?

    Looks like no, but maybe I oversaw something…

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    there is a filter you could use (lyte_match_thumburl), but that will require PHP coding dogel, so not sure is this is useful for you?

    Thread Starter dogel

    (@dogel)

    @optimizingmatters PHP coding is fine, my goal is to use this in a php template with data derived from a CPT. Thinking about it, I wonder if You Tube Lyte applies / can be applied to youtube links that are *not* part of the content, but (with dynamical URLs) inside the template code?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    possible, but you’d have to hook into lyte with some other filter in that case dogel

    I’m thinking (and started but put on pause) doing stuff with the output buffer or hooking into other plugins for that purpose to ensure LYTE “sees” all YT embeds. this should happen one day ..

    Thread Starter dogel

    (@dogel)

    Hmm, I just realized that I *can* use the Lyte shortcode in the PHP template (i.e. not needing to have it in the_content()), and that I can pass the Youtube ID to it as a variable.

    I can layer the intended thumbnail image over the lyte-wrapper covering it, add an additional button which when clicked triggers a jQuery function that changes the z-indexes to put the lyte-wrapper on top and trigger a click on it to start playing.

    Actually now I more or less got what I wanted ??

    So anyway, thanks for responding!

    • This reply was modified 3 years, 11 months ago by dogel.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome ??

    This works for me. I add this to the page template

    <?php if(function_exists('lyte_preparse')) {echo lyte_preparse('R3SIGImZRHg');};?>

    and hook the custom thumbnail in the functions.php like this

    add_filter('lyte_match_thumburl','lyte_my_own_thumburl');
    function lyte_my_own_thumburl($thumb) {
      if(is_page('page-with-video')) {
      	return "https://www.domainname.com/great-image.jpg";
      } else {
        return $thumb;
      }
    }
    • This reply was modified 3 years, 10 months ago by Wendihihihi.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Add own thumbnail image to preview?’ is closed to new replies.