deleteStream(stream, periodId) {
    if (!stream) {
      return;
    }
    const ContentType = shaka.util.ManifestParserUtils.ContentType;
    if (stream.type == ContentType.AUDIO) {
      for (const audioStream of this.audioStreams_) {
        audioStream.matchedStreams = audioStream.matchedStreams.filter((s) => {
          return s !== stream;
        });
      }
    } else if (stream.type == ContentType.VIDEO) {
      for (const videoStream of this.videoStreams_) {
        videoStream.matchedStreams = videoStream.matchedStreams.filter((s) => {
          return s !== stream;
        });
        if (videoStream.trickModeVideo) {
          videoStream.trickModeVideo.matchedStreams =
            videoStream.trickModeVideo.matchedStreams.filter((s) => {
              return s !== stream;
            });
        }
        if (videoStream.dependencyStream) {
          videoStream.dependencyStream.matchedStreams =
            videoStream.dependencyStream.matchedStreams.filter((s) => {
              return s !== stream;
            });
        }
      }
    } else if (stream.type == ContentType.TEXT) {
      for (const textStream of this.textStreams_) {
        textStream.matchedStreams = textStream.matchedStreams.filter((s) => {
          return s !== stream;
        });
      }
    } else if (stream.type == ContentType.IMAGE) {
      for (const imageStream of this.imageStreams_) {
        imageStream.matchedStreams = imageStream.matchedStreams.filter((s) => {
          return s !== stream;
        });
      }
    }
    if (stream.segmentIndex) {
      stream.closeSegmentIndex();
    }
    this.usedPeriodIds_.delete(periodId);
  }
Deletes a stream from matchedStreams because it is no longer needed

@param {?shaka.extern.Stream} stream
@param {string} periodId

@export