Hey guys, I just finished installing flowplayer (video player for my website) on my server but I would like flowplayer to play random videos from a folder on my server everytime the page is refreshed. I have no idea how I could go about doing this. But I'm fairly certain it would involve some PHP, hence why I post my question here. If anybody can point me in the right direction it would be greatly appreciated.
Hello tanyania, flowplayer reads a xml file to show videos. Hence you have to point it to a php that act like a xml file. I can't provide live links because I'm new here. But search google for php output as xml and you'll find plenty info. On that example it takes info from a database. In your case your "database" is a dir list. So you have a handy php function called readdir. search the php docs for it. Read the comments for a bucket load of examples. Hope it helps. I did not provide the live links because I'm new here
Hi... Use scandir() function to get the list of videos. $curVideoList = array_diff(scandir("relative video folder location"), array(".","..")); Choose a random value. Create a xml file as a string within the php, insert the random video location and output the xml with proper header. you must call this script from the player's embedded source.