Jurors have been shown footage of Stokes brawling with Ali and Hale, who are friends, in the early hours of September 25 last year after walking away from the Bristol nightclub Mbargo.
All three defendants deny the charge.
The prosecution said Stokes told police he intervened with Ali and Hale because he overheard "nasty homophobic language", then told police he acted in self-defence when he thought he was about to be hit with a bottle.
He allegedly knocked Hale unconscious, then Ali likewise.
The prosecution has described Barry and O'Connor as two "flamboyant, extrovert and openly gay" regulars at Mbargo.
- 'Metal pole' -
On the CCTV footage shown to the jury, Stokes and fellow England cricketer Alex Hales are seen catching up with the four and overtaking them and then, the prosecution claimed, Stokes can be seen turning to look back at Barry and Ali.
Detective Constable Daniel Adams, the officer in the case, told jurors: "Ryan Ali and Kai Barry appear to be having a disagreement. Mr Barry grabs Mr Ali around the groin area." The CCTV shows Barry walk away from Ali but then return.
Adams said: "Mr Barry appears to link arms with Mr Ali and is shrugged off and pushed away."
Further CCTV footage showed Stokes approaching a retreating Ali, Adams said, adding: "From this point it is very difficult to identify who is involved."
Hale is then shown collapsing to the floor outside a shop window but picking himself up after 20 seconds and disappearing from view before returning.
"He is making his way back towards the melee, carrying the bar," he said.
Stokes starred on Saturday as England beat India in the first Test at Edgbaston. The second Test, at Lord's, begins on Thursday.
The trial, expected to last five to seven days, continues.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)