Add scale transform to screenshare example

This commit is contained in:
Atsushi Watanabe
2020-02-15 18:29:26 +09:00
parent ad686605e1
commit 4e3ebb554f

View File

@@ -9,6 +9,7 @@ import (
_ "github.com/pion/mediadevices/pkg/codec/opus" // This is required to register opus audio encoder
_ "github.com/pion/mediadevices/pkg/codec/vpx" // This is required to register VP8/VP9 video encoder
_ "github.com/pion/mediadevices/pkg/driver/screen" // This is required to register screen capture adapter
"github.com/pion/mediadevices/pkg/io/video"
"github.com/pion/webrtc/v2"
)
@@ -52,9 +53,8 @@ func main() {
Video: func(c *mediadevices.MediaTrackConstraints) {
c.CodecName = videoCodecName
c.Enabled = true
c.Width = 640
c.Height = 480
c.BitRate = 100000 // 100kbps
c.VideoTransform = video.Scale(640, 480, nil)
},
})
if err != nil {