Level 75
You can try: https://www.w3schools.com/howto/howto_css_modals.asp
I have used it and placed an iframe or object. I modified example as needed.
I usually do this:
<div>
<div class="modal-content" id="myModal" title="this is a dialog">
<span id="modalspan" class="close" onclick="closeModal()" >×</span>
<iframe style="width: 98%; margin: auto;" id="thedialog" height="300"></iframe>
</div>
</div>
Just example. The object or iframe in a modal.
Maybe you could adjust your code as needed to something similar. Just suggestion.
Edit:
In my case there is no video, I show other data:
function showBal()
{
var url = '<?php echo DIR . "check/balance"; ?>';
var modal = document.getElementById("myModal");
var span = document.getElementsByClassName("close")[0];
myModal.style.display = "block";
document.getElementById("thedialog").src = url;
}
Closing:
function closeModal()
{
document.getElementById("myModal").style.display = "none";
}
But tweaking style and placement is a little trial and error.