#273 ✓ checked-in
brianchirls

Parser should check if plugin object has loaded when adding track

Reported by brianchirls | January 20th, 2011 @ 01:05 PM | in 0.3 release date

A parser object returns an array of track objects, each of which indicates which plugin the track gets added to by the keys in the object.

That looks something like this:

for ( var key in tracksObject.data[i] ) {
 if ( tracksObject.data[i].hasOwnProperty(key) ) {
  thatkey;
 }
}

(where that refers to the Popcorn.parser object.

This code assumes that every possible plugin is loaded. A parser may provide tracks for a plugin that has not been loaded, where that information may be generally useful but is not needed in a given case.

It should look more like this:

for ( var key in tracksObject.data[i] ) {
 if ( tracksObject.data[i].hasOwnProperty(key) && that[key] !== undefined) {
  thatkey;
 }
}

There are a few different ways we can check on that[key], depending on how thorough you want to be and how much improvising you expect from people using the API.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.

Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.

Shared Ticket Bins

Referenced by

Pages