How do I navigate through a playlist using the Youtube Javascript API?

Louis93

Once I've created a playlist using the loadPlaylist method which is just an array of video urls, I want to be able to navigate to through the playlist.

The function described in the documention playVideoAt(int) seems to be able to do this, but after calling it a single time, you lose reference to the entire playlist.

Meaning that I could call playVideoAt(2) and navigate to the third video in the playlist I've created, but I cannot use this function again, and I am now unable to navigate any further through the list.

Are there any workarounds or suggested fixes I could use?

jlmcdonald

Here's an issue that was recently filed for this problem -- it does seem to be a recently introduced bug.

https://code.google.com/p/gdata-issues/issues/detail?id=5018&q=playvideoat&colspec=API%20ID%20Type%20Status%20Priority%20Stars%20Summary

If you're in need of a temporary workaround, in lieu of videoPlayAt() you could just call 'cuePlaylist() again (or loadPlaylist() to have it autoplay) and pass it an index, like this:

player.cuePlaylist({'listType':'playlist','list':'[PLAYLIST ID]','index':[VIDEO INDEX NUMBER]});

You can test it in this fiddle:

http://jsfiddle.net/jlmcdonald/uz68V/3/

Hopefully it'll be resolved soon.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I return the number of videos in a YouTube playlist using javascript?

From Dev

I need a working example to retrieve a public youtube playlist using youtube Data API 3 for JavaScript

From Dev

How to get data of a youtube playlist in JSON format using JavaScript API V3

From Dev

How do I navigate through a dictionary like this?

From Dev

How would I delete a playlist using YouTube API V3? Or would I have to use an AJAX DELETE method?

From Dev

Is there a way to add a video to a Youtube playlist through Youtube API as a contributor?

From Dev

Delete videos from playlist using YouTube API

From Dev

How can I auto-play a YouTube playlist using mps-youtube?

From Dev

How do I hack the YouTube JavaScript API to always use HTTP?

From Dev

How can I download a YouTube playlist?

From Dev

Unable to delete a youtube playlist using youtube api v3

From Dev

Unable to delete a youtube playlist using youtube api v3

From Dev

Order of the youtube Playlist api

From Dev

using php, how do i upload youtube videos on my site using the youtube v3 api?

From Dev

How do I navigate efficiently through emacs buffer modifying lines

From Dev

How do I navigate efficiently through emacs buffer modifying lines

From Dev

How can I scroll through a playlist for audio

From Dev

In bash script how do I ensure youtube-dl downloads all files in a playlist

From Dev

C# Using Youtube API - How do I check the last time a particular user uploaded a video to Youtube?

From Dev

C# Using Youtube API - How do I check the last time a particular user uploaded a video to Youtube?

From Dev

How can I download a youtube playlist with youtube-dl and make it a mp3-playlist?

From Dev

How do I index through a PHP array in Javascript using AJAX?

From Dev

Get the youtube playlist detail using the v3 API

From Dev

Adding a video to a playlist using the Youtube Player IFrame API

From Dev

Adding a video to a playlist using the Youtube Player IFrame API

From Java

How do I get a YouTube video thumbnail from the YouTube API?

From Dev

How to get watched history of youtube user using Youtube Javascript API?

From Dev

Adding video to playlist with Youtube API

From Dev

Youtube API create playlist and embed

Related Related

  1. 1

    How can I return the number of videos in a YouTube playlist using javascript?

  2. 2

    I need a working example to retrieve a public youtube playlist using youtube Data API 3 for JavaScript

  3. 3

    How to get data of a youtube playlist in JSON format using JavaScript API V3

  4. 4

    How do I navigate through a dictionary like this?

  5. 5

    How would I delete a playlist using YouTube API V3? Or would I have to use an AJAX DELETE method?

  6. 6

    Is there a way to add a video to a Youtube playlist through Youtube API as a contributor?

  7. 7

    Delete videos from playlist using YouTube API

  8. 8

    How can I auto-play a YouTube playlist using mps-youtube?

  9. 9

    How do I hack the YouTube JavaScript API to always use HTTP?

  10. 10

    How can I download a YouTube playlist?

  11. 11

    Unable to delete a youtube playlist using youtube api v3

  12. 12

    Unable to delete a youtube playlist using youtube api v3

  13. 13

    Order of the youtube Playlist api

  14. 14

    using php, how do i upload youtube videos on my site using the youtube v3 api?

  15. 15

    How do I navigate efficiently through emacs buffer modifying lines

  16. 16

    How do I navigate efficiently through emacs buffer modifying lines

  17. 17

    How can I scroll through a playlist for audio

  18. 18

    In bash script how do I ensure youtube-dl downloads all files in a playlist

  19. 19

    C# Using Youtube API - How do I check the last time a particular user uploaded a video to Youtube?

  20. 20

    C# Using Youtube API - How do I check the last time a particular user uploaded a video to Youtube?

  21. 21

    How can I download a youtube playlist with youtube-dl and make it a mp3-playlist?

  22. 22

    How do I index through a PHP array in Javascript using AJAX?

  23. 23

    Get the youtube playlist detail using the v3 API

  24. 24

    Adding a video to a playlist using the Youtube Player IFrame API

  25. 25

    Adding a video to a playlist using the Youtube Player IFrame API

  26. 26

    How do I get a YouTube video thumbnail from the YouTube API?

  27. 27

    How to get watched history of youtube user using Youtube Javascript API?

  28. 28

    Adding video to playlist with Youtube API

  29. 29

    Youtube API create playlist and embed

HotTag

Archive