Implemented video/webgl integration.

Also reordered the ifdef guards a bit.