One line of code looping one part

Whenever I add player.play(1); to any of the if statements the print PULSE OXIMETER is on loop without it moving onto the next part of the code

#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

// Use pins 2 and 3 to communicate with DFPlayer Mini
static const uint8_t PIN_MP3_TX = 2; // Connects to module's RX 
static const uint8_t PIN_MP3_RX = 3; // Connects to module's TX 
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);

// Create the Player object
DFRobotDFPlayerMini player;


#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include "MAX30100_PulseOximeter.h"

#define REPORTING_PERIOD_MS     1000


LiquidCrystal_I2C lcd(0x27, 16, 2);


byte smile[] = {
  B00000,
  B00000,
  B01010,
  B00000,
  B10001,
  B01110,
  B00000,
  B00000
};
byte mod[] = {
  B00000,
  B00000,
  B01010,
  B00000,
  B11111,
  B00000,
  B00000,
  B00000
};
byte sad[] = {
  B00000,
  B00000,
  B01010,
  B00000,
  B01110,
  B10001,
  B00000,
  B00000
};

PulseOximeter pox;
uint32_t tsLastReport = 0;



void onBeatDetected()
{

  Serial.println("Beat!!!");

}

void setup()
{
  Serial.begin(9600);
  lcd.init();
  lcd.backlight();
  lcd.createChar(1 , smile);
  lcd.createChar(2 , mod);
  lcd.createChar(3 , sad);
  lcd.setCursor(0, 0);
  lcd.print("      Pulse");
  lcd.setCursor(0, 1);
  lcd.print("    Oximeter");
  delay(2000);

  if (!pox.begin()) {
    Serial.println("FAILED");
    for (;;);
  } else {
    Serial.println("SUCCESS");
  }
  pox.setIRLedCurrent(MAX30100_LED_CURR_7_6MA);

  pox.setOnBeatDetectedCallback(onBeatDetected);
  pinMode (13, OUTPUT);
  pinMode (12, OUTPUT);
  pinMode (11, OUTPUT);
}

void loop()
{
  pox.update();
  if (millis() - tsLastReport > REPORTING_PERIOD_MS) {

    lcd.clear();
    lcd.setCursor(0 , 0);
    lcd.print("BPM : ");
    lcd.print(pox.getHeartRate());
    lcd.setCursor(0 , 1);
    lcd.print("Sp02: ");
    lcd.print(pox.getSpO2());
    lcd.print("%");
    tsLastReport = millis();



    }
        if (pox.getSpO2() >= 96)  {
      lcd.setCursor(15 , 1);
      lcd.write(1);                 
    }
    else if (pox.getSpO2() <= 95 && pox.getSpO2() >= 91) {
      lcd.setCursor(15 , 1);
      lcd.write(2);                 
    }
    else if (pox.getSpO2() <= 90) {
      lcd.setCursor(15 , 1);
      lcd.write(3);

    if(pox.getHeartRate()<60){
        // Set volume to maximum (0 to 30).
    player.play(1);

    }
    else if (pox.getHeartRate() >=60 and pox.getHeartRate()<100 ){
        // Set volume to maximum (0 to 30).

        }
        else if (pox.getHeartRate() >100 ){

}
}

Your code is missing any initialization of the player object. That it behaves unpredictably in that case is to be expected.

Please examine the GettingStarted example that comes with the library to see the kind of thing that is necessary.

This does not exist in your code.

Impossible to help because insufficient information. Full code? What board? Circuit wiring? Link to Pulse Oximeter data sheet?

The comments about volume before the play() commands prompt me to ask if you have successfully run player sketches before?

Its separated as
Print PULSE
Print OXIMETER

This is the full code Arduino uno R3 and I made sure the wiring is correct

This means your Arduino is restarting. You have a power problem. Show a wiring diagram.

I solved it looping but now the oximeter wont send updates to the LCD

What was your solution? And show a wiring diagram.

You should not use pins 2 or 3 for your RX/TX serial communications. Use say 10/11 or 8/9. And don’t forget the 1k resistor on 11 or 9.