steep-balloon-41261
02/06/2023, 11:48 AMfancy-wire-61616
02/06/2023, 1:14 PMremoteTrack.track.mediaStream
Should I keep using this or create a new stream and add remoteTrack.track.mediaStreamTrack to it.”
Is that okay to use like that?bright-tiger-35509
02/06/2023, 1:18 PMpolite-kilobyte-67570
02/06/2023, 2:05 PMtrack.attach(mediaElement) function? that’s our recommended way of displaying the trackbright-tiger-35509
02/06/2023, 2:05 PMpolite-kilobyte-67570
02/06/2023, 2:06 PMtrack.mediaStream should be finepolite-kilobyte-67570
02/06/2023, 2:07 PMtrack.attach? just curious to know your use casebright-tiger-35509
02/06/2023, 2:08 PMremoteTrack.setSubscribed(true);
remoteTrack.track.mediaStream is sometimes undefinedbright-tiger-35509
02/06/2023, 2:09 PMpolite-kilobyte-67570
02/06/2023, 2:10 PMRoomEvent.TrackSubscribed the mediastream should be availablefancy-wire-61616
02/07/2023, 5:02 AMbright-tiger-35509
02/07/2023, 6:10 AMconst screenPubOptions = {
simulcast: true,
screenShareSimulcastLayers: [
new VideoPreset(Math.min(1920, trackWidth), Math.min(1080, trackHeight), 600_000, 5),
new VideoPreset(Math.min(1280, trackWidth), Math.min(720, trackHeight), 400_000, 5),
],
source: Track.Source.ScreenShare,
};
await room.localParticipant.publishTrack(track, screenPubOptions);
and when they stop sharing screen I do
await room.localParticipant.setScreenShareEnabled(false);bright-tiger-35509
02/07/2023, 8:13 AMError: publication of local track timed out, no response from server
3. The publisher gains back best network and is no longer publishing screenshare, I get this log on publisher side TypeError: Cannot destructure property 'resolve' of 'this.pendingTrackResolvers[e.cid]' as it is undefined.
4. On the subscriber side even if I refresh on good network, I get the old stale screenshare track which is black, in fact every subscriber gets this stale screenshare track.
5. Now even if the publisher publishes new screenshare track and unpublishes it, the stale old track always stays.bright-tiger-35509
02/07/2023, 10:05 AMremoteTrack.track.mediaStream.getVideoTracks()
1. MediaStreamTrack {kind: 'video', id: 'TR_VSNUn9AqW8XzTv', label: 'TR_VSNUn9AqW8XzTv', enabled: false, muted: false, …}
2. MediaStreamTrack {kind: 'video', id: 'TR_VCJigkSkb2ziU3', label: 'TR_VCJigkSkb2ziU3', enabled: true, muted: false, …}polite-kilobyte-67570
02/07/2023, 11:48 AMTrackSubscribed event.
There’s a difference in how screen share and camera/microphone are handled.
A screen share will actually be unpublished when calling setScreenShareDisabled so the mediastream might change.
microphone and camera “only” get muted when calling setCamera/MicrophoneEnabled so you’re less likely to see a problem there
I understand that there might be bigger things involved on the implementation change, but I guess you’ll run into less issues if you adapt a workflow that’s based on what our examples do (e.g. using track.attach).bright-tiger-35509
02/07/2023, 1:08 PMbright-tiger-35509
02/07/2023, 1:09 PMbright-tiger-35509
02/07/2023, 1:09 PMpolite-kilobyte-67570
02/07/2023, 2:52 PM