Exemplo n.º 1
0
        public void LoadVideos()
        {
            try
            {
                var videoServer = new AppServerMgrProxy();
                //IAppServer iappServer = videoServer.CreateAppServer("","")
                //IMediaMgr mediaMgr = videoServer

                videoServer.SetHost("10.0.2.53");
                videoServer.SetUserCredentials("administrator", "adminK2", "", false);

                if (videoServer.Connect())
                {
                    Console.WriteLine("CONNECTED!!");
                }
                else
                {
                    Console.WriteLine("TOTAL FAIL =/");
                }

                videoServer.Disconnect();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public ClipPlayerServiceAgent()
        {
            videoServer = new AppServerMgrProxy();
            videoServer.SetHost(ConfigurationManager.AppSettings["K2Ip"]);
            videoServer.SetUserCredentials(ConfigurationManager.AppSettings["K2UserName"],
                                           ConfigurationManager.AppSettings["K2Password"], "", false);

            if (!videoServer.Connect())
            {
                Console.WriteLine("*** Cannot connect to the K2 ***");
                return;
            }

            appName = "RCS.K2.NFLN";
            client  = "Client 1";

            bool newConnection = false;

            iappServer = videoServer.CreateAppServer(appName, client, out newConnection);

            bool isNewController = false;

            icontroller = iappServer.CreateController(appName, "C1", out isNewController);
            player      = (ISimplePlayerRecorder)icontroller;

            using (var sql = new NFLLookupEntities())
            {
                Videos = new List <VideoClip>(sql.VideoClips);
            }
        }