[html5] HTML5 FileApi + FileReader - Feed <object> with SWF

Dennis Joachimsthaler dennis at efjot.de
Tue Sep 28 01:17:19 PDT 2010


Hello,

I want to use the HTML5 FileApi to read a SWF to an OBJECT or EMBED.

My current code crashes on Chrome/Iron (the only stable browser which also  
supports the xmlhttprequest v2 FormData, because I want to send this off  
afterwards) if I use OBJECT. I got it to read image data into a on-the-fly  
created IMG. But the object one crashes the current tab in the browser. I  
also tried to use <embed>, reading to embed.src. This resulted in the  
flash object coming up, but it didn't load them movie (Movie not loaded in  
right-click-menu).

[...]
else if (file.type == "application/x-shockwave-flash") {
     var show = document.createElement("object");
     show.type = "application/x-shockwave-flash"
     show.style.width = "100%";
     show.style.height = "100%";
     show.id = "thumb";
     document.getElementById("thumbnails").appendChild(show);

     var reader = new FileReader();
     reader.onload = (function (obj) {
         return function (e) { obj.data = e.target.result; };
     })(show);
     reader.readAsDataURL(file);

Do I really read to the object.data part? How is it done right? Anybody  
know? Or is this incomplete and I have to wait for better implementation?


Dennis Joachimsthaler
____________
Virus checked by G DATA AntiVirus
Version: AVB 21.366 from 27.09.2010
Virus news: www.antiviruslab.com





More information about the Help mailing list