Lightweight abstraction for HTML5 media elements