drublic / css-modal

A modal built with pure CSS, enhanced with JavaScript
https://drublic.github.io/css-modal
MIT License
1.82k stars 211 forks source link

Video does not stop when modal is close #185

Closed ThumperDone closed 9 years ago

ThumperDone commented 9 years ago

Both HTML5 and Youtube video keep playing after the modal has been closed. How would I link the close function to stopping both video types?

drublic commented 9 years ago

Hi, thanks for the heads up and thanks for using CSS Modal.

We've build two plugins for that. Please see the plugins folder and search the issues. We've already answered this, I think. I hope it helps :)

Please let us know if you need anything else.

On Mon, Apr 20, 2015, 3:41 PM droidsignage notifications@github.com wrote:

Both HTML5 and Youtube video keep playing after the modal has been closed. How would I link the close function to stopping both video types?

— Reply to this email directly or view it on GitHub https://github.com/drublic/css-modal/issues/185.

tmpkco commented 9 years ago

Hans,

I've contacted you about some issues previously, and this was one of them. Including the plugins that you mention above did not solve the issue on the site I was developing. Unfortunately, I cannot provide the code. I had it configured as shown, an even referenced your examples, but I had the same issue.

drublic commented 9 years ago

@tmpkco Please check out master and test index.html: css-modal/#modal-html5video. Does the video stop function for you? You can always post a reduced example. That is what I'd be happy to work with :)

rafagaseo commented 9 years ago

I solved adding onclick="pauseVid()" in the element that have the class .modal-close

And I Added in js

var vid = document.getElementById("video");
function pauseVid() {
    video.pause();
}
drublic commented 9 years ago

Closing this as there was no more information provided. Please let me know if the bug persists.