after some searching, i found that after using:
self.player.mediaStatusChanged.connect(self.check_video_status)
and
def check_video_status(self, status):
# Check if the media status indicates the video has finished
if status == QMediaPlayer.MediaStatus.EndOfMedia:
self.video.close() # Close the app when the video is over
the program is able to send a signal when the video over, then close the app