selectTextLanguage(language, role, forced = false) {
    const selectMediaSourceMode = () => {
      this.currentTextLanguage_ = language;
      this.currentTextRole_ = role || '';
      this.currentTextForced_ = forced || false;

      const chosenText = this.chooseTextStream_();
      if (chosenText) {
        if (chosenText == this.streamingEngine_.getCurrentTextStream()) {
          shaka.log.debug('Text track already selected.');
          return;
        }

        this.addTextStreamToSwitchHistory_(
            chosenText, /* fromAdaptation= */ false);
        if (this.shouldStreamText_()) {
          this.streamingEngine_.switchTextStream(chosenText);
          this.onTextChanged_();
          this.setTextDisplayerLanguage_();
        }
      }
    };
    const selectSrcEqualsMode = () => {
      const track = shaka.util.StreamUtils.filterStreamsByLanguageAndRole(
          this.getTextTracks(), language, role || '', forced || false)[0];
      if (track) {
        this.selectTextTrack(track);
      }
    };
    if (this.manifest_ && this.playhead_) {
      selectMediaSourceMode();
      // When using MSE + remote we need to set tracks for both MSE and native
      // apis so that synchronization is maintained.
      if (!this.isRemotePlayback()) {
        return;
      }
    }
    selectSrcEqualsMode();
  }
Sets the current text language and current text role to the selected
language and role, and chooses a new variant if need be. If the player has
not loaded any content, this will be a no-op.

<br>

This API is deprecated and will be removed in version 5.0, please migrate
to using `getTextTracks` and `selectTextTrack`.

@param {string} language
@param {string=} role
@param {boolean=} forced
@deprecated
@export