logDebugInfoForMedia_(error, mediaElement) {
    let buffered;
    if (this.player_) {
      buffered = this.player_.getBufferedInfo();
    } else if (this.mediaSourceEngine_) {
      buffered = this.mediaSourceEngine_.getBufferedInfo();
    } else {
      buffered = shaka.media.TimeRangesUtils.getBufferedInfo(
          mediaElement.buffered);
    }

    error.message += '\n' +
        `current time: ${mediaElement.currentTime}\n` +
        `duration: ${mediaElement.duration}\n` +
        `ready state: ${mediaElement.readyState}\n` +
        `playback rate: ${mediaElement.playbackRate}\n` +
        `paused: ${mediaElement.paused}\n` +
        `ended: ${mediaElement.ended}\n` +
        `buffered: ${JSON.stringify(buffered)}\n`;
    shaka.log.error(error.message);
  }
@param {!Error} error
@param {!HTMLMediaElement} mediaElement
@private