DirecTV and Viacom may have quarreled bitterly over the costs of a new contract this month, but they agree on at least one thing: the preservation of television as they know it, provided only to paying subscribers.

After a marathon negotiating session Thursday, the two companies announced early Friday morning that they had reached an agreement to end a nine-day blackout of Nickelodeon, MTV, Comedy Central and other cable channels in DirecTV homes.

Under the deal, Viacom-owned shows like “Jersey Shore” will become more accessible via the Internet for DirecTV subscribers, through a sign-in system sometimes called “TV Everywhere.” But free access to people who don’t subscribe to DirecTV or another similar distributor is likely to become more restrictive, thereby fortifying the existing model of TV distribution.

“My expectation is that they will not increase the amount of free programming they have online,” said Derek Chang, an executive vice president for DirecTV, referring to Viacom. Mr. Chang led DirecTV’s negotiations with Viacom.

A Viacom spokesman said its streaming strategy had not fundamentally changed. The disruptive role of online video will almost surely rear its head again in negotiations between DirecTV and CBS later this year, and in other such contract negotiations.

Viacom and DirecTV had been battling over how much DirecTV should pay for a bundle of Viacom’s cable channels, an increasingly sensitive question at a time when consumers are trying new online options for television viewing. One of the points of contention involved Viacom’s deals to stream some of its shows on the Internet, like “The Daily Show with Jon Stewart,” a remarkably popular franchise on Hulu and other sites.

When the blackout began on July 10, DirecTV pointed its subscribers to Hulu and other sites to watch Viacom programming. But Viacom responded by taking its shows off some of the sites — a tactic that Mr. Chang admitted DirecTV did not see coming. All Internet users, not just DirecTV subscribers, were affected by the takedowns.

When Mr. Stewart and his “Daily Show” came back on Monday from a two-week hiatus, he came down hard — albeit jokingly — on Viacom’s action. “Viacom, what are you, China?” He then pointed out that many Internet users know how to seek illicit copies of shows on other Web sites. “This morning when I woke up, my 8-year-old son was watching ‘The Dark Knight Rises’ in 3-D,” Mr. Stewart said. “They’re already figuring it out. So basically you’re blocking the old people from watching the show.”

By Tuesday, Viacom had restored some of the streams, including Monday night’s “Daily Show.” But by then the company had demonstrated that online access to shows was not a given. (Another programmer, AMC Networks, coincidentally showed a very different way to use the Web to its advantage last week. Amid a continuing blackout in the homes of one of DirecTV’s competitors, Dish Network, AMC decided to stream the season premiere of its hit show “Breaking Bad” free, sidestepping the blackout altogether. AMC said it wanted to give Dish subscribers “an extra week to switch providers so they can enjoy the rest of the season.”)

Like AMC and other programmers, Viacom is moving toward a sign-in model for streaming, replicating the subscription model of traditional television on the Web. It was moving in that direction well before the spat with DirecTV started, as Mr. Chang acknowledged on Friday. But he said that his company’s new contract with Viacom had specific provisions that “would make it harder for them to grow their free online presence.”

Distributors have been trying to extract such commitments from the makers of TV shows as the industry moves toward a sign-in system for streaming. A Viacom spokesman said that the company would continue to work with both traditional distributors like DirecTV and new ones like Netflix and declined to describe any changes to streaming on its own Web sites, like MTV.com.

Setting up the sign-in systems has been slow going and stressful for distributors and their subscribers alike. But DirecTV gained something important in its negotiations: the right in the future to stream live channels, not just taped shows, and the right to do it outside a subscriber’s home. Such features will probably make the TV Everywhere model more appealing, despite its arduous sign-in process.

Still, consumer advocates said it would be a shame if Viacom scaled back its online offerings.

“People are going to watch online content, and if it’s not Viacom’s it’ll be someone else’s,” said John Bergmayer, senior staff lawyer for the public interest group Public Knowledge. “Viacom wouldn’t be doing itself any favors if it starts putting content behind a TV Everywhere-style paywall. Viewers will just find alternatives.”

His boss, Gigi B. Sohn, the chief executive of Public Knowledge, pointed out that some of those alternatives would be illegal.

“It never ceases to amaze me how the studios never seem to make the connection between creating scarcity and piracy,” she said.

For the foreseeable future it’s traditional television, not the Web, that will continue to drive most of the revenue for Viacom and other programmers. Viacom’s channels had previously received roughly $500 million a year from DirecTV. Given DirecTV’s public statements that it spends $10 billion a year on programming, Viacom asserted that it represented only 5 percent of the company’s programming costs.

With the new deal, Viacom will represent at least 6 percent of DirecTV’s programming costs, implying a gain of at least $100 million, to as much as $600 million or more a year. DirecTV had previously said that Viacom was demanding more than $1 billion over the length of the contract, which lasted for seven years.

The new deal is also for seven years, according to two people with direct knowledge of the talks. It continues a trend of long-term contracts between distributors and channel owners, further strengthening their position against possible online competitors.