Skip to content

Commit

Permalink
return error for video over websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Jul 20, 2023
1 parent d5c0ca1 commit f56bb07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions pkg/pipeline/source/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())

Expand Down

0 comments on commit f56bb07

Please sign in to comment.