I have a video array set up, and a set of six thumbs that each correspond with a video in the array to play it, and then a function calling for the next to be played. Instead of playing the next video when it ends however, it goes to play the first video in the array, then goes through the list.
I have the jsfiddle so you can see exactly what I mean.
And then how can I make it stop looping when it reaches the end. (I’m sure this is simple, but I’m suffering from severe lack of sleep and a deadline)
It looks like you’re always passing 0 to your
playArraycallback.This fiddle works, but it stores the index in a higher scope which you were probably trying to avoid: http://jsfiddle.net/RichardTowers/WFT3U/1/
A simple way to stop looping when you reach the end, just don’t call
loadandplay: http://jsfiddle.net/RichardTowers/WFT3U/2/.