# Is it possible to distinguish that only two people use video and the rest can only chat as subscribers?

**URL:** <https://openvidu.discourse.group/t/is-it-possible-to-distinguish-that-only-two-people-use-video-and-the-rest-can-only-chat-as-subscribers/3952>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [May 10, 2022, 3:04am UTC](https://openvidu.discourse.group/t/is-it-possible-to-distinguish-that-only-two-people-use-video-and-the-rest-can-only-chat-as-subscribers/3952 "2022-05-10T03:04:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yeouido\_Lee](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/yeouido_lee/32/1922_2.png) [@Yeouido\_Lee](https://openvidu.discourse.group/u/Yeouido_Lee)\
**Post date:** [May 10, 2022, 3:04am UTC](https://openvidu.discourse.group/t/is-it-possible-to-distinguish-that-only-two-people-use-video-and-the-rest-can-only-chat-as-subscribers/3952/1 "2022-05-10T03:04:57Z")

</div>

Dear, OpenVidu Developers.

We are building a service by using the openVidu ‘React call tutorial’.  
We want to distinguish between the users participating in the room.

Currently, video connection is essential for all incoming participants, but I want to make it so that only designated users can use video and the rest can only function as viewers.

For example, it is a service where only two people can chat via video, and the rest can only chat while looking at the screen.

I’d like to know if this is possible, and if so, how.

Thank you.

---

<div class="post-metadata">

**Author:** ![Yeouido\_Lee](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/yeouido_lee/32/1922_2.png) [@Yeouido\_Lee](https://openvidu.discourse.group/u/Yeouido_Lee)\
**Post date:** [May 10, 2022, 7:12am UTC](https://openvidu.discourse.group/t/is-it-possible-to-distinguish-that-only-two-people-use-video-and-the-rest-can-only-chat-as-subscribers/3952/2 "2022-05-10T07:12:57Z")

</div>

Please anybody help. is there any proper way?

---

<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:** [May 10, 2022, 9:54am UTC](https://openvidu.discourse.group/t/is-it-possible-to-distinguish-that-only-two-people-use-video-and-the-rest-can-only-chat-as-subscribers/3952/3 "2022-05-10T09:54:20Z")

</div>

Of course this is possible. For this reason OpenVidu has the concept of user roles: **Connection.role**

Users with role `SUBSCRIBER` are only able to receive video. Users with role `PUBLISHER` are able to receive and send video. Users with role `MODERATOR` can do both things, and besides manage other user’s videos.

To make a user publish video, you should generate a Connection with role PUBLISHER, and use its token to connect that user to the Session. And after connected to it, the user should initialize a Publisher and publish it to the Session.

To make a user only receive video, you should generate a Connection with role SUBSCRIBER, and use its token to connect that user to the Session. And after connected to it, the user should simply subscribe to any remote Stream published to the Session. Do not initialize any Publisher.

More information:

- [Publish/Unpublish a Stream](https://docs.openvidu.io/en/2.21.0/cheatsheet/publish-unpublish/)
- [Subscribe/Unsubcribe from a Stream](https://docs.openvidu.io/en/2.21.0/cheatsheet/subscribe-unsubscribe/)

There are also several tutorials that show the concept of PUBLISHERS vs SUBSCRIBERS:

- A Java tutorial: [openvidu-js-java](https://docs.openvidu.io/en/2.21.0/tutorials/openvidu-js-java/)
- A Node tutorial: [openvidu-js-node](https://docs.openvidu.io/en/2.21.0/tutorials/openvidu-js-node/)

---

<div class="post-metadata">

**Author:** ![Yeouido\_Lee](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/yeouido_lee/32/1922_2.png) [@Yeouido\_Lee](https://openvidu.discourse.group/u/Yeouido_Lee)\
**Post date:** [May 11, 2022, 1:45am UTC](https://openvidu.discourse.group/t/is-it-possible-to-distinguish-that-only-two-people-use-video-and-the-rest-can-only-chat-as-subscribers/3952/4 "2022-05-11T01:45:03Z")

</div>

@pabloFuente  
I understand those roles, but right now everyone entering each room has their video turned on as a publisher.  
Situation now is: If the person making the room is a publisher, then the next person who comes in is the room’s subscribers and also a new publisher.

How can I give the separated rolls before they come in?

thank you.

---

<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:** [May 11, 2022, 10:29am UTC](https://openvidu.discourse.group/t/is-it-possible-to-distinguish-that-only-two-people-use-video-and-the-rest-can-only-chat-as-subscribers/3952/5 "2022-05-11T10:29:42Z")

</div>

You must customize the OpenVidu Call React application to do so. This demo app by default handles every user the same way (as Publishers). You’d have to modify it to only publish when the user is actually a Publisher, and only subscribe when it is a subscriber.

---

<div class="post-metadata">

**Author:** ![Yeouido\_Lee](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/yeouido_lee/32/1922_2.png) [@Yeouido\_Lee](https://openvidu.discourse.group/u/Yeouido_Lee)\
**Post date:** [May 11, 2022, 6:25pm UTC](https://openvidu.discourse.group/t/is-it-possible-to-distinguish-that-only-two-people-use-video-and-the-rest-can-only-chat-as-subscribers/3952/6 "2022-05-11T18:25:39Z")

</div>

@pabloFuente

Where can I modify those (real pub to pub, real sub to sub) function in react codes?

Thank you.
