nomensa/Accessible-Media-Player — pull request #22 by tombye (2013-01-23 14:52:46+00:00)
Title: Change YouTube player API to IFrame version

This pull request converts the YouTube player from using the standard API player to using the IFrame API[1] by default. The result of this is that devices without support for flash can now play videos.

We’ve also added unit tests for all of the code we added.

The above required a few changes to the project structure:

- Adding a testing framework[2]
- Introduction of a NOMENSA namespace to reduce public footprint and to make testing easier
- Addition of a build script to output a minified/compressed version of the script for deployment[3]

We’ve also extended the existing architecture to provide a more structured way of implementing additional video players in the future.

The existing code made objects which held the methods for interfacing with the player (SWF or HTML5) API and those for interfacing with the HTML controls. These methods were stored separately from the object constructor and were applied during the creation of a new instance.

Instead, we have a constructor for each type of player, which is then sent to a decorator to have the control methods for interfacing added.

This approach has just been applied to the Youtube player we’ve added and its integration into the existing plugin code. The longer term intention is to follow this approach for all supported players.

[1] https://developers.google.com/youtube/iframe_api_reference
[2] https://github.com/jcarver989/phantom-jasmine
[3] http://developer.yahoo.com/yui/compressor/