# Question regarding Record (video+screen)

**URL:** <https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [June 16, 2020, 10:44am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185 "2020-06-16T10:44:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 16, 2020, 10:44am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/1 "2020-06-16T10:44:15Z")

</div>

Hello,

How can I record the video along with the screen, knowings that each has its own session.

Thank you

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 16, 2020, 11:07am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/2 "2020-06-16T11:07:27Z")

</div>

Using COMPOSED recording, you can record all the participants in the same media session.

Using INDIVIDUAL recording, every audio+video is recorded in its own file.

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 16, 2020, 11:12am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/3 "2020-06-16T11:12:57Z")

</div>

Thank for your quick answer. However, I read in your forum that if I want to share the screen, I absolutely need two sessions. Is it really mandatory ? Is there an alternative to do it in one session ?

Thank you

---

<div class="post-metadata">

**Author:** ![micael.gallego](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/micael.gallego/32/2_2.png) [@micael.gallego](https://openvidu.discourse.group/u/micael.gallego)\
**Post date:** [June 16, 2020, 11:27am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/4 "2020-06-16T11:27:55Z")

</div>

If you want to share your screen alongside with the camera, a participant has to create two OpenVidu clients to simulate two “participants”.

You need a “fake” participant to share the camera. But all participants must be joined to the same session.

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 16, 2020, 2:02pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/5 "2020-06-16T14:02:20Z")

</div>

Thank-you for your prompt response.

Here are the steps I have followed, however when I share the screen, it only stay on my local pc  
As for the spectators, the camera works but the screen is the only problem.

 ![1openvidu](https://global.discourse-cdn.com/free1/uploads/openvidu/original/1X/300d2448f7d743c4a48c29a3098c5e0c50dc5aaa.jpeg)

 ![2openvidu](https://global.discourse-cdn.com/free1/uploads/openvidu/original/1X/d84a3adc836186fdf3674bce28e1a6adc5d70f7e.jpeg)

 ![3openvidu](https://global.discourse-cdn.com/free1/uploads/openvidu/original/1X/13c16369d4f32e242913418c651b7ada4d3ce379.jpeg)

---

<div class="post-metadata">

**Author:** ![CSantosM](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/csantosm/32/16_2.png) [@CSantosM](https://openvidu.discourse.group/u/CSantosM)\
**Post date:** [June 17, 2020, 12:56pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/6 "2020-06-17T12:56:25Z")

</div>

You need to initialize another session to be able to publish your screen.

```
screenSession = OVScreen.initSession();
screenSession.publish(screenPublisher);
```

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 17, 2020, 1:25pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/7 "2020-06-17T13:25:14Z")

</div>

I agree with you but to record a video, it only accept one session.  
Is there a solution ?

---

<div class="post-metadata">

**Author:** ![CSantosM](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/csantosm/32/16_2.png) [@CSantosM](https://openvidu.discourse.group/u/CSantosM)\
**Post date:** [June 17, 2020, 1:43pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/8 "2020-06-17T13:43:24Z")

</div>

The screenSession is a workaround to allow publish your screen and your camera at the same time. This session won’t subcribe to anyone, it only will emit the screen.

You will have to use the main session for recording.

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 17, 2020, 2:12pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/9 "2020-06-17T14:12:24Z")

</div>

The record function when I give it the main session, it only records the camera and not the screen.

Here’s the function that I did :

Recording recording = this.openVidu.startRecording(sessionId, properties);

---

<div class="post-metadata">

**Author:** ![CSantosM](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/csantosm/32/16_2.png) [@CSantosM](https://openvidu.discourse.group/u/CSantosM)\
**Post date:** [June 17, 2020, 2:27pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/10 "2020-06-17T14:27:27Z")

</div>

Are you publishing the screen on the session correctly?

Can you open a new incognito browser tab, join into the session and check if you are able to see the camera and screen videos from this new tab?

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 17, 2020, 2:30pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/11 "2020-06-17T14:30:54Z")

</div>

Yes all is fine. I can the screen and camera from my pc and I can the session as subscriber from another pc. I can watch everything correctly, screen and camera

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 17, 2020, 2:34pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/12 "2020-06-17T14:34:07Z")

</div>

![IMG_20200617_153155](https://global.discourse-cdn.com/free1/uploads/openvidu/original/1X/a87c916b9a7101e7f44dc622a6170530f6ab84f1.jpeg)

---

<div class="post-metadata">

**Author:** ![CSantosM](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/csantosm/32/16_2.png) [@CSantosM](https://openvidu.discourse.group/u/CSantosM)\
**Post date:** [June 17, 2020, 2:49pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/13 "2020-06-17T14:49:13Z")

</div>

Are you followed these instructions?

[https://docs.openvidu.io/en/2.14.0/advanced-features/recording/#2-configure-your-sessions-to-be-recorded](https://docs.openvidu.io/en/2.14.0/advanced-features/recording/#2-configure-your-sessions-to-be-recorded)

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 18, 2020, 8:58am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/14 "2020-06-18T08:58:18Z")

</div>

I have followed your instructions but nothing works.

I launched 2 sessions, one for the camera, the second one for the Screen. The live works but the recording of the video, it only takes on session.

How do I record for 2 sessions ?

---

<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:** [June 18, 2020, 9:06am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/15 "2020-06-18T09:06:41Z")

</div>

If you are properly publishing the camera and the screen to the same session and you record that specific session, both camera and screen will be recorded. I don’t know what have you exactly implemented, but if btoh are not recorded, then it means both are not published to the same session.

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 18, 2020, 9:19am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/16 "2020-06-18T09:19:51Z")

</div>

@pabloFuente

Here’s the thing, I asked your colleagues and they told me that I should use another session to publish the screen. Here’s the responds of your colleagues

 ![47](https://global.discourse-cdn.com/free1/uploads/openvidu/original/1X/b9250abf2eff19df2cc9a069ce8e5e13d72d0f3d.jpeg)

 ![48](https://global.discourse-cdn.com/free1/uploads/openvidu/original/1X/1b648c1f2737721a0d4f5e77aeabe9aa8e175e4a.jpeg)

I have no idea what to do and my goal is to share the screen and video on one session, so that the system can allow to record the screen and the video.  
Thank for your consideration.

---

<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:** [June 18, 2020, 9:28am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/17 "2020-06-18T09:28:18Z")

</div>

You don’t have to use a different session. Do you understand the concept of Session? A Session is a virtual space, a room, where users can publish video and receive video from other users connected TO THE SAME SESSION. If you publish to different sessions, of course they won’t be able to see each other.  
You have to simulate 2 different users for the SAME SESSION in the same client in order for that client to be able to publish webcam and screen at the same time. You have to generate 2 different tokens for the same user and call twice Session.connect and Session.publish in the same JS code.

When my colleagues are talking about two different sessions, they are referring to 2 different Session objects in the client side, as you must call OpenVidu.initSession twice in order to simulate the 2 users. But the token used to connect to both Session objects will belong to the same session inside openvidu-server.

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 22, 2020, 3:40pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/18 "2020-06-22T15:40:42Z")

</div>

Thank you, the solution worked well. Your services are on point, I still require your help for another issue.

There are 2 roles publisher and subscribe. When I launch my live, the video of my camera is created in my local navigator. Also when the subscriber enter the room to watch, sometimes it works and sometimes it doesn’t work. but when I search the console of the navigator, I found the balise is added, what I do is, refresh the page several times, then the video works.

How can I solve this problem ?

---

<div class="post-metadata">

**Author:** ![Youness\_Atouani](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/youness_atouani/32/477_2.png) [@Youness\_Atouani](https://openvidu.discourse.group/u/Youness_Atouani)\
**Post date:** [June 22, 2020, 3:42pm UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/19 "2020-06-22T15:42:12Z")

</div>

Thank you, the solution worked well. Your services are on point, I still require your help for another issue.

There are 2 roles publisher and subscribe. When I launch my live, the video of my camera is created in my local navigator. Also when the subscriber enter the room to watch, sometimes it works and sometimes it doesn’t work. but when I search the console of the navigator, I found the balise video  
is added, what I do is, refresh the page several times, then the video works.

How can I solve this problem ?

---

<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:** [June 24, 2020, 9:34am UTC](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185/20 "2020-06-24T09:34:14Z")

</div>

There are 2 things that might be happening if sometimes certain subscriber is able to receive a remote video and sometimes not: if the JS code is not asking for camera or mic permissions, sometimes you will need a user gesture to play the video feed. Chrome has been evolving towards a more restrictive behaviour in terms of autoplaying media streams. It works with an unknown trust algorithm, so being able to autoplay without a user gesture depends on the trust level that Chrome assings for certain web page for each specific user. Again, this will only affect if the user is only receiving remote video (that has an audio stream, by the way).

It can also mean that some ports are not opened in yur deployment. WebRTC needs [all of these ports](https://docs.openvidu.io/en/2.14.0/deployment/deploying-on-premises/#1-prerequisites) opened in the server. If that is not fully respected, it is possible that some negotiations don’t end well.

[Next page](https://openvidu.discourse.group/t/question-regarding-record-video-screen/1185.md?page=2)
