Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • yellowjersey Friend
    #193149

    Hello,

    I’m experiencing a similar problem as reported by another Fubix user. The K2 “Must See Videos” content module is only loading the generic YouTube thumbnail, and not the thumbnail for the selected video.

    Here is my setup:

    J 3.2
    T3 1.4.3
    Fubix 1.0.4

    I updated the TEMPLATE/html/mod_k2_content/video/default.php with the following code as instructed in another thread:

    <?php

    $vidimg = $vplaceholder;

    //extract youtube id
    if(preg_match_all('@<iframes[^>]*src=["|']([^"'>]+)[^>].*?</iframe>@siu', $item->video, $iframesrc)){
    if(isset($iframesrc[1])){

    $vid = str_replace(
    array(
    'http:',
    'https:',
    '//youtu.be/',
    '//www.youtube.com/embed/',
    '//youtube.googleapis.com/v/'), '', $iframesrc[1][0]);

    $vid = preg_replace('@/.*?@i', '', $vid);
    $vidimg = 'http://img.youtube.com/vi/' . $vid . '/0.jpg';
    }
    }
    ?>

    I have also used the following format for the YouTube code snippet in the Media tab of the K2 article:

    <iframe width=”560″ height=”315″ src=”//www.youtube.com/embed/Z9a4PvzlqoQ?rel=0″ frameborder=”0″ allowfullscreen></iframe>

    In addition, the videos I’ve embedded are not part of a playlist (at least most of them are not).

    Any thoughts on the problem?

    Thanks so much!

    phong nam Friend
    #516243

    Hi,

    I have checked out to replace the Youtube embed video inside the K2 items of Videos category and the K2 content module still displayed fine the video thumbnail images.

    By default, the layout of K2 content and other modules (i.e JA Content Popup) is override to load the first thumbnail image of selected Youtube video, you can see this function:

    $vid = preg_replace('@/.*?@i', '', $vid);
    $vidimg = 'http://img.youtube.com/vi/' . $vid . '/0.jpg';

    i.e I use this video on input inside K2 item and here is how it looks on my end. The 1st thumbnail loaded is 0.jpg (http://img.youtube.com/vi/bekKOmfsWfc/0.jpg).

    In addition, the override module layout will display the thumbnail image of single Youtube video only, not the list of videos.

    Anyways, in this case, I would like to suggest you to check out the module layout again and test the Youtube embed codes. You can backup the site and send me PM with admin login info if the issue still persists on your site.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  phong nam 10 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum