예제 #1
0
        /// <summary>
        /// Load background template
        /// </summary>
        /// <param name="templateid"></param>
        public void LoadBackground(TemplateInfo tempinfo, string id)
        {
            try
            {
                objBGPlayer = Activator.CreateInstance(tempinfo.TemplatePlayerInfo) as IPlayer;
                if (objBGPlayer != null)
                {
                    objBGPlayer.Init("", "", id, "");
                    objBGPlayer.SetLink(AppLink, tempinfo.MetaDataXml);
                    if (objBGPlayer is IAddinInfo)
                    {
                        (objBGPlayer as IAddinInfo).Init(new InstanceInfo()
                        {
                            InstanceId = id
                        });
                    }

                    IChannelShotBox objChannelShotBox = objBGPlayer as IChannelShotBox;
                    if (objChannelShotBox != null)
                    {
                        objChannelShotBox.SetEngineUrl(m_serverurl);
                    }
                    objBGPlayer.OnShotBoxStatus           += objPlayer1_OnShotBoxStatus;
                    objBGPlayer.OnShotBoxControllerStatus += objPlayer1_OnShotBoxStatus;
                    objBGPlayer.Prepare(m_serverurl, 0, string.Empty, RENDERMODE.PROGRAM);
                }
            }
            catch (Exception ex)
            {
                LogWriter.WriteLog(ex); WriteTrace(ex.ToString());
            }
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        private void LoadTemplate()
        {
            try
            {
                string           templateid = ConfigurationManager.AppSettings["scorebugid"];
                STemplateDetails obj        = FileHandler.GetTemplatePlayerInfo(templateid, "");
                if (obj != null)
                {
                    objScorePlayer = Activator.CreateInstance(obj.TemplatePlayerInfo) as IPlayer;
                    if (objScorePlayer != null)
                    {
                        objScorePlayer.Init("", "", templateid, "");
                        objScorePlayer.SetLink(AppLink, obj.Scene);
                        if (objScorePlayer is IAddinInfo)
                        {
                            (objScorePlayer as IAddinInfo).Init(new InstanceInfo()
                            {
                                InstanceId = templateid
                            });
                        }

                        IChannelShotBox objChannelShotBox = objScorePlayer as IChannelShotBox;
                        if (objChannelShotBox != null)
                        {
                            objChannelShotBox.SetEngineUrl(m_serverip);
                        }

                        objScorePlayer.OnShotBoxControllerStatus += _objPlayer1_OnShotBoxControllerStatus;
                        objScorePlayer.OnShotBoxStatus           += _objPlayer1_OnShotBoxStatus;
                        objScorePlayer.Prepare(m_serverip, Convert.ToInt32(objScorePlayer.ZORDER), string.Empty, RENDERMODE.PROGRAM);
                    }
                }
            }
            catch (Exception ex)
            {
            }
        }