Exemplo n.º 1
0
 public PlayerGetter()
 {
     try
     {
         m_objTempDtls = new TemplateInfo();
         m_objCSceneReader = new CSceneReader();
     }
     catch (Exception ex)
     {
         LogWriter.WriteLog(ex);
     }
 }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
0
        private TemplateInfo Initialize(TemplateInfo info)
        {
            byte[] barrTypeData = null;
            byte[] barrType = null;
            XDocument xdHeaderXml = null;
            byte[] barrSceneDll = null;
            try
            {
                if (info.TemplateDetails != null && info.TemplateDetails.Keys.Count > 0)
                {
                    foreach (string skey in info.TemplateDetails.Keys)
                    {
                        switch (skey)
                        {
                            case CCommonConstants.FDDLL:
                                barrType = info.TemplateDetails[skey].Data;
                                break;
                            case CCommonConstants.CDLL:
                                barrTypeData = info.TemplateDetails[skey].Data;
                                break;
                            case CCommonConstants.XML:
                                byte[] barrData = info.TemplateDetails[skey].Data;
                                string sData = WaspEncoder.GetStringfromByte(barrData);
                                xdHeaderXml = XDocument.Parse(sData);
                                break;
                            case CCommonConstants.SCENEDLL:
                                barrSceneDll = info.TemplateDetails[skey].Data;
                                break;
                            case CCommonConstants.SGXML:
                                byte[] barrSGXml = info.TemplateDetails[skey].Data;
                                string sSGXml = WaspEncoder.GetStringfromByte(barrSGXml);
                                info.SgXml = sSGXml;
                                break;
                            case CCommonConstants.METADATAXML:
                                byte[] barrMetadataxml = info.TemplateDetails[skey].Data;
                                string sMetadataxml = WaspEncoder.GetStringfromByte(barrMetadataxml);
                                info.MetaDataXml = sMetadataxml;
                                break;
                            default:
                                break;
                        }
                    }
                    if (xdHeaderXml != null)
                    {
                        //checks whether given template is of unified type from header xml.
                        info.IsUnifiedForm = Unified(xdHeaderXml);
                        if (barrTypeData != null)
                        {
                            info.TemplatePlayerInfo = GetTypeFromAttachment(xdHeaderXml, barrTypeData, CCommonConstants.CDLL);
                        }
                        if (barrType != null)
                            info.TemplateDataInfo = GetTypeFromAttachment(xdHeaderXml, barrType, CCommonConstants.FDDLL);
                    }
                    if (string.Compare(info.Type, "tickersg", StringComparison.OrdinalIgnoreCase) == 0)
                        info.IsTicker = true;
                    else
                        info.IsTicker = false;

                    m_objTempDtls = info;
                }
            }
            catch (Exception ex)
            {
                LogWriter.WriteLog(ex);
            }

            return m_objTempDtls;
        }