Bug 1023179  - Fix video unloading/loading, refactor initialization

Refactor of initialization sequence, logging to track down media loading issue
nit: space after `if` and `===`