Since Nougat, Power saver causes streaming to shut off. I have an HTC One M9. It got an update to Nougat recently. Since the update, after about 2 minutes of the screen shutting off, streaming music stops playing. This happens regardless if i'm on WiFi or not. This happens with Pandora and iHeartRadio. 

I figured out that shutting off power saver will keep the music playing. This has never been a problem in the past. 

How can i keep the music playing and keep power saver on?
I found that if you remove the particular app like Pandora or iHeartRadio from the optimization list then the music will keep playing. My best guess is that when the app is moved from optimized to not optimized the battery optimization will not suspend it's processes in the background. 

To do this go to Settings->Power->Battery optimization

From the drop down menu at the top select all Apps

Find the app you want and tap on it. From the menu that appears select Don't optimize and tap done.