Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
adding to the playlist parameter of the Youtube API iframe

Is there a way to "push" another youtube ID to the playlist parameter. And if not how do I create a array variable outside of the onYoutubePlayerAPIReady function that I can add to?

        function onYouTubePlayerAPIReady() {
            player = new YT.Player('player', {
                height: '1080',
                width: '1920',
                loadPlaylist: {
                    playlist: ['56R3hU-fWZY', 'O-ZblMfZpuw', 'l3w2MTXBebg'],
                    index: parseInt(0),
                    suggestedQuality: 'default'
                },
                events: {
                    'onReady': onPlayerReady,
                    'onStateChange': onPlayerStateChange
                }
            });
        }

        function onPlayerReady(event) {
            event.target.loadPlaylist(['56R3hU-fWZY', 'O-ZblMfZpuw', 'l3w2MTXBebg']);
        }

        function onPlayerStateChange(event) {
            if (event.data === YT.PlayerState.ENDED && !done) {
                player.loadVideoById(myFetchedNextVideoId)
            }
        }

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!