I am using the Metro UI Template, but I have a problem with the dialog when using Videos. When I close the dialog, the video continues playing.
The code I have is:
<script>
function showDialog(id){
var dialog = $("#"+id).data('dialog');
if (!dialog.element.data('opened')) {
dialog.open();
} else {
dialog.close();
}
}
</script>
Then the dialog is called by:
<div data-role="dialog" id="video" class="padding20" data-close-button="true" data-overlay="true" data-overlay-color="op-dark">
<h2>Title of Video</h2>
<video width="800px" controls="controls">
<source src="videos/video.mp4" type="video/mp4">
Your browser does not support the HTML5 Video element.
</video>
</div>
Does anyone know how I can stop the video when the dialog is closed?