waitForEndOrTimeout(mediaElement, timeout) {
    this.failOnTimeout(false).timeoutAfter(timeout);
    return this.waitForEnd(mediaElement);
  }
Wait for the video to end or for |timeout| seconds to pass, whichever
occurs first.  The Promise is resolved when either of these happens.

@param {!HTMLMediaElement} mediaElement
@param {number} timeout in seconds, after which the Promise succeeds
@return {!Promise}