Stormy Daniels, left, and Anikka Albrite in a scene from the 2015 movie “Wanted.” (Wicked Pictures/Adam & Eve)

For America’s best-known porn actress, one of the great challenges of her career was making sure fellow performers kept their clothes on.

“People were fainting,” said Stormy Daniels in a rare interview, recalling the misery of shooting her 2015 movie “Wanted” in scorching desert heat.

Daniels recounted the highs and lows of writing, directing and acting in the western, which was shot on location, partly in Palm Springs, Calif. The production — a joint venture of two adult-film companies — demanded scrupulous attention to historical accuracy, and the actors and actresses were kitted out in wool.

Most of those clothes were shed during 17 days of shooting. But, Daniels explained, “You have to start with something on.”

In an industry that has retreated largely from the studio to the bedroom, where individual sex workers entertain viewers via web­cam, Daniels herself is something of an anachronism — a star who made her name before the Internet’s disruptions, creating porn films that tell a story, with a beginning, a middle and an end.

Such narrative arc is unusual in contemporary pornography, according to Michael Vegas, who considers Daniels “one of the last movie stars of porn.” For her award-winning 2017 production, “Unbridled,” Vegas said, Daniels (whose real name is Stephanie Clifford) flew the crew to a ranch in Texas for a Hollywood-style extravaganza that included aerial footage, stunts and — Daniels’s true passion — horseback riding.

Few opportunities of that kind come up today. The porn industry, like the news media and entertainment companies, had to reinvent itself in the wake of the 2008 financial crash and the widespread piracy of copyrighted products. Online porn allowed viewers to watch free on laptops and phones wherever and whenever they pleased; and chat rooms allowed them to connect with performers.

Numbers that reflect the plight of traditional studios are hard to come by because few adult companies are publicly traded, according to Lynn Comella, a professor of gender studies at the University of Nevada at Las Vegas and author of “Vibrator Nation.” But the success of the digital business is clear.

“The rise of webcamming has been a game changer,” said Comella, a regular visitor to the porn convention — or AVN Adult Entertainment Expo — held annually in Las Vegas, where, she said, film studios used to be center stage. Now the prime real estate belongs to webcam companies, which offer digital liaisons between paying customers and an array of models varied enough to cater to every taste. On the convention floor this year, “cam girls” swiveled and smirked in front of laptops, adjusting decorative pasties and leather straps for their online audiences.

Customers pay from $1 to $50 a minute to engage online, according to Jaime Rodriguez, director of product at Flirt4Free, one of the largest and oldest webcam platforms. The highest expenditures are for private interactions with sought-after models. The company also offers users the opportunity to tip anywhere from $1 to $50,000. A few Flirt4Free users, Rodriguez said, regularly spend as much as $100,000 a month. About one-third goes to the company, one-third to the model, and another third to the source of the online traffic, which in Flirt4Free’s case is often dating sites.

For the consumer, the payoff is a degree of spontaneity and interactivity that cannot be matched by old-fashioned prerecorded video where actors and actresses follow plots and recite lines, said Stephen Yagielowicz of XBIZ, a publisher of business news for the sex industry.

The movie industry promoted unattainable idols like Marilyn Monroe — or, in the porn world, Stormy Daniels. But camming puts the unattainable within digital reach.

The porn industry is constantly reinventing itself as the technology changes, with electronic sex toys that allow consumers to send signals, such as vibrations, over the Internet to a model and watch her or him react.

Yagielowicz said he sees applications beyond the adult world for couples, for example, who are temporarily separated.

“A servicemen deployed for a year,” he said, “can have a tangible connection with his wife back home.”

For cam girls, the new way of working provides freedom to work flexible hours from home.

“Camming sites function like Uber or Lyft,” said Lily Fleur, who helped finance her master’s degree though webcam work. “Anyone with an Internet connection and a webcam can do it,” she said.

Fleur, who described her family members as religious and conservative, said she was able to conceal her identity by keeping her face hidden during her performances.

Anonymity is not what old-school performers were looking for.

Not for almost half a century, since Linda Lovelace introduced “Deep Throat” to mainstream audiences, has a porn star so enraptured America’s public imagination.

Daniels, recalled her old friend Randy Spears, wanted to make a splash from the moment she got into adult entertainment.

“If she decided to do that business, she was going to be a star in it,” said Spears, who often performed with Daniels after they met on set more than 15 years ago. “Back in the day, it was kind of glamorous,” he said, recalling sitting together at the AVN convention signing autographs for lines of fans.

Daniels, 39, is also known as something of a loner, who saw how her ability to command an audience could translate into other enterprises. Like politics. In 2009, the Baton Rouge native flirted with the idea of challenging Sen. David Vitter after the Louisiana Republican was caught up in the D.C. Madam scandal.

Some sex workers find her ambition alienating.

“She was a little stuck up,” recalled Cindy Crawford (an adult-film actress, not the supermodel), who met Daniels in Tahoe in 2006 on the weekend of her alleged assignation with Donald Trump. Crawford, who said she worked for a smaller company, said Daniels didn’t seem interested in including her as she recounted her story to their mutual friend Alana Evans.

But Daniels’s entrepreneurial successes are welcomed in an industry where many people describe feeling marginalized, particularly now that camming has decentralized the business. She recently joined a new company owned by adult conglomerate MindGeek.

“Now she is working for the giant, it should allow for her to do bigger, cooler movies,” Vegas said.

She has won a following among actors such as Vegas, who said she demonstrates greater versatility in her acting than most adult performers. In “The Switch,” he and Daniels play a suburban couple who are having difficulty understanding each other’s points of view — until they wake up one morning to discover themselves inhabiting each other’s bodies.

“She was playing me. And she was good at it,” said Vegas.

A series of expensive mishaps while shooting “Wanted,” the western, meant Daniels had to ask performers to cut their rates. “Every single person did it,” she said in an interview.

Mark Kernes, senior editor for AVN, spotted Daniels at the annual awards ceremony known as the Oscars of Porn shortly after news broke of the $130,000 hush payment she received from Trump’s lawyer. The famously self-possessed actress now had a bodyguard at her side.

“She does what she wants,” said Kernes. “She’s very aware of what she’s doing.”

In her appearance Tuesday on “The View,” Daniels talked about those goals — to “really be known as a female director,” producing more mainstream work like music videos and a horror movie.

Her determination, said Spears, carries over to her new public role as the president’s most prominent legal adversary.

“Stormy does not fold under pressure from anyone,” Spears said.