WordPress.org

Forums

mb.YTPlayer for background videos
[resolved] multiple videos (6 posts)

  1. mr_dw
    Member
    Posted 2 years ago #

    first off, great plugin, easy to use, looks amazing.
    I was just wondering about implementing multiple videos, such as in the 'demo'.
    I would love to be able to select which one was playing, as in the demo, creating a playlist of sorts (just with simple text links).
    I looked at the demo source code but am rather novice when it comes to javascript (and implementing it in wordpress).
    any help would be muchly appreciated, or any links to tutorials on how to do this.
    thanks

    http://wordpress.org/extend/plugins/wpmbytplayer/

  2. pupunzi
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,
    At the time the WP version doesn't have this feature implemented although it supports the method.

    The method you have to use to change the background video is:

    $('[bkgnd video ID]').changeMovie('[YT video url]');

    So, if you are using the YTPlayer for the frontpage you can add a link in the content like that:

    <a href="#" onclick="$('#bgndVideo_home').changeMovie('[YT video url]')"> new video </a>

    Bye,
    Matteo

  3. marian_71
    Member
    Posted 2 years ago #

    Hi,

    First of all thank you for this great plugin.

    I would like to to the same as mr_dw above, but when I tried to post your link code into html editor on page, clicking link does nothing.

    Do I need some plugin or special approach to paste such link with onclick atribute to make it work on page?

    Cheers,
    Michal

  4. pupunzi
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,
    Sorry, the right syntax on wordpress is:

    <a href="javascript:void(0)" onclick="jQuery('#bgndVideo_home').changeMovie('[YT video url]')"> new video </a>

    The $ is not applicable to prevent cross library conflicts.

    Bye,
    Matteo

  5. marian_71
    Member
    Posted 2 years ago #

    Thanks for your support Matteo. I managed to make it work using your hint - I had to change only the div ID, so the code looked like:

    <a href="#" onclick="jQuery('#bgndVideo1').changeMovie('https://www.youtube.com/watch?v=xxxxxxxxxxx')"> new video </a>

    Thanks once again!
    Michal

  6. pupunzi
    Member
    Plugin Author

    Posted 2 years ago #

    Ok, That because your video has been inserted using the short code in the page editor; This case the DIV id is different as you can have more than one video per page (f.e.: one as background and one as in line player).

    Bye

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic