You appear to got anxious at that time, and probably due to anxiety
got altered circulation of your blood called vasovagal attack and that led to sort of blackout
. This occurs due to pooling of blood in dependent areas .next time if something like this happen one should gently lie down and relax. Symptoms will improve, mean if some medical help
is available around seek that.