After the deadly attack on the U.S. Consulate in Libya earlier this week, Google took down the YouTube video said to have sparked the violence — but only in Libya and in Egypt, where anti-American protests also flared up.

It's an example of the challenges of balancing U.S. free speech concerns and of something known as the "heckler's veto."

The Innocence of Muslims isn't the only YouTube video that can be seen in the U.S. but not elsewhere. Nazi propaganda is banned in Germany, for example, and slurs against Turkey's founder don't appear in that country.

But Andrew McLaughlin, former deputy chief technology officer at the White House, says there are some unusual aspects of the decision by Google, which owns YouTube, to limit this clip.

"Normally what I would expect to see is Google waiting for some kind of an official directive or a court order that comes out of the duly constituted legal system in those countries," he says. "Of course, that's not always possible."

In this case, it appears that Google made the decision to take the video off YouTube on its own.

"If Google is being perceived to be taking these videos down because of the threat of violence," McLaughlin says, that could create more problems because of the concept of the heckler's veto — "this idea that if you show weakness in your devotion to free speech, then all that somebody has to do is threaten to riot in order to get you to take the speech down."

Every minute, YouTube receives roughly 24 hours' worth of videos from users. And Google depends largely on those users to flag videos that violate YouTube's standards. But those standards are broad.

Google declined to talk about the details of its decision to take down this video but did release a statement saying:

"This video — which is widely available on the Web — is clearly within our guidelines and so will stay on YouTube. However, given the very difficult situation in Libya and Egypt, we have temporarily restricted access in both countries."

Kevin Bankston, the director of the Free Expression Project at the Center for Democracy and Technology, says it's hard to second-guess Google's decision "considering the actual violence that's occurred and the risk of more violence in Egypt and Libya."

"As for their decision to keep it up in every other country and to minimize the free speech impact of the takedown," he says, "I think that's definitely the right decision. We don't want violent protesters to be able to enforce a hecklers veto over the entire planet."

These days, it's often companies — not governments — that make these decisions on behalf of millions of people. And Andrew McLaughlin says they are not easy.

Before he was at the White House, McLaughlin was director of public policy at Google and helped create the policies Google is now using to handle situations like the one unfolding in the Middle East and North Africa. He says these debates about free speech are complicated even when dealing with other Western Democracies.

"In Germany, I don't think anybody thinks that publication of Mein Kampf or access to Hitler's diaries is going to lead to a new resurgence of the Nazi party," McLaughlin says. "But the prohibition on that content is part of a national expression of shame and remorse for what took place. By disrespecting that, as a company, you may be sending a signal to that market that is not the one you want to send.

"So I think the considerations are more complicated than simply what the First Amendment rules would dictate here in the U.S.," he says.

Yesterday, authorities in Afghanistan reportedly took steps to ban YouTube completely. In light of that kind of blanket ban, McLaughlin says, Google's policy of obliging governments with narrowly targeted takedowns actually may help preserve a forum for speech in countries like Egypt and Libya.

Copyright 2016 NPR. To see more, visit http://www.npr.org/.