Skip to content

Instantly share code, notes, and snippets.

@enricop89
Created February 3, 2021 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enricop89/7cf017fa87ac33a09650bf0cfd7e81f0 to your computer and use it in GitHub Desktop.
Save enricop89/7cf017fa87ac33a09650bf0cfd7e81f0 to your computer and use it in GitHub Desktop.
Screensharing with audio from Mic
const publish = Promise.all([
OT.getUserMedia({
videoSource: 'screen'
}),
OT.getUserMedia({
videoSource: null
})
])
.then(([screenStream, micStream]) => {
return OT.initPublisher(null, {
videoSource: screenStream.getVideoTracks()[0],
audioSource: micStream.getAudioTracks()[0]
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment