Xbox one powers on then shuts off in game

my xbox powers on fine i can watch movies an use other social apps but as soon i start playing games eg COD warzone it shutsoff 3-5 mins in game other times 20-25mins some other times 1 hr on the game in screen menus can some one help me after it shuts off when powerd on back it doesnt show anything about system over heat…

Power supply. I had the same issue. Watching YouTube or letting the console sit was fine. Try loading Fortnite and the console would turn off and never display an error message. I cleaned everything to no avail. Finally I swaped the power supply with my other Xbox and that one started shutting down. I bought a new PS off Amazon for $25 and all’s been good for 3 months so far. Hope this helps.