diff --git a/popcorn.js b/popcorn.js index 5945134de..c25c08b1b 100644 --- a/popcorn.js +++ b/popcorn.js @@ -779,10 +779,10 @@ Popcorn.getTrackEvent = function( obj, trackId ) { var byStart = obj.data.trackEvents.byStart, - len = byStart.length, i; + len = byStart.length; - for (i = 0; i < len; i++) { - o = byStart[i]; + while ( len-- ) { + o = byStart[len]; if ( o._id === trackId ) { return o; }