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
It's unnecessary to use JQuery, a pure Javascript solution is enough. Just replace the player div with a clone of itself:
oldVideoDiv = document.getElementById(videoId);
newVideoDiv = oldVideoDiv.cloneNode(true);
oldVideoDiv.parentNode.replaceChild(newVideoDiv, oldVideoDiv);
Simply do like this to refresh :
var a = document.getElementById('div_movie').innerHTML;
document.getElementById('div_movie').innerHTML = a;
My solution, This should work:
$('#myVideoContainer object').remove();
To remove the video and then re-add it, add the following to your function that closes the video window:
// Remove and re-add video
var clone = $("#video-holder").clone(true);
$("#video-holder").remove();
$("#video").html(clone);
Where you have a surrounding "video" div, and inside a "video-holder" div that houses the embed code.
$("#flashContainer").empty()
will also flush the embed code and stop Flash
We had the same issue. Flash video was embedded using swfobject.embedSWF(...), however, IE9 did not stop the video when the div was hidden using jquery.
Simple workardound: Call the swfobject.embedSWF(...) again to (re)load the swf into the same target div.
If you have a video with autoplay, try to load another empty swf file when hiding. Cheers