Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3394414
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:10:03+00:00 2026-05-18T04:10:03+00:00

So in the project ive been working on i use the youtube API to

  • 0

So in the project ive been working on i use the youtube API to add a video to a chromeless player (got custom buttons, everything works no problems).

It loads the youtube id which it gets from the database (Codeigniter, PHP).
But what i would like to see is: instead of loading 1 video, id like to add all the videos i get from the database in the cue of that one player.

So only one screen, first video retrieved from dbase gets played first, when its done second get loaded preferably also looped. Is there any way i can achieve this?

My first guess would be to save the array with youtube id’s somewhere and on state change (when the ‘video stop’-event gets fired) load the next id from the array. Havent tried this yet because id prefer if the cue gets just gets filled on the init, so it doesnt have to load after a video has been ended. Is This possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T04:10:04+00:00Added an answer on May 18, 2026 at 4:10 am

    First, you must use Youtube API version 2 to activate newly statechange function.

    This is the code for you:

    var video_list = [
        '21OH0wlkfbc',
        'InZNBcJTmWs',
        'iIzqYiRo01E',
        'ZYmADPVEqU4'
    ];
    var video_current = 0;
    
    function onYouTubePlayerReady( ) {
        var o = document.getElementById( 'ytplayer2_object' );
        if( o ) {
            o.addEventListener( "onStateChange", "ytplayer_statechange" );
        }
    }
    function ytplayer_statechange( state ) {
        // 0 => video ended
        if ( state == 0 ) {
            video_current++;
            video_current %= video_list.length;
            ytplayer_loadvideo(video_list[ video_current ]);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the Youtube Chromeless Player (the new AS3 version) in a
I've been working on a project where I need to iterate through a collection
I've been working on a project that accesses the WMI to get information about
I've been working on a project in Delphi 7 where I wanted to have
I've been working on a project that can't be described as 'small' anymore (40+
I've been working on a visualization project for 2-dimensional continuous data. It's the kind
I've been working on a project of porting an old solaris CL program to
I've been working on an embedded C/C++ project recently using the shell in Tornado
I've been working on an Eclipse plug-in project for a while now, and I've
I've been working on a ASP.NET project that is going to save uploaded files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.