Flash video still playing on DIV that is removed using jQuery (IE bug)

后端 未结 13 2193
你的背包
你的背包 2020-12-03 05:57

I have some jQuery tabs one of which holds a flash video. When I play the video in one tab and click to another in FF or Safari the video stops along with the sound, clicki

13条回答
  •  -上瘾入骨i
    2020-12-03 06:20

    It's likely because you're applying the display: none; to the div holding the flash object, not the flash object itself.

    I was messing around with a sort of similar issue today and while I don't have an exact solution for you I do have a possibility you could try when you jump between divs to try and turn the player off:

    $(flashobjectid).attr('height', '0');
    

    If the flash player you're using happens to be the commonly used jw player then you could do (when you hide the div):

    document.getElementById(playerId).sendEvent("PLAY","false"); 
    

提交回复
热议问题