title: How to send information to other user but not to user who did the action using socket.io
body: <p>Trying to build something like &quot;Watch2Gether&quot;. This is how I attach click event for the play/pause btn:</p>
  <pre><code>document.querySelector('.vjs-icon-placeholder').addEventListener('click', (e) =&gt; {
          e.preventDefault();
          sendThatSomeOnePlayedPausedTheVideo();
      });
  </code></pre>
  <p>This is how I send to socket.io that someone click it:</p>
  <pre><code>function sendThatSomeOnePlayedPausedTheVideo() {
      socket.emit('video-trigger', userName);
  }
  </code></pre>
  <p>This is how I play/pause video for others:</p>
  <pre><code>socket.on('video-trigger', function(data) {
      var newlyDiv = document.createElement('div');
      newlyDiv.classList.add('join');
      PlayOrStopVideo(newlyDiv, data);
      chat.appendChild(newlyDiv);
  });
  </code></pre>
  <p>And the PlayOrStopVideo function:</p>
  <pre><code>function PlayOrStopVideo(newlyDiv, data) {
      if (video.paused === true) {
          video.play();
          newlyDiv.innerHTML = `${data} just played the video.`;
      } else {
          video.pause();
          newlyDiv.innerHTML = `${data} just paused the video.`;
      }
  }
  </code></pre>
  <p>Think problem is that when you click the button the video starts (for all users) and then from socket.io('video-trigger') the video stops for the user who played because on his site the video is playing at the moment. How to make the user who played the video not have the video stopped. I tried to use e.preventDefault() but it didn't work... For video player I use <a href="https://videojs.com/" rel="nofollow noreferrer">Videojs</a></p>