From f56bb07a6bee59e42806024e2c97ebe6e3c3fad2 Mon Sep 17 00:00:00 2001 From: David Colburn Date: Wed, 19 Jul 2023 22:22:27 -0700 Subject: [PATCH] return error for video over websocket --- pkg/errors/errors.go | 1 + pkg/pipeline/source/sdk.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/pkg/errors/errors.go b/pkg/errors/errors.go index b18469cf..7b85b3d4 100644 --- a/pkg/errors/errors.go +++ b/pkg/errors/errors.go @@ -18,6 +18,7 @@ var ( ErrNoCompatibleCodec = psrpc.NewErrorf(psrpc.InvalidArgument, "no supported codec is compatible with all outputs") ErrNoCompatibleFileOutputType = psrpc.NewErrorf(psrpc.InvalidArgument, "no supported file output type is compatible with the selected codecs") ErrResourceExhausted = psrpc.NewErrorf(psrpc.ResourceExhausted, "not enough CPU") + ErrVideoWebsocket = psrpc.NewErrorf(psrpc.InvalidArgument, "cannot send video over websocket") ) func New(err string) error { diff --git a/pkg/pipeline/source/sdk.go b/pkg/pipeline/source/sdk.go index 0fcb948b..6df12001 100644 --- a/pkg/pipeline/source/sdk.go +++ b/pkg/pipeline/source/sdk.go @@ -174,6 +174,11 @@ func (s *SDKSource) joinRoom(p *config.PipelineConfig) error { p.TrackKind = "audio" } else { p.TrackKind = "video" + // check for video over websocket + if p.Outputs[types.EgressTypeWebsocket] != nil { + onSubscribeErr = errors.ErrVideoWebsocket + return + } } p.TrackSource = strings.ToLower(pub.Source().String())