updated cli to v3

This commit is contained in:
David Zhao
2020-12-12 22:07:06 -08:00
parent 7d7787590c
commit 4c9623bb49
4 changed files with 54 additions and 60 deletions
+4 -4
View File
@@ -81,10 +81,10 @@ func joinRoom(c *cli.Context) error {
audioFile := c.String("audio")
videoFile := c.String("video")
if audioFile != "" {
rc.AddTrack(audioFile, webrtc.RTPCodecTypeAudio, "audio", filepath.Base(audioFile))
rc.AddTrack(audioFile, "audio", filepath.Base(audioFile))
}
if videoFile != "" {
rc.AddTrack(videoFile, webrtc.RTPCodecTypeVideo, "video", filepath.Base(videoFile))
rc.AddTrack(videoFile, "video", filepath.Base(videoFile))
}
// start loop to detect input
@@ -171,7 +171,7 @@ func handleAddMedia(rc *client.RTCClient, isAudio bool) error {
mediaPath = ExpandUser(mediaPath)
// TODO: see what the ID should be
err = rc.AddTrack(mediaPath, codecType, codecType.String(), filepath.Base(mediaPath))
err = rc.AddTrack(mediaPath, codecType.String(), filepath.Base(mediaPath))
if err != nil {
return err
}
@@ -189,7 +189,7 @@ func handleAddMedia(rc *client.RTCClient, isAudio bool) error {
audioPath := mediaPath[0:len(mediaPath)-len(videoExt)] + ".ogg"
if _, err = os.Stat(audioPath); err == nil {
err = rc.AddTrack(audioPath, webrtc.RTPCodecTypeAudio, codecType.String(), filepath.Base(audioPath))
err = rc.AddTrack(audioPath, codecType.String(), filepath.Base(audioPath))
if err != nil {
fmt.Printf("added audio track: %s\n", audioPath)
}