NEW BRUNSWICK, N.J. (CBSNewYork) — A young woman in the middle of the Rutgers webcam spying case took the stand on Monday afternoon. Molly Wei, a key witness for the state’s case against Dharun Ravi, who is accused of spying on his roommate, said her friend was “just shocked and kind of surprised” at what he saw on the webcam video.

Ravi is accused of using a webcam to spy on roommate Tyler Clementi’s sexual encounter with another man.  Wei said Ravi was in her dorm room across the hall when they saw the encounter and that his desktop was set to automatically turn on.

READ MORE: Candidate Conversations: Eric Adams

“He had set up his computer to basically auto-accept if anyone wants to video chat with him.  And he explained to me that he could see what was going on in his room if somebody else — if he called his computer from someone else’s computer,” Wei explained in court while being questions by the prosecution.

Clementi later committed suicide by jumping off the George Washington Bridge.

“It shouldn’t have happened and we saw something we didn’t expect to see and it just felt weird,” Wei said.

When asked by the prosecutor how she would describe Ravi’s reaction to what was happening on the webcam, Wei said he was “freaking out a little.”

In addition, Wei said that Ravi also went on AIM and Twitter to tell friends what was happening in his dorm room.  She said Ravi wrote “something like ‘I saw my roommate kissing a guy.'” on Twitter.

Wei avoided criminal prosecution by entering a pre-trial intervention program. Part of the deal included her telling the truth on the stand.

Ravi, 19, is charged with invasion of privacy, bias intimidation and other counts.  But the defense tried to play up Ravi’s concern about his personal property.

Defense: “Dharun when he came to your room, tell you that he was concerned with whether or not his property of was going to be stolen?”

Wei: “He did mention that.”

Defense: “Did he tell you that if he goes back into his room and his iPad is missing, he’s going Tyler pay for it?”

Wei: “Yes”

Defense: “Did Dharun say to you that the reason he wanted to do this was because he wanted to see something sexual take place in the room?”

Wei: “No”

Defense: “Did he tell you that he felt like he was thrown out of his room?”

READ MORE: Rain Leaks Into Rockefeller Center Station, Riders Call On MTA To Invest In Subway Station Upgrades

Wei: “Yes — kicked out.”

In testimony Monday, jurors heard from other Rutgers students. One saw Twitter messages from Ravi about seeing Clementi on a webcam. One said she saw seconds of the video herself.

A small group of Rutgers students said they gathered in a room across the hall from Clementi’s watching his encounter with another man on a webcam Ravi set up.

“I saw two males kissing and… it was just the back of them, I couldn’t see their faces,” said Pooja Kollouri.

Prosecutors say Clementi killed himself because he felt he had been exposed.

Kollouri told the court Monday that Ravi may have had other reasons for setting up the webcam.

“To make sure his things weren’t touched,” Kollouri said.

Kollouri also told jurors Ravi wanted to know if Clementi was gay. Most students who watched the encounter said Ravi was not anti-gay.

Prosecutors said Clementi suspected he was being watched and reported it to the university. That’s when Wei said she was questioned by campus police, but while talking to them, she said Ravi was text messaging her.

The messages, which were showed in court on Monday, included a message from Ravi asking ‘Did you tell them we did it on purpose?’  Wei said she believed Ravi thought the two of them were going to get in trouble and wanted the situation to seem more like an “accident.”

The trial opened Friday with questions about Ravi’s relationship with gay people. Witnesses said that while Ravi expressed discomfort about having a gay roommate, they weren’t aware of him harboring any anti-gay sentiment.

Prosecutors are trying to prove bias intimidation charges, punishable by up to 10 years in prison. To be convicted, they’d have to establish Ravi acted out of bias against gays.

Ravi’s lawyer insisted Friday his client isn’t bigoted.

“He may be stupid at times,” defense attorney Steven Altman said in his opening statement. “He’s an 18-year-old boy, but he’s certainly not a criminal.”

MORE NEWS: Supply Chain Issues: 'There Really Are Problems Everywhere,' Even For Small Companies

Please offer your thoughts in the comments section below …