State court officials said Friday that they had launched an investigation after a video surfaced on YouTube that appeared to have been recorded from inside a courtroom during closing arguments at Bill Cosby's sexual-assault trial.

The nearly two-hour film – posted under the title "MUST SEE — The Cosby Case Defense Closing Arguments" — featured audio of Cosby lawyer Brian J. McMonagle's June 12 final pitch to the jury. It's not clear who produced it, but the recording appears to be a violation of Pennsylvania law prohibiting transmission, photography, or video recording in state courts, investigators said.

Jim Koval, a spokesman for the state court system, confirmed the investigation but did not elaborate.

The video had more than 140 views before it was taken off the social sharing site Thursday. It also contained photos that appeared to have been taken inside an annex courtroom with a screen where Cosby's trial was broadcast live for those who didn't have courtroom seats. That room was mostly occupied by journalists who had been credentialed to cover the trial.

Both courtrooms were covered by a decorum order issued by Montgomery County Judge Steven T. O'Neill. It threatened charges of contempt of court punishable by fines and possible incarceration for breaking any of the rules.

Several times throughout the 79-year-old entertainer's two-week trial, court administrators yanked journalists, members of the public, and even celebrity lawyer Gloria Allred, who represents several Cosby accusers, from court for allegedly violating the decorum order by using their cellphones or other infractions.

The case ended in a mistrial last Saturday after a jury of seven men and five women failed to reach a verdict after 52 hours of deliberations over five days.

Montgomery County prosecutors have pledged to retry the aging celebrity on charges he drugged and sexually assaulted Andrea Constand, a former Temple University athletics employee, in 2004.