by Venkatesh Natarajan
***Updated based on Daniel's comment
Turns on bluetooth only when media is played without a wired headset. If no bluetooth device is connected, it will turn off automatically after 30 seconds.
Once connected, It will keep checking if Bluetooth is connected every 20 mins, and if it isn't, it will turn off automatically.
Tested on youtube, spotify and local media, but it should technically work with any app that plays music
Rate and review within the app in the Community section.