Last active
May 13, 2020 22:32
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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