Closed iaptsiauri closed 7 years ago
Hi @iaptsiauri,
We'll look into this to see if it is a bug or not. You should be able to iterate over participant.media.mediaStreams
; however, you must iterate once Tracks have been added. Initially, the media
may be "empty", i.e. contain no Tracks, which would imply there are no MediaStreams either.
One thing you can try is to gate your code on the "trackAdded" event, e.g.
participant.media.once('trackAdded', () => {
console.log(participant.media.mediaStreams.size);
// => should be at least 1 now
});
or, similarly,
participant.media.once('trackAdded', track => {
// Log stream
console.log(track.mediaStream);
});
Best, Mark
Hi @markandrus Thanks, for the suggestion. Will use that approach at the moment and looking forward for the updates on this matter 👍
Hi @iaptsiauri,
We do not believe this is a bug—it is possible that a Participant initially connects and your application has not yet received any Tracks from them. Instead, they must be listened for via the "trackAdded" event.
Hello, As an initial setup I took the Ruby getting started application which uses the twillio video 1.0.0-beta2 version, as the remote participant connects to the room, the media is attached properly and is visible on the webpage, but what I want to achieve is to iterate other the
participant.media.mediaStreams
which appears to be empty.