//------------------------------------------------------------------------------------------------------------------------ public bool serverNegotiation(Yodiwo.YPChannel.Channel channel) { //requires authentication var resp = channel.SendRequest<VideoAuthenticationResponse>(new VideoAuthenticationRequest()); if (resp == null) return false; else { //handle response if (!videofeeds.ContainsKey(resp.videotoken)) return false; else { //create context var ctx = new ChannelContext() { videoInfo = videofeeds[resp.videotoken], }; channel.Tags.Add(typeof(ChannelContext), ctx); ctx.Receiving = true; return true; } } }
//------------------------------------------------------------------------------------------------------------------------ public void serverChannel_OnOpenEvent(Yodiwo.YPChannel.Channel channel) { DebugEx.TraceLog("A mjpeg recorder has been connected to me"); Task.Run(() => { var req = new VideoDataReq() { vflow = VideoFlow.Start }; channel.SendRequest(req); }); }
//------------------------------------------------------------------------------------------------------------------------ public bool serverNegotiation(Yodiwo.YPChannel.Channel channel) { var resp = channel.SendRequest<AudioAuthenticationResponse>(new AudioAuthenticationRequest()); if (resp == null) return false; else { //handle response if (!audiopipes.ContainsKey(resp.audiotoken)) return false; else { //create context var ctx = new ChannelContext() { audioInfo = audiopipes[resp.audiotoken], }; channel.Tags.Add(typeof(ChannelContext), ctx); ctx.Receiving = true; return true; } } }