Video in background

Hello there. I have and xml file with flvs. How can I make them play in background random and to check if they are loaded. It something like this: A movie starts and after 20-40 seconds another random movie starts and the previous it is put in the back. And so on.
Thank you.