Resize screen during video playng

672 views Asked by At

How I can resize video player during video playing, resize screen for 10 second and then return to initial dimension.

For example initial dimension 640 x 480 every 30 second player resize automatic to 440 x 280 for 10 second and then return to 640 x 480.

Is possible with video.js?

1

There are 1 answers

0
Pippin On

As per video.js documentation here :

The Video.js embed code is simply an HTML5 video tag, so for many of the options you can use the standard tag attributes to set the options.

Because video.js uses the standard HTML tag you can create an addEventListener based on clicking play as per the HTML5 element's standards here.

So with this understanding we can move forward to build the event listener. Tt would look something like this:

document.getElementById("video").addEventListener('play', stretch, false);

function stretch() {
        this.removeEventListener('play', stretch, false);
        document.getElementById("stretchMe").style.width="800px";

}