Almost anytime I try to use audio or video on my laptop it gets stuck for a while before it starts playing (video is worse). It happens both online and offline with things like windows media player, soundcloud, and spotify, but I notice it most frequently on youtube. When I click on a video, it takes ~1-3 minutes for it to start playing. If I pause a video and come back to it a couple minutes later, the audio will play first, then the audio will stop and the video will play alone until the two sync up and return to playing normally. I downloaded a browser extension to try and record what was happening, and amusingly the extension will not start working until the video is also working, so I assume there is a similar mechanism of action between all those things.
This is a used computer I've had for about 4 months. I've used Windows 8.1 and 10 on it during that time and had the same problem on both operating systems. It's an HP Pavilion g7-2251dx.
Any advice on how to fix this?