Video track identity

edited June 7 in Video & WebRTC

I'm building a twilio electron app for screen control. I started with video quickstart, modified it for electron app. When i capture screen, the requirement is to open a new window on the remote machine(on which the subscribed video track is played) for control.
I need to identify this shared screen track for the remote machine to recognize and open a new window. Hence when i publish the track i set the identity to a unique name and expect at the subscriber routine to identify the track. However it doesn't work. I tried setting strings on track id/name/identity .. none of them works. Can you please tell me what i should use to identify a track on publish/subscribe routines.




  • dtoomey
    dtoomey admin

    The following code sample should allow you to name your screenshare video track. Just replace 'myscreenshare' with whatever name you want to use.

    const { connect, LocalVideoTrack } = require('twilio-video');
    const stream = await navigator.mediaDevices.getDisplayMedia({ video: { frameRate: 15 } });
    const screenTrack = new LocalVideoTrack(stream.getTracks()[0], {name:'myscreenshare'});
  • Thank you! i had tried setting'myscreenshare' wasn't working. Will check this.

Sign In or Register to comment.