Support » Plugin: WP YouTube Lyte » Wp YouTube Lyte For Buddypress

  • Resolved Kparth3000

    (@eforreal79)


    Hi,

    Any chance that this great plugin could be configured to work on YouTube videos posted in Buddypress activity? Works great on blog posts.

    Thanks

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

    (@optimizingmatters)

    should be easy-ish, provided BP has a filter that allows to filter it’s content. do you know if that’s the case by any chance? ๐Ÿ™‚

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    ok, can you try the following code snippet?

    add_filter('bp_get_activity_action', 'lyte_parse');
    add_filter('bp_get_activity_content_body', 'lyte_parse');

    frank

    It worked. Thank you very much

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Great, feel free to leave a review of the plugin and support here! ๐Ÿ™‚

    I just noticed something else. When I scroll down to the point where the content has to “Load more,” youtube videos go blank, and will not play. You can see it for yourself here:

    https://www.efor-real.com/activity/

    Here is also a screen capture:
    https://prnt.sc/qa15fd

    Thanks again

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’ll have to hook the “infinite scroll”-JS into lyte, see the example for “infinite scroll” in the LYTE FAQ .

    Kparth3000

    (@eforreal79)

    I tried hooking it up to this but it is still not working:

    /* Load more updates at the end of the page */
    if ( target.parent().hasClass(‘load-more’) ) {
    if ( bp_ajax_request ) {
    bp_ajax_request.abort();
    }

    jq(‘#buddypress li.load-more’).addClass(‘loading’);

    if ( null === jq.cookie(‘bp-activity-oldestpage’) ) {
    jq.cookie(‘bp-activity-oldestpage’, 1, {
    path: ‘/’,
    secure: ( ‘https:’ === window.location.protocol )
    } );
    }

    oldest_page = ( jq.cookie(‘bp-activity-oldestpage’) * 1 ) + 1;
    just_posted = [];

    jq(‘.activity-list li.just-posted’).each( function(){
    just_posted.push( jq(this).attr(‘id’).replace( ‘activity-‘,” ) );
    });

    load_more_args = {
    action: ‘activity_get_older_updates’,
    ‘cookie’: bp_get_cookies(),
    ‘page’: oldest_page,
    ‘exclude_just_posted’: just_posted.join(‘,’)
    };

    load_more_search = bp_get_querystring(‘s’);

    if ( load_more_search ) {
    load_more_args.search_terms = load_more_search;
    }

    bp_ajax_request = jq.post( ajaxurl, load_more_args,
    function(response)
    {
    ly.te()

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    i don’t know buddypress and their JS, so can’t really comment on this i’m afriad Kparth3000, but that last part at least looks incomplete to me?

    Kparth3000

    (@eforreal79)

    Okay. Thanks all the same. And yes, this is the rest of the script:

    jq(“#content li.load-more”).removeClass(‘loading’);
    jq.cookie( ‘bp-activity-oldestpage’, oldest_page, {
    path: ‘/’
    } );
    jq(“#content ul.activity-list”).append(response.contents);

    target.parent().hide();
    }, ‘json’ );

    return false;
    }
    });

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    well, I had a quick look at the URL you provided and;
    * the LYTE vids indeed don’t load
    * when I execute ly.te(); in the console the vids do show
    * I don’t find the code you mentioned above (searched for jq(โ€œ#content li.load-moreโ€).removeClass(โ€˜loadingโ€™); in the debugger)

    Kparth3000

    (@eforreal79)

    Everything works beautifully. Thanks for the tip.

    I highly recommended this plugin if you want your YouTube videos to load faster.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    you’re welcome, feel free to leave a review of the plugin and support here! ๐Ÿ™‚

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.