-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop video when closing the modal #89
Comments
Yes, this should be done in JavaScript IMO. It’s a simple thing and should be added in a future version to improve video/audio support. |
I suck at JS, but I came with this quick solution: function stopVideo() {
document.getElementById('video').pause();
} And then add the ID="video" to my video tag in HTML. The problem is that we have t modify the close link with onclick="stopVideo()". I can bet that there's a better way to do it if we detect the bookmark URL to play or pause the video. |
I think there’s a better way to do this. Will dig into when finding some time, thanks for your report and quick solution. |
We should utilize the custom events of CSS Modal. This is nothing that we On Wed, Jan 29, 2014 at 1:15 PM, Anselm Hannemann
|
I'm doing this right now with Froogaloop that hooks into the Vimeo API. https://github.com/vimeo/player-api/tree/master/javascript // Robodemo
var roboDemo = $('#ipad_video');
// Play Robodemo
function playRoboDemo(playerID) {
var player = $f(playerID.get(0));
// Player Ready Event
player.addEvent('ready', function() {
player.api('play');
});
}
// Pause Robodemo
function pauseRoboDemo(playerID) {
var player = $f(playerID.get(0));
// Player Ready Event
player.addEvent('ready', function() {
player.api('pause');
});
}
// Add these to your click events or scroll if you want
playRoboDemo(roboDemo);
puaseRoboDemo(roboDemo); |
@drublic is kind of right, it it's a CSS modal then it would stop being CSS. but as you said, this JS would be for "flavoring" its use. Allowing html5 video in modal. (and maybe a fullscreen mode?). But it ups to you guys! |
Can we create a directory On Thu, Jan 30, 2014 at 1:15 PM, Daniel Martínez
|
Yes, think this would be a good idea. We also could provide one plugin for html5 video and another for the vimeo API then… |
That sounds Awesome. |
Hi,
When I add a HTML5 video and close the modal, the video keeps playing on background.
Should we add some JS to stop the video from playing? I don't find any way to do this with HTML/CSS.
The text was updated successfully, but these errors were encountered: