I have a video element over which a div
element lies.
In this div
are overlay elements, which should lie at certain positions of the video (pixel distances from top and left).
<div id="videocontainer" class="videocontainer">
<video id="video" controls>
<source src="video.mp4" type="video/mp4">
</video>
<div class="overlay">
<div class="overlay-item" style="top:100px;left:100px;">TEXT</div>
</div>
</div>
If the video is displayed in fullscreen, the overlay elements are not visible anymore (as expected). This is because the fullscreen event is triggered only for the video element, but not for the overlay elements.
Question 1: How can I realize that the fullscreen also displays the overlay elements?
I found a stackoverflow post here, how the event can be triggered. however, only the video element is displayed in fullscreen.
Question 2: Due to the fact that the positions are given by pixel distances, the elements probably have to be scaled. Is there a built-in function for scaling or does it have to be implemented via javascript?