views:

75

answers:

2

hey everyone.

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.. ??

just need some guide or maybe links which explain how to do this?

tnx in advance.

+2  A: 

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

matei
not sure what serverside code is about. but i appresiate your answer. Atleast now i know what to look for. Want to tell me more about serverside code, is it difficult?
MaNa
@MaNa: Depends on whether you're a programmer or not.
Matti Virkkunen
it means that you need to write a program that will run on the server (depending on the server the program could be written in python, php, java, something.NET etc.) , read the file list of the folder, put it in an xml form and return it to the flash player
matei
aha, tnx. Actually i was doing some php coding with the site, so i might try it with php
MaNa
+1  A: 

IMHO The right process for this is:

  1. 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.

  2. 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.

  3. 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.

Avi Tzurel