oneplus two – The phone freezes when playing music in the background

So lately I have a strange problem with my OnePlus 2, when I listen to my music and the phone is in idle mode, and someone is calling me, it starts vibrating as always when I receive calls, but the screen does not turn on. It turns on and the phone stops responding, it freezes and the vibration does not stop until I turn off the phone by pressing the power button.
I also recently noticed that something similar happened when I listen to my Bible application in the background with the screen turned off, and after a few minutes, it also freezes and the phone does not respond. Maybe both cases are caused by the same problem.
Do you know what could be causing this? How can I find out what is the reason why my phone does not respond and how to solve the problem?