BEIJING — When the rebel artist Ai Weiwei was illegally detained in 2011, he recounts, his young paramilitary guards asked him to sing for them. He belted out decades-old Communist revolutionary tunes, and they were stunned that he knew them, he said.

Now Mr. Ai is answering the guards’ request in a different key. He is presenting them, and the world, with his first heavy-metal music video, one with detailed re-creations of scenes from his 81 days of detention. He also portrays fantasies he imagines flitting through the guards’ minds. Mr. Ai posted the video on a Web site, aiweiwei.com, on Wednesday morning, Beijing time.

“It’s about the whole condition,” he said in an interview at his studio last week after showing final cuts of the video to a reporter and a photographer. “It’s not really about me. I think it’s about how the power of the state tries to manage and maintain this kind of control.”

Mr. Ai wrote the lyrics in one morning. He asked a friend, the rocker and contemporary artist Zuoxiao Zuzhou, to handle the music. Six songs are expected to be released together in an album called “The Divine Comedy” on June 22, the second anniversary of Mr. Ai’s exit from detention. The video was shot by the cinematographer Christopher Doyle, an Australian resident of Hong Kong who is best known for his work with Wong Kar-wai, a director of highly stylized films, and Zhang Yimou, who has in recent years been a favorite of the Communist Party.