# objectFit: cover for babylon Video Textures (Video Textures)

**URL:** <https://forum.babylonjs.com/t/objectfit-cover-for-babylon-video-textures-video-textures/27058>\
**Category:** Questions\
**Tags:** material\
**Created:** [January 25, 2022, 2:30am UTC](https://forum.babylonjs.com/t/objectfit-cover-for-babylon-video-textures-video-textures/27058 "2022-01-25T02:30:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nawar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nawar/32/14923_2.png) [@Nawar](https://forum.babylonjs.com/u/Nawar)\
**Post date:** [January 25, 2022, 2:30am UTC](https://forum.babylonjs.com/t/objectfit-cover-for-babylon-video-textures-video-textures/27058/1 "2022-01-25T02:30:30Z")

</div>

Hello!  
I have some code:

```auto

        let mat = new StandardMaterial("videoMat", scene)

        mat.diffuseTexture = new VideoTexture(name, videoEl, scene, true, true)
        mat.roughness = 1
        mat.emissiveColor = new Color3.White()
    
        videoPanel.material = mat 

```

Everything is fine, it works, but the video is narrow

 ![wrongTexture](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/0/b00f76895989ed2fb8602305cc38f44ce6b6f3c8.png)

I would like some kind of analogue of `objectFit: cover` from the css world for the babylon texture video.  
Is there something similar? Or some other way to keep the aspect ratio?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [January 25, 2022, 2:51am UTC](https://forum.babylonjs.com/t/objectfit-cover-for-babylon-video-textures-video-textures/27058/2 "2022-01-25T02:51:02Z")

</div>

It depends also on your UV - [https://playground.babylonjs.com/#ZMCFYA#222](https://playground.babylonjs.com/#ZMCFYA#222)
