what is wrong with my cd player?

My cd player plays cds for an hour or so and then when I change the disc it will not read any more cds, this only happens after it has warmed up, it plays fine when I first turn it on, what could cause this?
dirty lens. there are sweep CDs but the best if you go inside the mechanizm and clean it right there but with caution not to destroy the mechanizm.
It could be a defective laser.
There may be a capacitor in the power supply that powers the laser directly ... as this capacitor ages it starts to gradually fail.. (it’s ability to charge ..store and discharge) .. less in the beginning more with age

Your works cold .. fails hot scenario seems to indicate a cap failing

If the laser diode was bad or the spindle motor unable to ramp the CD up to speed you would get a .. ERROR or NO DISC .. message in the display as the disc can’t be read

Because your player plays cold .. laser diode and spindle motor are working ...
Sound's like a laser going bad. If you can see the lens, get a can of compressed air and, about six inches away, blow some at the lens. Occasionally, this will remove a stubborn spec of dust and all is well. May the force be with you.
Check for this simple mechanical problem. The CD player has to clamp the disc to spin it.With age the friction surface on the upper clamp can wear causing the disc to slip/skip during play. Using a paper ring on the CD upper friction surface (donut shaped ring area on side opposite of play area)should allow the CD to be clamped and played if this is the issue. Used to have this warm up issue with a Linn Genki before I opened it up and put some thin contact paper on the top clamp ring
thanks for your responses everyone
I would start with Davehrab's suggestion. Have you tried turning the unit off for ten minutes and then tryed loading a disc. If it plays and/or plays a portion of the disc then stops. I would say that it is probably the power supply for the transport or related components. If that doesn't reveal to be the problem then go after the dirty lens solutions suggested. You didn't mention what player you are using. Is it a drawer load, top load, or slot load.
If it is a drawer load you may want to remove the top and then use the canned air so that you can more directly aim at the lens. Same with a slot load. Hopefully it is something simple.