The software serial port is initialized once. The DFPlayer is initialized once. The volume is set once. Then the first track is set up to loop forever. Finally, the processor executes an empty loop.
Did you look at the few DFR examples, or the hundreds of others here in the forum? Basic structure wrong! Which you've presumably now seen anyway from : @van_der_decken's example?
In my own example, below (running on a Uno) I've assumed that despite your sparse details, you will want something more going on!
/*
Corrected version of sketch by @kenne76 in post
https://forum.arduino.cc/t/play-the-same-song-repeatedly-with-df-mini-player/1304414
*/
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
SoftwareSerial softwareSerial(10, 11);
DFRobotDFPlayerMini myPlayer;
void setup()
{
softwareSerial.begin(9600);
// These two wrongly placed in loop()
myPlayer.begin(softwareSerial);
myPlayer.volume(15);
// delay(1000); // Sometimes needed
}
void loop()
{
myPlayer.play(1);
delay(10000); // At least as long as track 1.
}