When Ang Lee’s film Lust, Caution came out in China in 2007, seven minutes of its infamous sex scenes were cut. The reason? They violated China’s obscenity laws. The Chinese population were not content. In response, they downloaded the original from pirate sites, to such an extent that headlines warned of computer viruses embedded in many of the sites that offered the film. Those living in southern China even crossed the border into Hong Kong to see the full-fat version. The people had spoken, and what they wanted was sex.

Flash forward to 2015 and, as I learned while researching my book Little Emperors and Material Girls: Sex and Youth in Modern China, something similar is happening. A viral video, which emerged on Chinese social media on Tuesday evening, has raced across the internet and set pulses racing. The one-minute clip shows a young man and woman having sex in the changing rooms of Uniqlo in Beijing’s shopping and nightlife hub Sanlitun. It’s already been viewed by millions.

The government’s online watchdog issued a statement registering its displeasure regarding the video’s content. It has also reprimanded China’s top internet firms for allowing the pornographic film to air, and censors are currently working overtime to remove any trace of it. Good luck to them.

As both the film and the video show, the government is not only out of sync with its own population, it’s not necessarily in control of it either. A sexual revolution has taken place in China over the past few decades which shows no signs of cooling down.

The strict ethical codes created under Confucius and continued under Chairman Mao are melting away in China’s bars and bedrooms. Rates of premarital sex attest to this. The latest official statistics, from 2012, say 70% engage in premarital sex, and if anything this figure has probably risen in the years since.

Of course, not everyone approves of these new found freedoms – according to a2015 survey carried out by Shanghai Normal University, 40% of 14- to 35-year-olds are uncomfortable with the idea of premarital sex. That still leaves a sizeable majority who are fine with it, showing that attitudes and actions are roughly in tune.

In Sanlitun, where the offending Uniqlo is situated, a typical night out looks like this: head to a bar, start drinking, move on to karaoke or a club, continue drinking, stop at a street stall for some chuanr (kebab) or jianbing (pancake), finally stumble home, sometimes with someone.

The youth of China are no longer a shy bunch. They’re increasingly hedonistic and up for a good time.

This is at the more personal end. Then there’s what the government really don’t want you to see. Staying in Sanlitun, rows of sex stores line the street, enticing passersby with neon signs and latex displays. Alongside hair salons and massage parlours, they feature doe-eyed girls staring out at customers longingly, offering services that aren’t on the main menu. Drug dealers are also nearby, and trade is good. According to the National narcotics control commission, the domestic drug industry is worth a whopping $82bn annually. Three quarters of those who take drugs are under 35. And yet the government pretends none of this exists.

China will struggle to close Pandora’s box. As the expression goes, where there’s a will, there’s a way. Sex shops and brothels that close tend to reopen or move underground, as has happened in Dongguan, China’s sin city. Officials can be paid to turn a blind eye – and plenty partake in these pleasures themselves. Earlier in May three Chinese officials were sacked over a sex tape blackmail case.

Then, as Lust, Caution highlights, censorship is not foolproof. In China it’s a well-oiled machine, but there are loopholes. Whether using carefully crafted memes, wordplay or going through virtual private networks, China’s 642 million internet users can and do find a lot of what they want.

If anything, China’s internet is driving the sexual revolution. Take the example of Muzi Mei, who created a sex blog in 2003. Mei’s warts-and-all account of her sex life was an instant hit, knocking Chairman Mao off the top search term list at one point. By the time it was shut down, scores of similar sites had emerged.

Pilgrimages are currently being made to the Sanlitun Uniqlo store, with people taking selfies to upload online – an easy way to discuss the news while hopefully bypassing the internet algorithms that might censor it. Online stores are selling jokey Uniqlo T-shirts too.

None of this will please the government. But the rest of the population is moving in one direction, and that’s towards greater sexual freedom and fun.