diff --git a/janus-gateway/README.md b/janus-gateway/README.md index 5e84450d..9b63e974 100644 --- a/janus-gateway/README.md +++ b/janus-gateway/README.md @@ -27,7 +27,7 @@ This example demonstrates how to stream to a Janus video-room using pion-WebRTC run `main.go` in `github.com/pions/webrtc/examples/janus-gateway/video-room` OSX -```sh +```sh brew install pkg-config https://gstreamer.freedesktop.org/data/pkg/osx/ diff --git a/janus-gateway/video-room/main.go b/janus-gateway/video-room/main.go index 186df458..912c34cc 100644 --- a/janus-gateway/video-room/main.go +++ b/janus-gateway/video-room/main.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "math/rand" + "time" janus "github.com/notedit/janus-go" "github.com/pions/webrtc" @@ -99,6 +100,16 @@ func main() { panic(err) } + go func() { + for { + if _, keepAliveErr := session.KeepAlive(); err != nil { + panic(keepAliveErr) + } + + time.Sleep(5 * time.Second) + } + }() + go watchHandle(handle) _, err = handle.Message(map[string]interface{}{