How to make audio/video stop when modal is closed?

Hey guys,
I am VERY new to Javascript and i’m trying to figure out how to get audio and video to stop playing when the modal box is closed? Below is my code, can anyone help with the js?

        <div class="modal-content">
            <div class="close-modal" data-dismiss="modal">
                <div class="lr">
                    <div class="rl">
                    </div>
                </div>
            </div>
            <div class="container">
                <div class="row">
                    <div class="col-lg-8 col-lg-offset-2">
                        <div class="modal-body">
                            <h2>Spiderman</h2>
<video width="640" height="480" controls class="video">
  <source src="VIDEO/MARVEL_INTRO.mov" type="video/mp4">
  Your browser does not support the video tag.
</video>/p>
                            <ul class="list-inline item-details">
                                <li>Client:
                                    <strong><a href="http://startbootstrap.com">Start Bootstrap</a>
                                    </strong>
                                </li>
                                <li>Date:
                                    <strong><a href="http://startbootstrap.com">April 2014</a>
                                    </strong>
                                </li>

and the JS

$("#portfolioModal9").click(function(){
        $("#portfolioModal9").video("pause");
    });