This app was mentioned in 2 comments, with an average of 1.00 upvote
I use iOttie HLCRIO132 which has wireless charging (I used to have note5 )
Here is the link https://www.amazon.com/dp/B00UXS7958/ref=cm_sw_r_wa_awd_x_PUKiybJBAP1PP
For the app, yes it does delete old videos automatically if that's what you mean by looping. It also does background recording so i just make it record in the background while using my phone normally.
Here is the link to the app
https://play.google.com/store/apps/details?id=com.hovans.autoguard.key
I use my Android cellphone as a dashcam.
Cheapest option if you have a decent camera phone.
I use this stand and this App.
I have been using this setup for more than a year with no issues. The videos self-delete if storage gets full (unless you save them) and you can save them on expandable storage or phone memory.