Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

220
Views
Twilio DataTrack API stop?

So I'm creating a simple zoom clone app and got an issue with the DataTrack API.

Initialized DataTrack

this.dataTrack = new LocalDataTrack();

The issue is that after leaving/disconnecting in the room the record Icon in the browser is still there.

LeaveRoom func

this.room.localParticipant.videoTracks.forEach((publication) => {
   publication.track.stop();
   publication.unpublish();
});

console.log("this.dataTrack", this.dataTrack); // HOW TO STOP THIS ?
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

The LocalDataTrack object has an id property.

You can get the MediaStreamTrack by looking up the media stream tracks from the media streams.

const userMedia = navigator.mediaDevices.getUserMedia({video:true, audio:true});

const tracks = userMedia.then(mediaStreams => {
     const tracks = mediaStreams.getTracks();
     for(let track of tracks) {
         if(track.id === this.dataTrack.id) {
              track.stop();
         }
     }
});
about 4 years ago · Juan Pablo Isaza Report

0

These are the 3 I do. Works like a charm.

//Remove chromes "your browser is using the camera" icon
track.forEach((track) => track.stop())
room.localParticipant.unpublishTracks(track)
track.forEach((track) => track.detach())
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!