NEW YORK — For actress Sharlene Cruz and the rest of the team birthing “Sanctuary City,” it was as if the whole run of the play occurred in the space of an hour and 45 minutes.

“It felt like today was opening night and closing night,” Cruz said, receiving congratulations — but few hugs — from an invited audience that had been seated at safe distances from one another. The New York Theatre Workshop’s performance itself was special: a hastily arranged, covid-19-inspired filming at off-Broadway’s Lucille Lortel Theatre on Friday of a new play by Martyna Majok, a Pulitzer Prize winner in 2018 for “Cost of Living.”

But now, as playwrights, actors and other artists of all stripes were discovering, work painstakingly mapped out was being brought to an abrupt, heartbreaking halt. “All the emotions,” Majok said of the company’s reaction to the unthinkable: live theater being curtailed from coast to coast. “There was much gin and wine and tears,” she added.

Immediately, too, though, the shutdown got theatrical machinery up and running, with another goal: preserving on film all that carefully honed effort. The point was both to have a record for archival purposes and, in many cases, to explore the possibility of streaming plays online, during what could be a protracted period of restrictions on public gatherings.

At Arlington’s Signature Theatre, for instance, staffers hired a film crew Friday evening to record the current production, “Easy Women Smoking Loose Cigarettes,” a new comedy by Dani Stoller that was supposed to run through March 29. Since Signature is shuttered at least until March 30, the theater decided it might be able to show the play to patrons still holding tickets by giving them special access to the film online, according to company spokesman James Gardiner. Many companies, like Signature, are asking people to donate the cost of those unused tickets to help defray expenses at an uncertain juncture.

Similar projects and variations on this idea — such as live-streaming of events — are being explored at outlets ranging from New York’s Public Theater to San Francisco’s American Conservatory Theater. Theater companies often film plays for marketing or for their own files, but far less often with a technical sophistication for public distribution.

Jeremy Blocker, managing director of the New York Theatre Workshop — the East Village company that originated “Rent” — said the trade group representing off-Broadway theaters was in talks with Actors’ Equity, the actors’ union, over the issues concerning the use of the filmed material. But there was another pressing rationale for training cameras on the stage: “We didn’t want these artists’ work to be lost on the sands of time,” Blocker said.

A small crowd gathered for the special presentation Friday afternoon of “Sanctuary City” at the Lortel, where performances began March 4. Like many productions at this frenetic time of year in the theater calendar, the play was moving toward its official opening night, on March 24, by which time critics were to have seen it and filed their reviews. For a world premiere play, the process is exceptionally significant: The initial reception can determine whether it will thrive here and elsewhere, or go to an early grave.

“Sanctuary City” is the story of a pair of friends, called B (Jasai Chase-Owens) and Cruz’s G, whose relationship is upended in the political whirlwind of the immigration crisis. A third character, Austin Smith’s Henry, figures in the complicated emotional issues that arise over the course of the play’s meticulously detailed psychological portraiture.

The invitees were friends and family, and among them, Stephen Stocking, a New York-based actor who learned that day he, too, was a victim of the shutdown. “I was just about to start rehearsals for the developmental workshop of a new play,” he said. The piece was tentatively titled “Memorial,” based on interviews with survivors of a mass shooting in a church; he was to play one of the survivors. Now, he said, he wasn’t sure what was next for him.

“It makes you think of the precariousness of the whole career,” Stocking said.

The director, Rebecca Frecknall, associate director of London’s Almeida Theatre — who was making her New York directorial debut with “Sanctuary City” — gave a few welcoming remarks to the audience of about 60. (Two cameras were situated in the orchestra of the Lortel, and one in the balcony, all set up “in about five hours, from idea to booking,” Blocker said.)

“Enjoy,” she said simply.

The play unfolded without a hitch, and when it was over, the cast and creative team was trying to make sense of the strange moment. They all seemed ready for the play to bloom, only to see it cut off at the bud. Majok, wiping away tears as she stood at the lip of the stage, said she had written the play in three days in 2017, as the status of the “dreamers” was becoming a polarizing matter. Now, she herself was watching opportunities recede: Round House Theatre in Bethesda announced that a production of “Cost of Living,” her Pulitzer winner, was being postponed. And here her newest work, like the lives it chronicled, was in limbo. “I’m scared,” she said, “if there is not a review, it’s like it didn’t happen.”

Frecknall said she was heading back to London, pleased that a permanent record had been made of the company’s collective labors and that she got to watch what struck her as a “brilliant” performance. “It’s a happy thing,” she said. “We’re getting to share it one more time.”