I can't think of a way. Not reliably anyway. It might be possible to set an app to auto-play, and make sure that app is running when you lock the iPad; but I don't know any apps that will do that, and the set up for it would mean you'd have to lock the iPad the same way every time.
So, no, I'm pretty sure you can't do it in a way that would be worth while.
What are you actually trying to accomplish? Perhaps there is another approach.