Create playlist on the fly

Hello everyone!
I need to dynamically create playlist , using array if media_id’s. I don’t want to save playlist on media server - just create on the page player with selected media’s (in playlist).
Please answer me , can I do it or not? If can - please give a example how to do it.

Also I found in API documentatin method, playlist:executefromcontent - it gives me list of media’s metadata . Can I use this somehow?
Thank you