The specific features including high factor and long vibration lifetime of nanomechanical resonator (NR) in nano-optomechanical systems have stimulated research to realize some optical devices. In this work, we demonstrate theoretically that it is possible to achieve quantum memory for light on demand via a quantum dot system coupled to a nanomechanical resonator. This quantum memory for light is based on mechanically induced exciton polaritons, which makes the dark-state polariton reaccelerated and converted back into a photon pulse. Our presented device could open the door to all-optical routers for light memory devices and quantum information processing.