A Muslim extremist had warned of a terrorist attack on the wedding of the Duke and Duchess of Cambridge in a YouTube Video, a court has heard.

27-year-old Afsor Ali of Bethnal Green, East London, is on trial at The Old Bailey, accused of harbouring a stash of extremist terror manuals and personal tutorials on Jihad by radical preacher Omar Bakri.

Ali's activities were first investigated after he was arrested outside the American embassy in London on December 2, 2011, while leading a violent protest with 30 masked men, against drone strikes in Pakistan.

His laptop and hard drive seized from his home, reportedly contained a library of extremist material, including Al Qaeda documents, lectures, bomb making tips and guides to using AK47s, the court heard.

Ali also carried a series of lectures with him on his MP3 player, including content from the Al Qaeda magazine Inspire and terrorist manual '39 Ways to Serve and Participate in Jihad.'

He is alleged to have been operating as a spokesman for banned extremist group Muslims Against Crusades and appeared in four YouTube videos promoting extremism under the alias Abu Assadullah.

Kate Middleton
Ali warned of a planned terror attack on the day of the royal wedding. Reuters

In one inflammatory video, the 27-year-old warned of a terrorist attack planned to take place on the wedding of the Duke and Duchess of Cambridge. In the clip, from April 2011, Ali "warns the viewer not to attend the Royal Wedding since there's the risk of an attack by Muslim groups."

Prosecutor Oliver Glasgow said Ali "describes 9/11 as a historic event and suggests it has exposed the American ideology to be a fallacy. He describes the 9/11 atrocity as a blessing and an eye-opener for the American people."

"There was also recordings of phone calls this defendant had with Omar Bakri, a radical ideologue and leader of a militant organisation while he was here in the UK," said Mr Glasgow.

"This defendant and a colleague were seeking advice on the duty of Muslim males to participate in Jihad, and they discussed the requirement of Muslims to travel abroad to fight for Jihad."

He added that Ali is heard saying it "would be sinful" for them not to go abroad to fight.

Ali denies four counts of possessing documents containing information likely to be useful to a person committing or preparing an act of terrorism.