Skip to content

Popcorn.js – Plugins and bugs

March 20, 2011

Recently I picked up a new plugin ticket for popcorn (here) that should allow the user to add things like scrolling credits, or information, or whatever text/links they want to a given time in the video.  I chose this bug because my old one sort of got taken over but some other dude in my class after I filed a new ticket about it regarding that it should be dealt with as a plugin.  Its really my own fault, as I never re-added my name to the new ticket I created, so I can only blame myself.

For this new ticket I began by taking a look at some of the examples that were posted in the ticket, and took a lot of ideas/inspiration from Nic (who posted in the ticket thread).  He essentially created something like this on his own and seemed pretty cool, so I rolled with that.  Essentially I used the same basic layout as I did for my previous plugin, except a lot of code was removed, as there was no script injecting or asynchronously loaded scripts.  This made the main body of the code very short and easy to work with.  After I had a semi working version I realized 2 things.  1) Currently to make a plugin display from the start of the video to the end and continue to display after the video is finished, you have to specify an end time that is greater than the length of the video, and 2) That if you omit the end tag all together in your parameters, the plugin will do a few undesired things.  The plugin will first, not display at all, and will also prevent the end attributes for any other plugins from functioning properly.  This all seemed like behavior that was undesired in popcorn, so I figured I’d mention it in IRC.  After explaining what was going on to humph, annasob, and rwaldron, I was told to file tickets for both issues.

After filing the bugs (here and here)I began to work some more on the plugin.  I then realized something that has halted continuation on the plugin.  The way I’m doing it is allowing the user to enter a title, text (which is essentially whatever text they want under the title), and then a link.  The problem is, what if the user wants to add more then one link? What if the user wants a link embedded in the text?  I have yet to come up with a concrete solution for this, and I’m sort of waiting until Monday to begin working on everything again, as IRC will be more active then.  I think what will end up happening will be that I will ultimately remove the link parameter and find a way to allow the user to add it directly into the text, as that will be the most desirable effect (in my eyes).  If it is in the text the user types in tho, and they want to name the link as something else instead of having the actual URL displayed, then what?  I think im going to have to come up with something like how lighthouse and many other sites handle this sort of problem.  I will create something like the following:  [Lighthouse](http://lighthouseapp.com/ "Lighthouse")which is what lighthouse does.  I would then have to parse the text that is being passed in, looking for any instances like what I just mentioned.   This should give me the effect I’m looking for.  The only downside to doing something like this, is making sure the user is aware of features like that, as well as how to use them.  Better make sure I document this one well.

Advertisements

From → school

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: