# Resolution screensharing

**URL:** <https://openvidu.discourse.group/t/resolution-screensharing/291>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [March 23, 2020, 8:26am UTC](https://openvidu.discourse.group/t/resolution-screensharing/291 "2020-03-23T08:26:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Jan](https://openvidu.discourse.group/u/Jan)\
**Post date:** [March 23, 2020, 8:26am UTC](https://openvidu.discourse.group/t/resolution-screensharing/291/1 "2020-03-23T08:26:16Z")

</div>

Hello,  
Is it possible to set the resolution for videoSource: ‘screen’?  
Tried setting resolution in PublisherProperties, but it doesn’t take effect. Is chrome extension an option?

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [March 23, 2020, 4:23pm UTC](https://openvidu.discourse.group/t/resolution-screensharing/291/2 "2020-03-23T16:23:22Z")

</div>

Hi,

Screen sharing doesn’t support changing the resolution by default. Width and height of the video in shouldn’t be changeable in case of screen sharing, as the screen has a specific widht and height.

This doesn’t mean you can’t do it. [PublisherProperties](https://openvidu.io/api/openvidu-browser/interfaces/publisherproperties.html) are meant to be a simpler way of obtaining a MediaStream from the client, but you can always direclty provide a MediaStreamTrack to `audioSource` and `videoSource` properties. So if you are able to get a screen video track changing its resolution, you just have to pass it as `videoSource` property.

Regards.

---

<div class="post-metadata">

**Author:** ![Matheus](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@Matheus](https://openvidu.discourse.group/u/Matheus)\
**Post date:** [July 2, 2020, 2:20pm UTC](https://openvidu.discourse.group/t/resolution-screensharing/291/3 "2020-07-02T14:20:11Z")

</div>

It works:

```
const publisherProperties = {
            videoSource: videoSource,
            publishAudio: false,
            publishVideo: true,
            mirror: false
        };
this.openViduScreen.initPublisherAsync(undefined, publisherProperties).then(
            (publisher: Publisher) => {
                publisher.once('accessAllowed', () => {
                    try {
                        publisher.stream.getMediaStream().getVideoTracks()[0].applyConstraints({
                            width: 1280,
                            height: 720
                          })
                    } catch (error) {
                        console.error(` erro na constraint =>`, publisher.stream.getMediaStream().getVideoTracks());
                    }
```

---

<div class="post-metadata">

**Author:** ![Jan](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@Jan](https://openvidu.discourse.group/u/Jan)\
**Post date:** [July 3, 2020, 10:12am UTC](https://openvidu.discourse.group/t/resolution-screensharing/291/4 "2020-07-03T10:12:06Z")

</div>

This is beautiful! Thanks!
