Here's a piece of code I've written, and I'll mark the areas with red boxes where I have doubts

Here is two choose for me------playAdvertisement or playFolderTrack,but both them are not prefect
- when I use playAdvertisement ,if from The program starts,there play music all the time,there no doubt ,it's good.But when the program starts without music or muisc is end when program call playAdvertisement method ,playAdvertisement will lose effect.
- when I use playFolderTrack-----code in red box have effect whether there is music playing or not,but if this part code execute when I playing a music,music will pause,next music and previous music will chaos(The music for these two parts is not in the same folder)
so Can playAdvertisement methon can be called at any time like a playFolderTrack method, not just when there is music playing?
The full code is below