Monthly Archives: September 2011

My 0.1 Release for OSD600 with Popcorn.js

My chosen project for my 0.1 Release, and hopefully rest of the semester as I frankly enjoy it a lot, is Popcorn.js.

For media makers:
Popcorn.js allows video, audio and other media to control elements of a webpage. Combining our library with a mixture of standard HTML + JavaScript, authors can let their media be the “conductor” of interactive and immersive experiences.

For developers:
Popcorn.js is an event framework for HTML5 media. Popcorn.js utilizes the native HTMLMediaElement properties, methods and events, normalizes them into an easy to learn API, and provides a plugin system for community contributed interactions.

Current Release: 0.8
Github Account Containing most recent release: Current Code
Lighthouse Ticket System: Popcorn.js Tickets

My Contributions
Ticket #733: Typo in Facebook PluginRepo Code
Ticket #734: Dry-Out Facebook Plugin CodeRepo Code

Oddly enough these ticket choices kind of came to me accidentally. I was originally going to be working on ticket #350 but an odd set of events occured which can be read here.

Basically my job here with these two tickets was to first fix that one small typo and then add two missing tests for there. After that it was brought up that there were a fair amount of inefficiencies with the code. A fair amount of the code was duplicated in places and because of how the facebook API functioned a lot of it could be refactored to be made simpler.

In the end I added a lot to the tests as well as I found plenty of things that were missing. This helps a lot because it makes sure that the code is robust and errors that could affect the users aren’t slipping through.

I make it sound easy, but really I went through a lot. If you read the comments for ticket 734 you can see that I had my code rejected more than once. It ranged from merge conflicts to style choices to me simply forgetting to write tests for one or two things (Seriously folks, get used to writing tests). I’m happy that I encountered these problems early on as it makes me feel almost like a seasoned vet of the project (Well, that’s probably a stretch :P).

I still have a lot to learn when it comes to the more complicated javascript principles or writing styles but I feel like I’ve learned a fair bit at this point and actually understand most of the code in that file!

For now I’m looking forward to contributing more to Popcorn.js with their 1.0 release in the coming months. There’s a lot of work coming that’s going to need people to help work on and I’ll be there to do it! Look for #350 and #740 code coming in the next few weeks as this is my plan of attack at this point!

Hack On!


Getting your Code into a Software Release

First off I’ll premise this with the fact that this isn’t exactly a guide on how to get it done but rather my experiences with getting my own code commited, reviewed and eventually staged and on it’s way to the 0.9 release of Popcorn.js.

It all started Thursday night when I was browsing through some of the existing plugins to try and figure out the language some more so I could start working on the ticket I choose for the tumblr plugin. I was looking at the Facebook plugin when I noticed an error left over from the original writers copy and paste from the flickr plugin that read:

flickr target container doesn’t exist

Flickr container you say? Well of course, this is the facebook plugin! Anyway I found this quite humorous so I figured I would point it out on IRC for a good laugh and chuckle from everyone. Shortly afterwards though John Buckley quickly asked me to file a ticket for it, claim it and then commit said code so it could be reviewed. At first I was rather surprised because to me it seemed like it would be such a waste of everyones time for such a minor error, that I could easily just fix it anyway and there wouldn’t be a need to “waste time” with a ticket on it. John quickly said to me however that it really doesn’t matter how small the issue is, that you really need records of every change that’s made to the code so people can know why and when there were changes made. So I did and decided I would worry about it later the next day.

While I was headed to sleep Rick Waldron updated the ticket to a sooner release (1.0 to 0.9) knowing it could be in a sooner release. He also wondered what I could do to test the situation for when that error would be thrown because there currently was no test for this in the current facebook.unit.js tests. Sure enough most of my afternoon I was trying to figure out how to write this test with no success at all for the first little while. Eventually Rick gave me the hint of using a try..catch block of some sort as well as some example code to start and along with David Humphrey reminding me to look at some of the test suites for the other plugins. Sure enough once I took a loot at the tests for the lastfm plugin it all immediately clicked. Double checks and a few runs with the test suite later, I have a piece of code that has passed both reviews and has been staged. I will officially have code in the 0.9 release of Popcorn.js and it’s really because of the help from Rick and David Seifried. They were great help with me learning what the heck I had to do because they realized I wasn’t a “Javascript Jedi” knowing what to do completely. I hadn’t written javascript since INT222 and that stuff was incredibly basic.


Anyway. It was quite the day and really I am feeling pretty good right now. I still can’t say I truly know what I am doing when it comes to Javascript but it’s really assuring to know that I can always ask the community for help and that they will do what they can. Don’t forget to return the favor however people if you ever have the opportunity to!

Taking the Plunge Into IRC and Learning From It

To start off I wanted to get the mandatory discussion about this weeks readings/resources out of the way so I can get on about my experiences this week with IRC and the popcorn team at CDOT.

After watching both of the videos I can tell that there was one evident theme and that was how important the community is to open-source development. Without a community for the development of a piece of open-source software there wouldn’t be any way for it to truly thrive because there wouldn’t be a way for people to find out about the project and contribute to it.

Adventures in IRC
This week is when we all found out what exactly the channel names were for each of the projects and we were sent out to talk to the communities and find out more about the projects so we could get a good idea as to which we would be interested in. I jumped into the #popcorn channel initially because I figured it would be an easier way for me to break the ice and be comfortable there because I know some of the people who are in CDOT working on popcorn. Needless to say this took some of the pressure off my shoulders and allowed me to find out some useful stuff.

I was pointed in the direction of some starter tickets, ones that would be good to dive in to because they aren’t necessarily core features that are important to the immediate future functionality of popcorn meaning it’s okay if they aren’t done right now.

In addition I was able to get my lighthouse account approved for popcorn and with the help of John Buckley I was able to get some hands on assistance getting the most up to date develop branch so I could take a look at some of the code of the tickets I was interested in. It’s tougher than it looks! Don’t fret however, I hear he is stopping by for next week to help show us ” the ropes ” when it comes to using github.

Oddly enough I was able to make my first contribution today to the community, albeit a small one and one that wouldn’t count as my first 0.1 release (Darn!). The ticket I was originally interested in was #707. There was an issue previously with how timed elements were being added to the div’s when their direction was set to down. In a working state this means the new time element would be appended below the previous element in the div. However it turned out in the end that this issue was fixed in ticket #655 and was a duplicate ticket. Quickly made a comment about it and the status of the ticket was changed and everyone was happy (only briefly however as they’re all too busy :P).

Choosing a new ticket and the concerns I have
At this point I’m looking at taking a ticket that would be writing a potential new plugin for another website like #350 which is for a tumblr plugin. It seems interesting enough and they have an API here that I’ve looked over. Truthfully it leaves me confused on a few fronts.

  • How much of that am I supposed to write? Popcorn allows video, audio and other media to control the elements of a webpage. Does that mean I have to be writing methods in it that cover the video and audio portions of the API and more?
  • I understand I need an auth key as mentioned in the beginning of the API but I have no experience with JSON.

Honestly I feel it all comes down to 2 things.

  1. I don’t know any Javascript beyond the basic stuff I learned during INT222, which was 2 years ago at this point. I still have it sitting on my harddrive but it isn’t anywhere nearly as complicated as this stuff is.
  2. I don’t know how to interact and use the information that the services for their API provide me.

I’m sure I’ll be fine in a good 3 or 4 weeks time but at this point I’m worried more worried about how much I’m exactly supposed to have done for our first release. None the less I plan on studying more of the code for other plugins as well over the next few days so I can hopefully get more of an idea on how to go about writing some of it.

Thanks for putting up with the mini essay here. Hope you enjoyed reading it!

The Terms and Conditions We Agree To

First week of classes for the fall semester and the one course that I am easily the most excited to take is OSD600. I’ve been limited in what I have been able to experience programming wise and I really want to get involved in something that matters and will expose me to real world standards. This course will allow me to do that and hell, if I do well enough and put in a lot of effort I might just find myself with a position as a researcher for CDOT! (one can hope at least :P)

Anyway besides all the the normal first class administrative stuff we all go through we were asked by our professor, David Humphrey, to comment on two different sets of software license agreements; one open source and one proprietary license. I choose to look over the Apple License Agreement for Mac OSX 10.7 as I recently upgraded to it and was curious about what silly things I agreed to without even reading them. The other I chose was the open source BSD 2 Clause as I wanted to know more about this one in particular never having used it myself.

  1. I had no idea that I was limited in how many instances of Mac OSX I can run using a virtual machine. In this case Apple limits you to two. I personally don’t have the need for it anyway to run any VM instances of OSX but still it seems a little bit odd to me that they would want to limit you.
  2. While this section below doesn’t surprise me as any company will always stay away from the blame, I still found the wording incredibly funny.


  3. The fact that we agree to an enormous amount of data to me taken about how we use the software. Whether it’s diagnostic, usage or location data that Apple and any third parties that are considered to be apart of Apple; it’s a lot. They say that the purpose is to make their own service better but I don’t believe them really.

    By using any location-based services provided by or through the
    Apple Software, you agree and consent to Apple’s and its partners’, licensees’ and third party
    developers’ transmission, collection, maintenance, processing and use of your location data and
    queries to provide and improve such products and services

When it comes to the BSD 2 Clause license agreements you can essentially do whatever you want. The only requirements are that you show the appropriate copyright information in your source/binary files and provide a disclaimer saying the software is “As Is” for binary files.

One thing’s for sure, open source is a really easy way to dive in and work with real code that people use without the limitations of proprietary licenses.

Anyway, that’s it for now. Tune in next week!