fix various js errors with video playback [Closes #257]