binding to buffer and correctly forwarding

This commit is contained in:
David Zhao
2021-01-10 16:18:58 -08:00
parent 258f5add2d
commit 7dcb88343a
18 changed files with 751 additions and 338 deletions
+8 -5
View File
@@ -112,11 +112,14 @@ func joinRoom(c *cli.Context) error {
// add tracks if needed
audioFile := c.String("audio")
videoFile := c.String("video")
if audioFile != "" {
rc.AddTrack(audioFile, "audio", filepath.Base(audioFile))
}
if videoFile != "" {
rc.AddTrack(videoFile, "video", filepath.Base(videoFile))
rc.OnConnected = func() {
// add after connection, since we need proper publish track APIs
if audioFile != "" {
rc.AddTrack(audioFile, "audio", filepath.Base(audioFile))
}
if videoFile != "" {
rc.AddTrack(videoFile, "video", filepath.Base(videoFile))
}
}
// start loop to detect input