This javascript which I'm using works with a webcam to record a video.
The end result, after the file is recorded, generates a file name, as you can see from the code below: Video+video_id.
I recorded a file, and the script named the end-result file: Video1335806296490.flv. I understand that the time and date is in this file name, but it's hard to decipher what the time and date of the recording is.
Can you help me with some code so as to make the the month, day, year and time appear more common and easily readable when a file name is generated? Here's the script I'm using currently:
<script type="text/javascript">
var video_id = get_id();
var filename = get_parm('filename');
if(filename == '' || filename == null)
{
filename = 'Video'+video_id;
}
var flashvars = {
filename: filename,
rtmpPath: "rtmp://xxxxxxxxxxxxxxx",
finishURL: "videoplayer.htm?filename="+filename,
};
var params = {
menu: "false",
scale: "noScale",
allowScriptAccess: "always",
bgcolor: "#000000"
};
var attributes = {
id:"webcamrecording"
};
swfobject.embedSWF("recording.swf", "recording", "620", "470", "9", "expressInstall.swf", flashvars, params, attributes);
function get_id()
{
var newDate = new Date();
return newDate.getTime();
}
function get_parm(name)
{
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )
{
return "";
}
else
{
return results[1];
}
}
</script>
Thanks.