The revelation came in testimony from Michelle Huang, a Cornell University student who says Dharun Ravi told her about it in a text message on Sept. 21, 2010.
Ravi, 20, is on trial for 15 criminal counts, including invasion of privacy, bias intimidation and several charges accusing him of trying to cover his tracks. Bias intimidation is a hate crime punishable by up to 10 years in prison.
The roommate, Tyler Clementi, jumped to his death from the George Washington Bridge on Sept. 22, 2010. Since then, the case has sparked a national conversation about the difficulties faced by young gays.
Prosecutors are trying to prove that Ravi intentionally tried to humiliate Clementi. Huang testified that Ravi urged her to video chat him so she could see the webcam footage.
"Do it for real," Ravi wrote in a text that was shown to jurors. "I have it pointed at his bed."
People were planning a "viewing party with a bottle of Bacardi and beer" to watch the web stream that night, Huang said. It was the first mention of a planned party in the trial, which started its seventh day of testimony on Monday.
Huang later testified that after Clementi had killed himself, Ravi texted her that the talk of a viewing party was a joke.
Witnesses have said the webcam wasn't working that night.
Ravi isn't charged in Clementi's death, and the judge has been cautious about how the suicide would come into the trial.
Prosecutors are precluded from linking the spying allegations to the suicide. Defense lawyers cannot make the case that Clementi killed himself for other reasons.
When prospective jurors were brought into the courtroom last month for the first time, the judge told them that it was the case involving Clementi and that Clementi had killed himself.
The issue came up Monday when Huang testified about hearing from Ravi that his roommate had committed suicide. The university sent counselors to his room and suggested he take several days off, he said, describing Rutgers officials in a text as "mad helpful."
After that testimony, which emerged during cross-examination by Ravi's lawyer, Middlesex County First Assistant Prosecutor Julia McClure told the judge that she might recall some earlier witnesses to ask them about conversations with Ravi about the suicide.
Judge Glenn Berman said he had allowed the questioning of Huang to continue because jurors might not have understood the texts without that context.
But he was apprehensive about delving further into the death because Ravi isn't charged with it.
"My preference is we don't talk about it," he said.
Before Monday, it had mostly come up in passing.
In her testimony last week, Rutgers student Alissa Agarwal was asked what day she spoke with investigators. She matter-of-factly said it was the day after Clementi committed suicide. And on Friday, the man witnesses said was seen in the web stream kissing Clementi took the stand.
The man, who was identified in court only by the initials M.B., was asked about how late he intended to stay in Clementi's room when they met there on Sept. 21.
He answered: "There was every reason to believe that I was going to see him again." He wasn't asked more and didn't say more.
The lack of testimony about Clementi's death has created some gaps in the story's timeline.
It has been widely reported that Clementi left a final Facebook status on the night of his death: "Jumping off the gw bridge, sorry."
A Rutgers police officer testified that about an hour after the message appeared, he was dispatched to Clementi's room to try to determine his whereabouts. But the officer didn't say why he was dispatched to check on the student.
There is one constant reminder in the courtroom of the death. Clementi's parents and other relatives - including, at times, both of his older brothers - sat through each of the first six days of the trial.
The family has set up a foundation to honor Clementi, and one of its main goals is suicide prevention.
In interviews with The Associated Press, his parents, Joe and Jane Clementi, and his brother, James, say they don't know why he killed himself - a question the trial won't seek to answer.
"I'm not sure that knowing why it happened makes it any better or makes it any easier," James Clementi said in an interview last month. "Someone I love so much isn't here."
Get Eyewitness News Delivered