function getCodecs (type, codecs) {
  const re = CODECS_REGEXP[type]
  if (!re || !codecs || !codecs.length) return
  for (let i = 0; i < re.length; i++) {
    for (let j = 0; j < codecs.length; j++) {
      if (re[i].test(codecs[j])) return codecs[j]
    }
  }
}
@param {'audio' | 'video' | 'text'} type
@param {Array<string>} codecs
@returns {string | undefined}