Ejemplo n.º 1
0
        public FormMain()
        {
            InitializeComponent();

            mainForm = this;

            // 主窗口设置
            WindowState = FormWindowState.Maximized;

            // 浏览器设置
            String mc_url = ConfigurationManager.AppSettings["MC_URL"];

            browser = new ChromiumWebBrowser(mc_url)
            {
                Dock = DockStyle.Fill,
            };
            browser.KeyboardHandler = new KeyboardHandler();

            this.Controls.Add(browser);

            // 视频播放管理对象
            nvrManager = new PlayerManager();

            // 实时播放Grid
            realPlayerGrid       = new RealPlayerGrid(nvrManager, 5, 1);
            realPlayerGrid.Dock  = DockStyle.Left;
            realPlayerGrid.Width = 300;
            this.Controls.Add(realPlayerGrid);

            // 播放Grid与NvrManager关联
            nvrManager.setCurrentRealPlayerGrid(realPlayerGrid);
            nvrManager.addRealPlayerGrid(realPlayerGrid);

            // 向浏览器注册对象
            browser.RegisterAsyncJsObject("videoPlayer", nvrManager);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 添加一个Grid
 /// </summary>
 /// <param name="grid"></param>
 public void addRealPlayerGrid(RealPlayerGrid grid)
 {
     this.realPlayerGrids.Add(grid);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 设置当前的播放Grid
 /// </summary>
 /// <param name="rpg"></param>
 public void setCurrentRealPlayerGrid(RealPlayerGrid rpg)
 {
     this.currentRealPlayerGrid = rpg;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 设置显示的容器和其他的值
 /// </summary>
 /// <param name="pr"></param>
 /// <param name="column"></param>
 /// <param name="row"></param>
 public void setGrid(RealPlayerGrid pr, int column, int row)
 {
     this.parentGrid = pr;
     this.column     = column;
     this.row        = row;
 }