To play YouTube videos in the background while doing other things on your iPhone, you can use YouTube premium or Safari's desktop view mode.
You can loop videos on the desktop or mobile version of YouTube, regardless of the browser or kind of phone you're using.