LOS ANGELES — Audiences have splintered into a million personalized subsets. Streaming services are sprouting like mushrooms. Attention spans are now measured in seconds.

For those reasons and others — a decade of stagnant attendance, studios that only seem to make sequels of sequels (of sequels) — movie theaters are seen as a dying business. Why trudge to a theater when Netflix is available in your pocket anytime you want?

Yet almost every multiplex on the planet was gridlocked over the weekend. “Avengers: Endgame” took in $1.2 billion worldwide, arriving as the No. 1 movie in at least 54 countries. The euphorically reviewed movie collected a record-breaking $350 million in the United States and Canada, zooming past “Star Wars: The Force Awakens” (2015), which had opening-weekend sales of $248 million, or about $270 million in today’s dollars.

“It shows the power of theaters — the ability, even in a hyper-fragmented culture, to deliver that wildly big communal experience,” Megan Colligan, president of Imax Filmed Entertainment, said in an interview.