Video dynamic setting width and height

Time:2020-11-30

The video is uploaded in the background through the editor. When uploading the video, the editor must input the width and height of the video, and it must be a number, not a percentage

It’s really not intelligent. How to transmit specific numbers to fit various types of equipment???

 

When the video is displayed in the foreground, all video tags have set the width and height attributes

I first removed the width and height attribute of the video settings

    $(function(){

        $("video").removeAttr("width");
        $("video").removeAttr("height");
    })

Then set the width and height of the video to 100% in the style

 video{width:100%;}

 

Setting the width and height of a video through style style is affected by the width and height attributes of the video tag, so I first remove these attributes