title: How to start audio/video streaming on the request by user in RTCMulticonnection v3
body: <p>I am working on a Project of group chat and it is working fine but sometimes streaming is not happening. And any user who don't have webcam or webcam blocked in the browser then user not able to join.</p>
  <p>I am start streaming on joining of the room, so when any user joins the room streaming will start automatically, but I don't want to do that. I am creating list of users who joined the room and each user have camera icon beside the name in the list. By clicking on that camera icon want to stream for particular user. So if I have started streaming then all the users who joined the room will be able to see my cam. If they click on camera icon beside his name to start streaming then other users should be able to view his cam including me. If again he click on camera icon to disable camera then all the users will not be able to view his cam.</p>
  <p>Check below screenshot for more explanation.</p>
  <p><a href="https://i.stack.imgur.com/Ll04O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ll04O.png" alt="enter image description here" /></a></p>
  <p>By default current user's camera icon will be visible. All the other user's camera icon will be hidden. Cam will be visible on the start of the streaming.</p>
  <p>I have tried using below code, but only my cam start streaming not able to view cam on peer side.</p>
  <pre><code>myConnection.addStream({
      audio: true,
      video: true
  });
  </code></pre>
  <p>In the current system user can not join if user has no web cam or blocked cam in the browser.</p>
  <p>I have created script where user will be able join the room even if they don't have webcam. It will start streaming if user has webcam and peer user will be able to see the current user streaming.</p>
  <pre><code>$(document).on(&quot;click&quot;, &quot;.show-hide-user-cam&quot;, function () {
      var username = $(this).data(&quot;list-username&quot;);
      $(this).toggleClass(&quot;user-active&quot;);
      var room_id = $(this).data(&quot;room-id&quot;);
   
      var myConnection = getConnection(allConnections, room_id);
   
      var unique_identifier = $(this).data(&quot;list-unique_identifier&quot;);
      unique_identifier = unique_identifier.split(&quot;_&quot;);
      if ($(&quot;#chat-tab-&quot; + room_id + &quot; .show-hide-user-cam.user-active&quot;).length) {
          $(&quot;#chat-tab-&quot; + room_id + &quot; .activity-message&quot;).removeClass(&quot;height-409&quot;).addClass(&quot;height-259&quot;);
          $(&quot;#chat-tab-&quot; + room_id + &quot; .video-carousel&quot;).removeClass(&quot;hide&quot;);
      } else {
          $(&quot;#chat-tab-&quot; + room_id + &quot; .activity-message&quot;).removeClass(&quot;height-259&quot;).addClass(&quot;height-409&quot;);
          $(&quot;#chat-tab-&quot; + room_id + &quot; .video-carousel&quot;).addClass(&quot;hide&quot;);
      }
      $(&quot;#chat-tab-&quot; + room_id + &quot; .usercam_&quot; + username).not(&quot;#my-webcam-container-&quot; + room_id + &quot; .usercam_&quot; + username).toggleClass(&quot;hide&quot;);
      $(&quot;#my-webcam-container-&quot; + room_id + &quot; .usercam_&quot; + username).toggleClass(&quot;hide&quot;);
      var streamId = $(&quot;#chat-tab-&quot; + room_id + &quot; .usercam_&quot; + username).attr(&quot;id&quot;);
     
      if (CommonFunctions.getLocalStorage(&quot;is_room_streamed_&quot; + room_id) == 0) {
          myConnection.addStream({
              audio: true,
              video: true
          });
          CommonFunctions.setLocalStorage(&quot;is_room_streamed_&quot; + room_id, 1);
      } else {
          if ($(this).hasClass(&quot;user-active&quot;)) {
              myConnection.attachStreams.forEach(function (stream) {
                  if (stream.id == streamId) {
                      stream.unmute('audio');
                  }
              });
          } else {
              myConnection.attachStreams.forEach(function (stream) {
                  if (stream.id == streamId) {
                      stream.mute('audio');
                  }
              });
          }
      }
  });
  </code></pre>
  <p>I have raised issue in GitHub to get more information.</p>
  <p><a href="https://github.com/muaz-khan/WebRTC-Experiment/issues/578" rel="nofollow noreferrer">https://github.com/muaz-khan/WebRTC-Experiment/issues/578</a></p>