Answers for "replaceTrack webrtc"

0

replaceTrack webrtc

navigator.mediaDevices.getUserMedia(media)
  .then(stream => {
    const tracks = stream.getTracks()

    peerConnection.getSenders()
      .forEach(sender => {
        const newTrack = tracks.find(track => track.kind === sender.track.kind)
        sender.replaceTrack(newTrack)
      })
  })
Posted by: Guest on November-11-2020

Browse Popular Code Answers by Language