Lets assume i got 3 .flv files in a folder. How can i create a flashplayer which can read the amount of .flv files from that folder and play them. And if example, i add 2 more videos to that folder, the flashplayer will detect them too, and play them chronologically after the name, date, etc.. ??
开发者_StackOverflow社区just need some guide or maybe links which explain how to do this?
tnx in advance.
you need some kind of serverside code to read the folders and send them to the flash player by xml. the flash player can't scan the folder by itself, because it's running in the browser (on the user's computer) not on the server. you could try a hack (naming all the files something like 1.flv, 2.flv, 3.flv etc. ) and try to load them one by one until you get a 404 , but that's just an ugly hack
IMHO The right process for this is:
Write server side code (php, .net, ROR). The server side code should "watch" a folder, returning an XML output of what exist in the folder, here, you can also validate the files have .flv or .mp4 extension and return a result with this only.
After you have the server side code, in the Flash part of the project you consume the XML and simply iterate through it creating an Array.
Once you complete playing a movie, you step to the next index in the array.
Easily, you can also create back>forward buttons in this way enjoying your ability to iterate through the array.
精彩评论