New Brunswick, New Jersey (CNN) -- The man Tyler Clementi was intimate with just days before he committed suicide took the stand Friday, telling jurors that he had noticed a web camera aimed at Clementi's bed.
The witness, who prosecutors named only as "M.B." to protect his identity, testified during the sixth day of the trial of a former Rutgers University student, Dharun Ravi.
Ravi is accused of spying on and intimidating Clementi, his former university roommate, because he was gay.
M.B., 32, testified Friday that he first met Clementi on an internet social networking site for gay men and that they eventually met in the student's dorm room three times. The two conversed online, exchanged text messages and later had sex.
At one point when they were together in the dorm room, M.B. glanced over at Ravi's desk and saw "a camera lens pointed at (Clementi's) bed."
He also testified that he had briefly met Ravi while visiting Clementi. Ravi on one occasion allegedly left the room and came back, "walked to his desk, shuffled around a bit and then walked out."
M.B. testified that on September 19, 2010, he drove to meet Clementi at his building, three days after the first visit. When he left, M.B. said he saw about five people milling around the hallway who seemed to be looking at him.
"They didn't say anything," he said. But they were looking at him in a way that made him wonder why they were staring, he said. "But as I was a guest in their building, I just brushed it off."
Ravi's lawyer, Steve Altman, has said M.B. looked out of place at the university because of his age, which had prompted the stares. Students also testified that he appeared to look "shabby."
Altman has argued that his client had switched on the web cam to monitor his personal items because he did not trust his roommate's visitor.
But prosecutors say Ravi and another student placed the camera in the room without Clementi's knowledge to spy and humiliate the student because he was gay.
After one particular visit, M.B. testified, "We were both laying together in (Clementi's) bed. I could hear people talking in the courtyard. People joking, people laughing."
M.B. said he last met Clementi on September 21. Just days later, the 18-year-old student took his own life by leaping from the George Washington Bridge and into the Hudson River.
During his testimony, M.B. appeared uncomfortable, shifting his eyes between Clementi's family and the ground.
On Thursday, Rutgers graduate Geoffrey Irving testified that Ravi had told him after an ultimate Frisbee practice that he set up the web cam and was planning to do it again that evening, September 21.
Ravi, 20, now faces a 15-count indictment in Clementi's death that includes charges of bias intimidation, invasion of privacy, tampering with physical evidence, witness tampering and hindering apprehension or prosecution. His trial began last Friday.
If convicted, he faces up to 10 years in prison.
Last year, he turned down a plea deal that would have allowed him to avoid jail time.
Less than a month after Clementi's suicide, President Obama released a videotaped message condemning bullying.
In November, Clementi's family consented to the use of his name on federal anti-harassment legislation called the "Tyler Clementi Higher Education Anti-Harassment Act."
The proposed law would require schools that receive federal student aid "to create policies prohibiting the harassment of any student," said Sen. Frank Lautenberg, D-New Jersey.