Javascript document.write('HTML CODE HERE') and using a var grabbed by flash

effomieme

New Member
so this is 2 questions in one. My first question is how would I do this?\[code\] document.write('<div id="jwplayer"><center><div id='mediaplayer'></div><script type="text/javascript"> jwplayer('mediaplayer').setup({ 'flashplayer': 'jwplayer/player.swf', 'id': 'playerID', 'width': '640', 'height': '580', 'provider': 'rtmp', 'streamer': 'rtmp://domain/recorder/_definst_','file': 'onSaveOk("+streamName+")' });</script></center></div>');\[/code\]I basically just want to print out that code when the function is called.This is the second part of my question, this function runs when the flash video recorder finishes saving the recorded video. It grabs all of the variables in the functions arguments from the flash player. I want to use one of the variables in my jwplayer code, how would I do this?Here is the function:\[code\] function onSaveOk(streamName,streamDuration,userId,cameraName,micName,recorderId){ //alert("onSaveOk("+streamName+","+streamDuration+","+userId+","+cameraName+","+micName+")"); //the user pressed the [save] button inside the recorder and the save_video_to_db.XXX script returned save=ok //recorderId: the recorderId sent via flash vars, to be used when there are many recorders on the same web page $('#record').hide(); document.write('<div id="jwplayer"><center><div id='mediaplayer'></div><script type="text/javascript"> jwplayer('mediaplayer').setup({ 'flashplayer': 'jwplayer/player.swf', 'id': 'playerID', 'width': '640', 'height': '580', 'provider': 'rtmp', 'streamer': 'rtmp://domain/recorder/_definst_','file': 'onSaveOk("+streamName+")' });</script></center></div>'); }\[/code\]This is where I try to use the streamName function, but it doesnt work:'file': 'onSaveOk("+streamName+")'How would I do this? Thanks.
 
Back
Top