When using dojox.av.FLVideo widget, I have encountered a problem where I can't destroy the widget manually. In simple logic:
1st AJAX call [Retrieves a partial page A with video]
var videoDiv = document.createElement('div');
videoDiv.id = "vid";
mainContent.appendChild(videoDiv);
var newVideo = new dojox.av.FLVideo({initialVolume:.7, mediaUrl:'video/sample.flv', autoPlay:true, isDebug:true}, "vid");
//video plays and everything looks fine
2nd AJAX call [Get another partial page B to replace the video]
var oldVideo = dijit.byId('vid');
oldVideo.destroy(); //should destroy this widget but doesn't
For some reason this widget is not destroyed, causing a problem because by the time we go back to perform AJAX call and try to page A and video again, it throws the id already exists exception. I also tried other funcions such us destroyRecursive(), disconnect() but none of them worked, does anyone know where the problem is?
Cheers
Peter