Imam Bukhari narrates: Muslim narrated to us, he said: Hisham narrated to us, he said: Yahya bin Abi Kathir narrated to us from Muhammad bin Abdur Rahman from Hazrat Jabir, Allah be pleased with him, he narrates that
the Messenger of Allah ﷺ used to pray upon his mount, in whichever direction the mount faced, so when he intended to pray the obligatory prayer, he would get down from the mount and face towards the qiblah.
Reference: Sahih Al Bukhari 490