views:

318

answers:

2

Is there a simple, upfront method to have FF and IE treat hidden JW Players the same?

I am placing different instances of the player dynamically in jQuery generated tabs. In effect, switching tabs hides the parent div of each player. In FireFox, the tab switch and accompanying "display" change stops the player. This doesn't happen in IE. I would like it to.

What is the easiest way to have both browsers act the same? I am hoping for a CSS/HTML solution, either thorough the way the players are embedded or a style rule Otherwise I suppose I will need to add an item listener that compares the currently selected tab id to currently active players... but I'd rather not go that route.

Thanks for your tips!

EDIT: So, I'd rather be able to change the player CSS or markup on tab change than send stop events to all the players but the player in the currently active tab.

A: 

If you're using JavaScript to change tabs, why are you hoping for a pure CSS/HTML solution for your problem?

I think you have to use JavaScript.

Take a look at the JW Player API: http://developer.longtailvideo.com/trac/wiki/Player5Api

You can call the stop() method on the player.

player.stop();
edwin
Yes, I'm already controlling the player almost entirely through the API. The issue is that there is more than one player, which complicates things. For FF at least, "display:none" on an ancestor div stops the player if it is playing, and makes that player not hear sent events. I was hoping IE had a style rule that effected the player in the same way. Else I have to track all the players and add a send a stop event to all of them except for the one displayed in "this" tab, which is more involved. I'm lazy.
two7s_clash
+1  A: 

This is an issue with Internet Explorer. While FF, Chrome, and Safari will kill Flash, IE doesn't. The only way we've been able to ensure that the player stops is to keep track of all active players on the page and call stop.

Best,

Zach

Developer, LongTail Video

zach at longtail