I'm trying to create a plugin to insert an flv file using the flowplayer viewer. That part is working great. However, as part of my plugin, I want to display a preview of the movie after it is selected in the dialog. Here is the script I have:
function UpdatePreview()
{
var thisUrl = document.getElementById('txtURL').value;
if ( !ePreview )
return ;
while ( ePreview.firstChild )
ePreview.removeChild( ePreview.firstChild ) ;
if ( GetE('txtURL').value.length == 0 )
ePreview.innerHTML = ' ' ;
else
{
var oDoc = ePreview.ownerDocument || ePreview.document ;
var newDiv = oDoc.createElement( 'div' ) ;
var s ='';
s+= '<script type="text/javascript" src="/Portals/0/Misc/flashembed.min.js"></script><script>\n';
s+= ' flashembed("video",\n';
s+= ' {\n';
s+= ' src:"/Portals/0/Misc/FlowPlayerLight.swf",\n';
s+= ' width: 320,\n';
s+= ' height: 240\n';
s+= ' },\n';
s+= ' {config: {\n';
s+= ' autoPlay: true,\n';
s+= ' loop: true,\n';
s+= ' autoBuffering: true,\n';
s+= ' initialScale: "fit",\n';
s+= ' videoFile: "' + thisUrl + '"\n';
s+= ' }}\n';
s+= ' );\n';
s+= '</script>\n\n';
s+= '<div id="page" align="center">\n'
s+= '<div id="video"></div>\n';
s+= '</div>';
newDiv.innerHTML = s;
ePreview.appendChild(newDiv);
}
}
This works great in Firefox, but nothing happens in IE. After doing some research, I discovered that IE doesn't play well with innerHTML. I've yet to find an equivalent way of doing the same thing that works in IE. I saw a post on a forum that suggested using appendChild with a textNode, but all that does is display the text of the script in the preview area without executing the script. Please, does anyone know how I can accomplish this so that I can get back on a regular sleep schedule?
Thanks in advance!!