(a) In any criminal prosecution, the court may, upon motion of the district attorney, the defense, or the court, for good cause shown and after notice to the parties, order the taking of a deposition or a videotaped deposition of a victim or a witness when the victim or witness is or may be unavailable for trial for medical reasons or other exceptional circumstances. On any motion for a deposition or a videotaped deposition of the victim or witness, the court shall consider the age of the victim or witness, the potential unavailability of the victim or witness for trial, the nature of the offense, the nature of testimony that may be expected, and the possible effect that testimony in person at trial may have on the victim or witness, along with any other relevant matters that may be required by Supreme Court rule. During the taking of a deposition or a videotaped deposition, an attorney of the victim or witness may be present at the deposition if the victim or witness requests the presence of an attorney. If the court orders that a deposition of the victim or witness shall be taken as provided in this section, the party requesting the deposition shall make all necessary arrangements to have the deposition transcribed or videotaped, or both. Either party may request that the deposition be videotaped and the court may so order.
(b) The deposition shall be taken before the judge in the court's chambers or at another suitable location as the court may direct and shall be conducted in the presence of the district attorney or assistant district attorney, the defendant and his or her attorney, and any other persons as the court in its discretion may permit, taking into consideration the welfare and well-being of the victim or witness. The officer having custody of a defendant shall be notified of the time and place set for the examination and shall, unless the defendant waives in writing the right to be present, produce the defendant at the examination and keep the defendant in the presence of the witness during the examination, unless, after being warned by the court that disruptive conduct will cause the defendant's removal from the place of the taking of the deposition, the defendant persists in conduct which is such as to justify exclusion from that place. A defendant not in custody shall have the right to be present at the examination subject to any terms as may be fixed by the court, but a failure, absent good cause shown, to appear after notice shall constitute a waiver of that right and of any objection to the taking and use of the deposition based on that right. The state shall make available to the defendant or the defendant's counsel for examination and use at the taking of the deposition any statement of the witness being deposed which is in possession of the state and to which the defendant would be entitled at the trial. In no event shall a deposition be taken of a defendant without the defendant's consent. The court may also order any designated book, paper, document, record, recording, or other material not privileged be produced at the same time and place of the taking of the witness's deposition. The examination and cross examination of the victim or witness shall proceed at the taking of the deposition or videotaped deposition as though the victim or witness was testifying personally in the trial of the case. The moving party shall provide the attorney for the other party with reasonable access and means to view and hear the deposition or videotaped deposition at a suitable and reasonable time prior to the trial of the case and with a copy of the deposition. Objections to the introduction into the record of the deposition shall be heard by the judge who presides at the trial of the case in which the introduction of the deposition or videotaped deposition is sought, and unless the court determines that its introduction in lieu of the victim's or witness's actual appearance as a witness at the trial will unfairly prejudice the defendant, the deposition or videotaped deposition shall be entered into the record by the moving party in lieu of the direct testimony of the victim or witness and shall be viewed by, heard by, or read to, the trier of fact at the trial of the case.
(c) For the purposes of this section, "videotaped deposition" means the visual recording on a magnetic tape, together with the associated sound of a witness testifying under oath to be entered in the record in a judicial proceeding. The term "deposition" as used in this section means a transcribed deposition which may include an audiotape of the deposition or a videotaped deposition.
(d) The Supreme Court may adopt rules of procedure regarding the taking and use of depositions or videotaped depositions in criminal proceedings as provided by this section, as well as for the transcribing of the deposition in the event the case is appealed.
(e) All costs associated with the taking of a deposition or the videotaping of a deposition ordered pursuant to this section shall be paid by the moving party.
(f) A deposition or videotaped deposition ordered pursuant to this section may be subject to a protective order of the court for the purpose of protecting the privacy of the victim of the offense or a witness until presented as evidence at trial.