What you don't see in the video is the kid putting the gun in his pants when the police show up. The police don't see him with a gun and haven't seen any video. When they drive up to him, he lifts his coat and reaches for the BB gun.
The police got too close too soon and the kid made a bad move, which is unfortunately what kids do.