How to use the twilio-video.LocalDataTrack function in twilio-video

To help you get started, we’ve selected a few twilio-video examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twilio / draw-with-twilio / src / index.js View on Github external
function setupLocalDataTrack() {
  const dataTrack = new LocalDataTrack();

  let mouseDown;
  let mouseCoordinates;

  window.addEventListener('mousedown', () => {
    mouseDown = true;
  }, false);

  window.addEventListener('mouseup', () => {
    mouseDown = false;
  }, false);

  window.addEventListener('mousemove', event => {
    const { pageX: x, pageY: y } = event;
    mouseCoordinates = { x, y };