Add codec property

Add codec property, which stores general encoding parameters,
to MediaTrackConstraints.
This commit is contained in:
Atsushi Watanabe
2020-02-10 23:15:29 +09:00
committed by Lukas Herman
parent 1e868fc3e3
commit 00bcadc238
8 changed files with 48 additions and 15 deletions

View File

@@ -52,6 +52,7 @@ func main() {
Audio: func(c *mediadevices.MediaTrackConstraints) {
c.Codec = webrtc.Opus
c.Enabled = true
c.BitRate = 32000 // 32kbps
},
Video: func(c *mediadevices.MediaTrackConstraints) {
c.Codec = videoCodecName
@@ -59,6 +60,7 @@ func main() {
c.Enabled = true
c.Width = 640
c.Height = 480
c.BitRate = 100000 // 100kbps
},
})
if err != nil {