(Reuters) - A federal judge has dismissed a lawsuit challenging a decision by Google’s YouTube service to drop the placement of clients’ advertisements on videos that viewers might deem violent or offensive.

The Google logo is seen at the "Station F" start up campus in Paris, France, February 15, 2018. REUTERS/Benoit Tessier

U.S. District Judge Edward Chen in San Francisco ruled on Wednesday that YouTube, which had faced pressure from major advertisers, had discretion under its contract with operators of the Zombie Go Boom channel and other content providers to restrict ad placements.

The plaintiffs, whose channel has 1.78 million subscribers, said in their proposed class action that YouTube made the changes, which some commentators dubbed “Adpocalypse,” last March without warning or permission.

They said this caused ad revenue to fall 90 to 95 percent, to as little as $20 a day, in connection with videos with such titles as “Donald Trump Zombie Kill Part 1!” and “Can an Xbox Kill a Zombie?” that they called “a cross between popular cable TV shows ‘Mythbusters’ and ‘The Walking Dead.’”

But the judge said the contract made clear that YouTube, part of Mountain View, California-based Alphabet Inc, was “not obligated to display any advertisements” alongside videos.

He also said Zombie Go Boom, based in Fayetteville, Arkansas, got something out of the arrangement: the ability to post videos for free, in exchange for giving YouTube a license to its content.

“The ability to post videos, even without advertising revenue, can be valuable to content providers in reaching a wide audience,” Chen wrote.

Lawyers for Zombie Go Boom did not immediately respond on Thursday to requests for comment. Google did not immediately respond to a similar request.

YouTube changed its ad placement algorithm after companies such as AT&T Inc, Johnson & Johnson, JPMorgan Chase & Co, Verizon Communications Inc and Britain’s Marks & Spencer Group Plc suspended digital ads on concern YouTube was not doing enough to keep their ads away from offensive videos, including hate speech.

The case is Sweet et al v Google Inc et al, U.S. District Court, Northern District of California, No. 17-03953.