2013-05-30 23 views
0

我米用下面swfobject的代碼嵌入我的頁面上的Flash對象:IE9 swfobject的不確定

flashVars = 
     appMode: appMode 
     callback: "function(){app.broadcaster.webcam.emit.apply(app.broadcaster.webcam, arguments);}" 
    params = 
     quality: "high" 
     bgcolor: "#ffffff" 
     wmode: "transparent" 
     allowscriptaccess: "always" 
     allowfullscreen: "true" 
     allowNetworking: "all" 
     allowFullScreenInteractive: true 
    attributes = 
     id: id 
     name: id 
     align: "middle" 
     classid: "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
    args = [ 
     "/bin-release-v2/fApp_1_9_beta4.swf" 
     id 
     "464" 
     "348", 
     "11.1.0" 
     "/bin-release/playerProductInstall.swf" 
     flashVars 
     params 
     attributes 
     (e) => 
     app.log "embedded player!", "broadcaster" 
     $el = $ e.ref 
     webcam = WebcamBroadcaster.create $el 
     @emit "embed", webcam 
     deferred.resolve webcam 
    ] 
swfobject.embedSWF args... 

一切運作良好,我可以調用對象的方法(包括IE9),但我得到這個錯誤隨機:

document.getElementById("webcam").setReturnValue("<undefined/>") 

SCRIPT 5007: Unable to get value of the property 'SetReturnValue': object is null or undefined 

我在一個基於socket.io的廣播網站工作,這發生在客戶端。

當廣播公司斷開連接時,flash對象將從客戶端刪除,並在連接時再次嵌入。

難道是快速刪除/嵌入在閃光燈和IE9瀏覽器慢?

回答

0

移動/隱藏包含SWF對象的DOM元素會導致重新嵌入,因此其方法不能被稱爲「同時」。