//------------------------------------------------------------------------------------------------------------------------ public SimpleActionResult Connect(string server, string videotoken, int Port = 5969, bool SecureYPC = false) { //start a YPclient DebugEx.TraceLog("Connect mic client to mic server"); this.videotoken = videotoken; //create protocol var proto = new YPChannel.Protocol() { Version = 1, ProtocolDefinitions = new List <Protocol.MessageTypeGroup>() { new Protocol.MessageTypeGroup() { GroupName = Yodiwo.API.MediaStreaming.Video.ApiGroupName, MessageTypes = Yodiwo.API.MediaStreaming.Video.ApiMessages } }, }; //create channel yclient = new Yodiwo.YPChannel.Transport.Sockets.Client(proto) { Name = "VideoMediaClient" }; yclient.OnMessageReceived += clientOnMessageReceived; return(yclient.Connect(server, Port, SecureYPC, "*.yodiwo.com")); }
//------------------------------------------------------------------------------------------------------------------------ #endregion #region Functions //------------------------------------------------------------------------------------------------------------------------ public void connect(string server, string audiotoken, int Port = 6517, bool SecureYPC = false) { //start a YPclient DebugEx.TraceLog("Connect mic client to mic server"); this.audiotoken = audiotoken; //create protocol var proto = new YPChannel.Protocol() { Version = 1, ProtocolDefinitions = new List <Protocol.MessageTypeGroup>() { new Protocol.MessageTypeGroup() { GroupName = Yodiwo.API.MediaStreaming.Audio.ApiGroupName, MessageTypes = Yodiwo.API.MediaStreaming.Audio.ApiMessages } }, }; //create channel yclient = new Yodiwo.YPChannel.Transport.Sockets.Client(proto) { Name = "AudioMediaClient" }; yclient.OnMessageReceived += clientOnMessageReceived; yclient.Connect(server, Port, SecureYPC); }
//------------------------------------------------------------------------------------------------------------------------ public void startServer(X509Certificate2 certificate = null) { //start mp3 server DebugEx.TraceLog("start YP server for mp3 server ...."); //create protocol var proto = new YPChannel.Protocol() { Version = 1, ProtocolDefinitions = new List <YPChannel.Protocol.MessageTypeGroup>() { new YPChannel.Protocol.MessageTypeGroup() { GroupName = Yodiwo.API.MediaStreaming.Audio.ApiGroupName, MessageTypes = Yodiwo.API.MediaStreaming.Audio.ApiMessages } }, }; //create server server = new Yodiwo.YPChannel.Transport.Sockets.Server(proto); server.OnNewChannel += (_server, channel) => { channel.Name = "YMp3Server"; channel.NegotiationHandler = serverNegotiation; channel.OnOpenEvent += this.serverChannel_OnOpenEvent; channel.OnMessageReceived += this.serverOnMessageReceived; }; server.Start(this.YPort, certificate: certificate); }
//------------------------------------------------------------------------------------------------------------------------ #endregion #region Functions //------------------------------------------------------------------------------------------------------------------------ public void Start(X509Certificate2 certificate) { //start sip server DebugEx.TraceLog("start yp server for mjpeg streaming ...."); //create protocol var proto = new YPChannel.Protocol() { Version = 1, ProtocolDefinitions = new List<YPChannel.Protocol.MessageTypeGroup>() { new YPChannel.Protocol.MessageTypeGroup() {GroupName=Yodiwo.API.MediaStreaming.Video.ApiGroupName, MessageTypes=Yodiwo.API.MediaStreaming.Video.ApiMessages } }, }; //create server server = new Yodiwo.YPChannel.Transport.Sockets.Server(proto); server.OnNewChannel += (_server, channel) => { channel.Name = "YPMjegServer"; channel.NegotiationHandler = serverNegotiation; channel.OnOpenEvent += this.serverChannel_OnOpenEvent; channel.OnMessageReceived += this.serverOnMessageReceived; }; //start ypserver server.Start(this.YPort, certificate: certificate); }
//------------------------------------------------------------------------------------------------------------------------ public SimpleActionResult Connect(string server, string videotoken, int Port = 5969, bool SecureYPC = false) { //start a YPclient DebugEx.TraceLog("Connect mic client to mic server"); this.videotoken = videotoken; //create protocol var proto = new YPChannel.Protocol() { Version = 1, ProtocolDefinitions = new List<Protocol.MessageTypeGroup>() { new Protocol.MessageTypeGroup() {GroupName=Yodiwo.API.MediaStreaming.Video.ApiGroupName, MessageTypes=Yodiwo.API.MediaStreaming.Video.ApiMessages } }, }; //create channel yclient = new Yodiwo.YPChannel.Transport.Sockets.Client(proto) { Name = "VideoMediaClient" }; yclient.OnMessageReceived += clientOnMessageReceived; return yclient.Connect(server, Port, SecureYPC, "*.yodiwo.com"); }