MCPcopy Create free account
hub / github.com/Monibuca/engine / Attach

Method Attach

track/video.go:29–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func (v *Video) Attach() {
30 v.Info("attach video track", zap.Uint("width", v.Width), zap.Uint("height", v.Height))
31 if err := v.Publisher.GetStream().AddTrack(v).Await(); err != nil {
32 v.Error("attach video track failed", zap.Error(err))
33 } else {
34 v.Info("video track attached", zap.Uint("width", v.Width), zap.Uint("height", v.Height))
35 }
36}
37
38func (v *Video) Detach() {
39 v.Publisher.GetStream().RemoveTrack(v)

Callers 1

FlushMethod · 0.95

Calls 5

AwaitMethod · 0.80
InfoMethod · 0.65
AddTrackMethod · 0.65
GetStreamMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected