I am having trouble stopping all existing/running players before loading new a player. Only one player should be running at once.
My site is loads a z-layer with the player in. The problem is that if I click the playlist links more than once, it loads multiple players, and even continues playing when the z-layer is closed.
All calls to the player use the same id: player1
I have looked at these references:
- http://support.jwplayer.com/customer/portal/questions/6062894-stop-all-players-with-javascript
- http://support.jwplayer.com/customer/portal/questions/5496339-jwplayer-stop-how-to-use-this-code-for-multiple-players-
I have tried calling:
jwplayer("player1").stop()
before:
jwplayer("player1").setup({
and also:
onclick="jwplayer(\'player1\').stop();"
inside the playlist <a href ...>
links
but neither work. What is wrong please?
Also there is a white 'flash' on loading now which was not there before I tried these stopping methods. I have tried to change the background colour for var D="#000000", as described here:
but 'var D' is not in the jwplayer.js file.