In a prosecution for a criminal offense defined in Article 11 or in Section 11-1.20, 11-1.30, 11-1.40, 11-1.50, 11-1.60, 12-13, 12-14, 12-14.1, 12-15, or 12-16 of the Criminal Code of 1961 or the Criminal Code of 2012, when the alleged victim of the offense was a minor under 18 years of age at the time of the offense, the court may exclude from the proceedings while the victim is testifying, regardless of the alleged victim's age at the time of the victim's courtroom testimony, all persons, who, in the opinion of the court, do not have a direct interest in the case, except the media. When the court publishes to the trier of fact videos, photographs, or any depiction of a minor under 18 years of age engaged in a sex act, the court may exclude from the proceedings all persons, who, in the opinion of the court, do not have a direct interest in the case, except the media. The court shall enter its finding that particular parties are disinterested and the basis for that finding into the record.
725 ILCS 5/115-11