Stop video html5 on close modal Materialize, using jquery
<p>I am using Materialize in app ruby on rails and want video stop closing modal Materialize.
Help me please.</p>

<pre><code>&lt;% @chapter.episode.each do |episode| %&gt;
    &lt;a class="btn modal-trigger" href="#&lt;%= episode.name %&gt;"&gt;&lt;%= episode.name %&gt;&lt;/a&gt;
  &lt;div id="&lt;%= episode.name %&gt;" class="modal"&gt;
    &lt;i id="close" title="Cerrar" class=" modal-action modal-close waves-green right material-icons"&gt;close&lt;/i&gt;
    &lt;div class="modal-content"&gt;
        &lt;video id="&lt;%= episode.name %&gt;"  width="320" height="240" controls&gt;
        &lt;source id="&lt;%= episode.name %&gt;" src="&lt;%= episode.url %&gt;" type="video/mp4; codecs='avc1.42E01E, mp4a.40.2'"&gt;
        Your browser does not support the video tag.
        &lt;/video&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;% end %&gt;
</code></pre>