coursera/video.js — pull request #5 by jnwng (2014-02-13 02:08:45+00:00)
Title: Adjusting timer behavior to take into account tech switching

Previously, we only ever set up the inactivity timers when the player got set up.
These got cleared when the tech got disposed (because the events bubble
to the player), but never got re-instantiated. Moving the logic to
the `loadTech` function seems more logical.

Additioanlly, there was a corner case where when switching technologies
we'd get into a bad state where the inactivityTimer was not defined
and there was no userActivity (which actually makes sense), but in this
code branch would never reactivate the userActivity timer, thus getting
the player in a state where it would never been deemed inactive.

This fixes two issues, one, switching between Html5 and Flash, and two,
falling back to the youtube plugin on error.

@eleith i might need to run this through with you in person. i don't think upstream ever considered the case where you'd want to switch player tech (which means html5, flash, and youtube)