Yes, the entire drive, luckily I still had warranty. The next time it goes if my AppleCare has expired I'm just going to buy an external. You can try a cleaning disc to see if that helps and try resetting the SMC and pram, but from experience I wouldn't be too hopeful.
TO reset the SMC
Shut down the computer.
Unplug the computers power cord.
Wait fifteen seconds.
Attach the computers power cord.
Wait five seconds, then press the power button to turn on the computer.
Resetting NVRAM / PRAM
Shut down your Mac.
Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
Turn on the computer.
Press and hold the Command-Option-P-R keys before the gray screen appears.
Hold the keys down until the computer restarts and you hear the startup sound for the second time.
Release the keys.
I apparently have the same problem. DVD's eject after ~30 seconds, although a blank DVD does not. CDs appear to work okay. I've tried Mike Sombrio's solution, but to no avail. I've read other related threads and see no solutions other than:
1) have Apple replace the drive
2) buy an external drive along the lines of Re: What external read / write DVD drive is best for imac
My sense from other discussions is that #1 is not worth it. I have no clue how much this would cost. Any ideas?
Also, does anyone have any updates on #2, i.e., latest recommendations for an external drive replacement? (I do know from other threads that the Apple external superdrive is a no-no for my machine.)
iMac mid-2011, OS X 7.5.2