We used to pray while animals passed in front of us. We mentioned this to the Prophet ﷺ and he said, "Something like the rear support of a saddle placed in front of one of you is enough, then whatever passes beyond it will not harm him."Umar once said, "in front of him."
حدثنا عمر بن عبيد عن سماك بن حرب
كنا نصلي والدواب تمر بين أيدينا فذكرنا ذلك للنبي ﷺ فقال مثل مؤخرة الرحل تكون بين يدي أحدكم ثم لا يضره ما مر عليه وقال عمر مرة بين يديه