Israel has denied targeting foreign media in airstrikes in Gaza, saying it was aiming for Hamas communication sites.

The Israeli Defence Forces have released video footage of one of the media buildings, occupied by a team from Sky News and other international broadcasters, being hit.

No one was injured in the attack, which happened about 7.15am (local time).

About five hours earlier, another media building in Gaza, housing Hamas' al Aqsa television among others, was also hit in an Israeli airstrike on Sunday.

Six journalists were injured in that strike, including an employee of al Quds television station who lost his leg.

The Israeli military said in a statement it had "targeted two Hamas operational communication sites that were identified by precise intelligence".

Discussing the attack on the building used by Sky News, Israeli military spokeswoman Avital Leibovich said a Hamas antenna was the target of the strike.

"The media building was taken by Hamas to be used as human shields - we see this time after time, year after year," she told Sky News.

"Hamas chose, out of all the buildings in the Gaza Strip, to choose this building - the media, civilian building - to place its electronic infrastructure and communications on the rooftop.

"The target was on the roof and only that target was hit."

She added: "The entire building stayed safe. The entire floors stayed safe. Maybe there was some broken windows as a result of the explosion but no more than that.

"The target was the Hamas facility."

But she said: "I say this to any civilian in Gaza: stay away from Hamas sites.

"This is my recommendation to the journalists as well as others."

Sky's Middle East Correspondent Sam Kiley, who was in the building when it was hit, said there was reason to disbelieve Israel's reason for the attack.

"I think what happened to us just illustrates in a general sense that no one in Gaza can feel safe," he said.

Kiley said it is very hard for civilians to know what locations are being used by Hamas.

"It isn't easy for the 1.7 million Gazans to know what is considered a target by Israel and what is not," he said.

"Hamas don't put a flag on each of their firing positions. They are extremely well camouflaged. Large numbers of them are indeed hidden in built-up areas and on waste ground.

"There are known Hamas areas, but there are a lot of unknown areas and there are lots more subtle things, like radio transmission, relay stations and such, which is presumably what they were hitting on the building we were in.

"It was pretty much the tallest building in Gaza, and therefore it is pretty much inevitable that communications equipment is going to be put there."

Kiley said there is further confusion because Hamas is the government and a militia.

"Hamas is not just a militant organisation, it is also the government here. It runs the hospitals, the sewage collection, the trash collection, the education department.

"Therefore it is very troubling for Gazans to try to figure out where Israel is going to lay the distinction in terms of what is a crossover between military and civilian activity."

The Foreign Press Association issued a statement saying it was "concerned" by the attacks, adding that both buildings house or have been used by members of the association.

The statement pointed to a 2006 UN Security Council resolution condemning attacks on journalists in conflict zones.