Skip to content

Commit

Permalink
Adds new Popcorn instance member: trackRefs - object, Store track eve…
Browse files Browse the repository at this point in the history
…nt object references by trackId
  • Loading branch information
rwaldron committed Jun 2, 2011
1 parent b727e19 commit f5d870a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions popcorn.js
Expand Up @@ -161,6 +161,9 @@
// Store track event history data
history: [],

// Store track event object references by trackId
trackRefs: {},

// Playback track event queues
trackEvents: {
byStart: [{
Expand Down Expand Up @@ -632,23 +635,22 @@
var byStart = obj.data.trackEvents.byStart,
byEnd = obj.data.trackEvents.byEnd,
idx;

for ( idx = byStart.length-1; idx >= 0; idx-- ) {

if ( track.start >= byStart[idx].start ) {
byStart.splice( idx + 1, 0, track );
break;
}
}

for ( idx = byEnd.length-1; idx >= 0; idx-- ) {

if ( track.start >= byEnd[idx].start ) {
byEnd.splice( idx + 1, 0, track );
break;
}
}

};

Popcorn.removeTrackEvent = function( obj, trackId ) {
Expand Down

0 comments on commit f5d870a

Please sign in to comment.