KumailR
KumailR

Reputation: 505

What is the difference between the two ways of 'trackSubscribed'?

What is the difference between these two ways and also which is the better way? Or both to be used?

bind on room: (as per the quickstart app)

  room.on('trackSubscribed', function(track, publication, participant) => {
  });

bind on participants: (as per the README.md git-repo)

  room.on('participantConnected', function(participant) {
    participant.on('trackSubscribed', track => trackSubscribed(div, track));
  });

Upvotes: 1

Views: 236

Answers (1)

philnash
philnash

Reputation: 73065

Twilio developer evangelist here.

Both can be used. It depends on your preference. 🙂

Upvotes: 1

Related Questions