Creating a background task with ui

I am creating a music player and I want to have task in the background to play music and have interface to integrate with user.