• can you passing in multiple arguments?

    for example, I have a video splitted into 4 parts on youtube and I want to be able to enter [youtube idjifjidjf,djfidjifj,sdfijdifj,sdifdfj]

    the player will play the first video, and at the end of first one, the second will starts to play.. three…and four

    it would be nice to have this feature.

    i think is possible

    /* Youtube Player */
    var ids = new Array();
    var curId = 0;
    function SetupVideoPlayer() {
    ids = $(".video_ids").text().split(',');
    if (ids.length > 1 && ids[0].length > 4){
    $('.node_body').append("<div class=\"video_wrapper\"></div>");
    $('.video_wrapper').append('<div class="video_note">Subsequent part(s) will play automatically when the current part finishes playing.</div>');
    $('.video_wrapper').append('<div id="ytapiplayer">You need Flash player 8+ and JavaScript enabled to view this video.</div>');
    $('.video_wrapper').append('<div class="video_nav"></div>');

    var params = { play: "false", allowScriptAccess: "always", allowFullScreen: "true", wmode:"transparent" };
    var atts = { id: "myytplayer", play: "false" };
    swfobject.embedSWF("https://www.youtube.com/v/"+ids[0]+"?enablejsapi=1&playerapiid=ytplayer&fs=1&showinfo=0",
    "ytapiplayer", "680", "500", "8", null, null, params, atts);

    if (ids.length > 1){
    for (i=0;i<ids.length;i++)
    {
    $('.video_nav').append('Part ' + (i+1) + ' ');
    }
    }
    if (ids.length == 1)
    $('.video_note').remove();
    $('.video_nav .part_0').addClass("active_part");

    }
    return false;
    }

    var first_time_video_load = true;
    var ytplayer;
    function onYouTubePlayerReady(){
    ytplayer = document.getElementById('myytplayer');
    ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
    if (!first_time_video_load)
    ytplayer.loadVideoById(ids[0]);
    first_time_video_load = false;
    }

    function onytplayerStateChange(newState) {
    if (newState == 0 && curId < ids.length - 1){
    PlayPart(curId + 1);
    }
    }

    function ResetPartLinkWeight(){
    for (i=0;i<ids.length;i++)
    {
    $('.video_nav .part_' + i).removeClass("active_part");
    }
    }
    function PlayPart(n){
    if (n>=0 && n<ids.length){
    if (ytplayer) {
    setTimeout("ytplayer.loadVideoById('"+ids[n]+"')", 1000);
    curId = n;
    ResetPartLinkWeight();
    $('.video_nav .part_' + n).addClass("active_part");
    }
    }
    }

Viewing 1 replies (of 1 total)
  • Plugin Contributor viper007bond

    (@viper007bond)

    Just make a playlist on YouTube and them embed it like so:

    [youtube]https://www.youtube.com/view_play_list?p=XXXXXXXX[/youtube]

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Viper's Video Quicktags] can you passing in multiple arguments?’ is closed to new replies.