how can i do this in javascript ?
<script type="text/javascript">
var so = new SWFObject('{$baseurl}/player.swf','player','540','445','8');
so.addVariable('file','{$videourl}/{$videoarray[0].VIDEOID}.flv');
so.addVariable('height','445');
so.addVariable('width','540');
so.addVariable('location','{$baseurl}/player.swf');
so.addVariable('vid','{$videoarray[0].VIDEOID}');
so.addVariable("baseurl","{$baseurl}/");
so.addParam("wmode", "transparent");
so.addParam("vmode", "transparent");
so.write('player');
</script>
i am mainly concerned with this line so.addVariable('file','{$videourl}/{$videoarray[0].VIDEOID}.flv');
the $videourl contains a single folder where the video files are stored.
however, i have another server location that stores another set of videos.
how can i make it so that it will attempt to play from either one of the direcotires which has the actual video file.
for ex)
it will attempt to load from one videodir, the file is not there. it will move on to the second videodir that has the file and play it/
if both files are present on both videodir, then always play the first one.
i have two videodir, just incase there is failure in one of them.
|