Quote Originally Posted by Initiostar View Post
Thank you Acorn,
Can I ask you how you could extend the 'vplayer' function to first check whether the player is showing? if true, the function operates as normal, if false, show the player, then execute the 'vplayer' function.
Here's the thought process: I'd like to keep on the On/Off button (for some more fun), but now if I pick a video on the list and the player isn't showing I'll get the audio, but not the picture.
Thanks again, the most code I've probably written in 40 years
Gary
Gary, if I read you right, you could move the showing variable to the top (outside any function) just after the view declaration: var showing = view.style.display;

Then you could use !view.paused - so when playing the value is true. Add in showing. With a value of none then you know when the video is playing but not showing.

if (!view.paused && (showing == "none")) ( /* do something when playing but not showing */ vplayer("video.mp4") }

Acorn