Martin Shkreli, former hedge fund manager, “pharma bro” and self-styled bad boy, sat in federal court for a hearing on Monday before his fraud trial begins next week.

Like most defendants, he sat mostly still; like most defendants, he stayed quiet, declining to speak to reporters as he left.

Then he went home, turned on his web camera and live-streamed himself on the computer for almost two and a half hours. He played League of Legends; he filled in Excel models on pharmaceutical stocks and bonds; he patted his cat; he drank Coca-Colas; he checked Twitter. He voice chatted while live chatting in another window while playing online chess. The only sign of his federal case was a window that could be seen briefly, showing a PowerPoint titled “Witness Guide” and a slide on a former boss of his.

This is how a self-promoter goes to trial.

In January 2015, learning that federal prosecutors had opened an investigation, Mr. Shkreli volunteered to meet with prosecutors and F.B.I. agents — without a lawyer. After agents arrested him in December 2015, he continued to talk, making “additional one-off statements,” according to a prosecution filing, even as agents and prosecutors recorded his every word. The next day, at home, he live-streamed for almost five hours. “Sorry I couldn’t live-stream yesterday. Had a lot going on,” he told viewers.