Skip to content

Instantly share code, notes, and snippets.

@digitallysavvy
Last active May 13, 2020 22:32
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 digitallysavvy/1a391783aec22df4bf7d824d5e81ac94 to your computer and use it in GitHub Desktop.
Save digitallysavvy/1a391783aec22df4bf7d824d5e81ac94 to your computer and use it in GitHub Desktop.
A snippet for using an Agora video stream as the source for a video component.
function connectStreamToVideo(agoraStream, video) {
video.srcObject = agoraStream.stream;// add video stream to video element as source
video.onloadedmetadata = () => {
// ready to play video
video.play();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment