bug: media.onerror called itself infinitely.