_handleCodecChange (video, audio) {
    const tasks = []
    const mse = this._mse
    const codecList = [{
      type: MSE.VIDEO,
      codecs: video?.codec
    }, {
      type: MSE.AUDIO,
      codecs: audio?.codec
    }]

    codecList.filter(item => !!item.codecs).forEach(({type, codecs}) => {
      const sourceBuffer = mse.getSourceBuffer(type)
      if (sourceBuffer) {
        const codec = codecs.split(',')[0]
        if (!new RegExp(codec, 'ig').test(sourceBuffer.mimeType)) {
          tasks.push(
            mse.changeType(type, `${type}/mp4;codecs=${codecs}`)
          )
        }
      }
    })
    return tasks
  }
This makes it possible to change codecs or container type mid-stream.
@private