The external hard drive keeps ejecting on your Mac issue could be caused by sleep settings, interference from third-party software, damaged USB port or cable, software bugs on Mac, hard drive corruption, insufficient power supply, outdated disk driver, etc.
When you try to open iTunes or iPhoto the icons keep bouncing but do not open, it indicates the iTunes or iPhoto apps fail to access your external hard drive connected to your Mac. When the external hard drive keeps disconnecting on Mac, the connection is unstable, which could interrupt the reading process of the drive and may corrupt your drive further.
To avoid data loss on the external hard drive, you can run data recovery software such as iBoysoft Data Recovery for Mac to recover lost and deleted data on the drive, and then fix the connection problem.
Method 1. Check the USB cable, USB port, USB hub, and try another hard drive or computer.
Method 2. Disconnect the hard drive, restart your Mac, and then reconnect it.
Method 3. Set "Put hard disks to sleep when possible" to Never in System Settings.
Method 4. Disable or uninstall third-party anti-virus programs.
Method 5. Repair the external hard drive with Disk Utility.
Method 6. Boot into Safe Mode and try to use the external drive.
Method 7. Upgrade or downgrade macOS.
Method 8. Reformat the external hard drive on Mac.