JWPlayer IE issues, screen going blank after being hidden and shown
I'm using jwplayer in html tabs in IE with jQuery showing and hiding them (via style:hidden;)
When I hide a tab in IE and then show it again the plays video area goes blank (you can still hear sound and play/pause the video).
Does anyone know why this is happening or have a way to fix it.
Cheers.
Here's the jQ doing the hiding / showing:
function showpanel(panel){
jQuery('#announcements .panel').each(function(index) {
if(panel == index) {
jQuery(this).css('visibility','visible');
} else {
jQuery(this).css('visibility','hidden');
}
});
jQuery('#announcements .nav ul li.item').each(function(index) {
if(panel == index) {
jQuery(this).addClass("active");
} else {
jQuery(this).removeClass("active");
}
});
}
jQuery(document).ready(function(){
showpanel(0);
jQuery('#announcements .nav ul li.item').each(function(index) {
jQuery(this).mouseover(function(){
if(jQuery(this).hasClass("active")){
//console.log('if');
} else {
//consol开发者_StackOverflowe.log('else');
document.getElementById('jw_player').sendEvent('PLAY', 'false');
showpanel(index);
}
});
});
});
I used...
if(panel == index) {
jQuery(this).css('z-index','2');
} else {
jQuery(this).css('z-index','1');
}
Instead of the visibility and it worked great.
Best way to fix this solution is to remove the player when another tab is clicked. Then load the player back in when that tab is clicked/re-clicked. You can remove the player by using jwplayer("container").remove(); -- assuming your div with the player in it is an id named container. To add it back in just place the same jwplayer("container").setup({...}); in that function.
精彩评论