You will need to use the YouTube iframe API to upload your video in order to access the video controls using Javascript.
Another way to do this, which I do not recommend, but will work with your current code, is to delete the element at the end of the accordion, save the URL of the video somewhere, and then add the video again so that it is this original state, of course, this is not will maintain constant time on the video the user was in before.
Using jQuery, something like this might work:
<h4 class="customstyle" data-video="https://www.youtube.com/embed/hbmdOzWgyXU?rel=0&showinfo=0&autohide=1&start=0" style="border-radius: 0px;">JUL-13 | Video Test</h4>
Then, inside your click event, you can switch the class to determine if this section is open and whether it has a video from the data-video attribute. If the section is inactive (slide up), you delete the iframe code and re-add it with the URL from the data attribute.
$(this).toggleClass('active'); if (typeof $(this).attr('data-video') !== typeof undefined && $(this).attr('data-video') !== false && !$(this).hasClass('active')) {
Danny source share