static html5TrackToShakaTrack(audioTrack, videoTrack) {
    goog.asserts.assert(audioTrack || videoTrack,
        'There must be at least audioTrack or videoTrack.');

    const LanguageUtils = shaka.util.LanguageUtils;

    const language = audioTrack ? audioTrack.language : null;

    /** @type {shaka.extern.Track} */
    const track = {
      id: shaka.util.StreamUtils.html5TrackId(audioTrack || videoTrack),
      active: audioTrack ? audioTrack.enabled : videoTrack.selected,
      type: 'variant',
      bandwidth: 0,
      language: LanguageUtils.normalize(language || 'und'),
      label: audioTrack ? audioTrack.label : null,
      kind: audioTrack ? audioTrack.kind : null,
      width: null,
      height: null,
      frameRate: null,
      pixelAspectRatio: null,
      hdr: null,
      colorGamut: null,
      videoLayout: null,
      mimeType: null,
      audioMimeType: null,
      videoMimeType: null,
      codecs: null,
      audioCodec: null,
      videoCodec: null,
      primary: audioTrack ? audioTrack.kind == 'main' : false,
      roles: [],
      forced: false,
      audioRoles: null,
      videoId: null,
      audioId: null,
      audioGroupId: null,
      channelsCount: null,
      audioSamplingRate: null,
      spatialAudio: false,
      tilesLayout: null,
      audioBandwidth: null,
      videoBandwidth: null,
      originalVideoId: videoTrack ? videoTrack.id : null,
      originalAudioId: audioTrack ? audioTrack.id : null,
      originalTextId: null,
      originalImageId: null,
      accessibilityPurpose: null,
      originalLanguage: language,
    };

    if (audioTrack && audioTrack.kind) {
      track.roles = [audioTrack.kind];
      track.audioRoles = [audioTrack.kind];
    }

    if (audioTrack && audioTrack.configuration) {
      if (audioTrack.configuration.codec) {
        track.audioCodec = audioTrack.configuration.codec;
        track.codecs = track.audioCodec;
      }
      if (audioTrack.configuration.bitrate) {
        track.audioBandwidth = audioTrack.configuration.bitrate;
        track.bandwidth += track.audioBandwidth;
      }
      if (audioTrack.configuration.sampleRate) {
        track.audioSamplingRate = audioTrack.configuration.sampleRate;
      }
      if (audioTrack.configuration.numberOfChannels) {
        track.channelsCount = audioTrack.configuration.numberOfChannels;
      }
    }

    if (videoTrack && videoTrack.configuration) {
      if (videoTrack.configuration.codec) {
        track.videoCodec = videoTrack.configuration.codec;
        if (track.codecs) {
          track.codecs += ',' + track.videoCodec;
        } else {
          track.codecs = track.videoCodec;
        }
      }
      if (videoTrack.configuration.bitrate) {
        track.videoBandwidth = videoTrack.configuration.bitrate;
        track.bandwidth += track.videoBandwidth;
      }
      if (videoTrack.configuration.framerate) {
        track.frameRate = videoTrack.configuration.framerate;
      }
      if (videoTrack.configuration.width) {
        track.width = videoTrack.configuration.width;
      }
      if (videoTrack.configuration.height) {
        track.height = videoTrack.configuration.height;
      }
      if (videoTrack.configuration.colorSpace &&
          videoTrack.configuration.colorSpace.transfer) {
        switch (videoTrack.configuration.colorSpace.transfer) {
          case 'pq':
            track.hdr = 'PQ';
            break;
          case 'hlg':
            track.hdr = 'HLG';
            break;
          case 'bt709':
            track.hdr = 'SDR';
            break;
        }
      }
    }

    return track;
  }
@param {?AudioTrack} audioTrack
@param {?VideoTrack} videoTrack
@return {shaka.extern.Track}