-
-
Save murillo128/77d6c8d6a860aedae6ac883d8543d897 to your computer and use it in GitHub Desktop.
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
//Create a new instance | |
const millicastView = new View(streamName, tokenGenerator, video) | |
//Start connection to publisher | |
await millicastView.connect({ | |
events: ["active", "inactive", "vad", "layers"] | |
}) | |
millicastView.on("broadcastEvent", (event) => | |
{ | |
//Get event name and data | |
const { name, data } = event; | |
switch (name) | |
{ | |
case "active": | |
//A source has been started on the steam | |
break; | |
case "inactive": | |
//A source has been stopped on the steam | |
break; | |
case "vad": | |
//A new source was multiplexed over the vad tracks | |
break; | |
case "layers": | |
//Updated layer information for each simulcast/svc video track | |
break; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment