I've got a button that expands/collapses a YouTube video. But, when the video player is collapsed, the YouTube video continues to play in the background. Is there any way of me pausing the video when the button is clicked to collapse the video player?
I'm using YouTube videos as it's the easiest way of getting a video to play on a dynamic page (With the YouTube URL in the database collection).
Any help would be greatly appreciated.