Great question. It works best to play music from an external device. What many trainers do is hang their phone from the top of their computer with a popsocket, then play music from their computer so the phone picks up the audio.
Keep in mind that it is up to you to comply with relevant music rights and licensing laws. There are many royalty-free playlists on Spotify, like this for example192, that you can feel free to use.