Пример #1
0
        public void InitCurrentFileType(PlayFileType fileType)
        {
            xSelectedBitrateTextBlock.Tag  = fileType;
            xSelectedBitrateTextBlock.Text = fileType.CreateString();
            switch (fileType)
            {
            case PlayFileType.Smooth:
                xSmoothTextBlock.Foreground = _selectedBitRateBrush;
                xSuperTextBlock.Foreground  = xHighTextBlock.Foreground = _unSelectBitRateBrush;
                break;

            case PlayFileType.HD:
                xHighTextBlock.Foreground  = _selectedBitRateBrush;
                xSuperTextBlock.Foreground = xSmoothTextBlock.Foreground = _unSelectBitRateBrush;
                break;

            case PlayFileType.SuperHD:
                xSuperTextBlock.Foreground = _selectedBitRateBrush;
                xHighTextBlock.Foreground  = xSmoothTextBlock.Foreground = _unSelectBitRateBrush;
                break;

            default:
                break;
            }
        }
Пример #2
0
        public string CreatePlayUri(PlayFileType ft = PlayFileType.HD)
        {
            if (PlayInfos != null && PlayInfos.Count > 0)
            {
                var ftype = (int)ft;
                while (!PlayInfos.ContainsKey(ftype) && ftype >= 0)
                {
                    ftype--;
                }

                PlayInfo info = null;
                if (ftype < 0)
                {
                    info = PlayInfos.Values.First();
                }
                else if (PlayInfos.ContainsKey(ftype))
                {
                    info = PlayInfos[ftype];
                }

                if (info != null)
                {
                    return(GetPlayUri(info));
                }
            }
            return(string.Empty);
        }
Пример #3
0
        public string CreatePlayUri(PlayFileType ft = PlayFileType.HD)
        {
            if (PlayInfos != null && PlayInfos.Count > 0)
            {
                var ftype = (int)ft;
                while (!PlayInfos.ContainsKey(ftype) && ftype >= 0)
                {
                    ftype--;
                }

                PlayInfo info = null;
                if (ftype < 0)
                {
                    info = PlayInfos.Values.First();
                }
                else if (PlayInfos.ContainsKey(ftype))
                {
                    info = PlayInfos[ftype];
                }

                if (info != null)
                {
                    var key = KeyGenerator.GetKey(info.St);
                    return(string.Format("http://{0}:80/{1}?type={2}&w=1&key={3}", info.Sh, info.Rid, Utils.EpgUtils.PlatformName, key));
                }
            }
            return(string.Empty);
        }
Пример #4
0
        public override void BtirateSelect(PlayFileType fileType)
        {
            _playFileType = fileType;
            _playMessage.StartPosition = (int)_mediaPlayer.Position.TotalSeconds;

            var item = _playInfoFactory.CreatePlayInfo(_playFileType);

            if (item != null)
            {
                Play(item);
            }
        }
Пример #5
0
        public PlayVodFactory(PlayInfoHelp playInfo)
        {
            _playFileType = PlayFileType.HD;
            _playInfo = playInfo;

            _channelDetailFactory = new ChannelDetailFactory();
            _channelDetailFactory.HttpSucessHandler += _channelDetailFactory_HttpSucceed;
            _channelDetailFactory.HttpFailorTimeOut += httpHandler_HttpTimeoutorFail;

            _playInfoFactory = new Play2InfoFactory();
            _playInfoFactory.HttpSucessHandler += _playInfoFactory_HttpSucceed;
            _playInfoFactory.HttpFailorTimeOut = httpHandler_HttpTimeoutorFail;
        }
Пример #6
0
        public PlayVodFactory(object parameter)
        {
            _playFileType = PlayFileType.HD;
            _playInfo     = parameter as PlayInfoHelp;

            _channelDetailFactory = new ChannelDetailFactory();
            _channelDetailFactory.HttpSucessHandler += _channelDetailFactory_HttpSucceed;
            _channelDetailFactory.HttpFailorTimeOut += httpHandler_HttpTimeoutorFail;

            _playInfoFactory = new Play2InfoFactory();
            _playInfoFactory.HttpSucessHandler += _playInfoFactory_HttpSucceed;
            _playInfoFactory.HttpFailorTimeOut  = httpHandler_HttpTimeoutorFail;
        }
Пример #7
0
        public static string CreateString(this PlayFileType fileType)
        {
            switch (fileType)
            {
            case PlayFileType.Smooth:
                return("流畅");

            case PlayFileType.HD:
                return("高清");

            case PlayFileType.SuperHD:
                return("超清");

            default:
                return(string.Empty);
            }
        }
Пример #8
0
        public PlayInfo CreatePlayInfo(PlayFileType ft = PlayFileType.HD)
        {
            if (PlayInfos != null && PlayInfos.Count > 0)
            {
                var ftype = (int)ft;
                while (!PlayInfos.ContainsKey(ftype) && ftype >= 0)
                {
                    ftype--;
                }

                if (ftype < 0)
                {
                    return(PlayInfos.Values.First());
                }

                if (PlayInfos.ContainsKey(ftype))
                {
                    return(PlayInfos[ftype]);
                }
            }
            return(null);
        }
Пример #9
0
 public virtual void BtirateSelect(PlayFileType fileType)
 {
 }
Пример #10
0
 public virtual void BtirateSelect(PlayFileType fileType)
 {
 }
Пример #11
0
 public void InitCurrentFileType(PlayFileType fileType)
 {
     xSelectedBitrateTextBlock.Tag = fileType;
     xSelectedBitrateTextBlock.Text = fileType.CreateString();
     switch (fileType)
     {
         case PlayFileType.Smooth:
             xSmoothTextBlock.Foreground = _selectedBitRateBrush;
             xSuperTextBlock.Foreground = xHighTextBlock.Foreground = _unSelectBitRateBrush;
             break;
         case PlayFileType.HD:
             xHighTextBlock.Foreground = _selectedBitRateBrush;
             xSuperTextBlock.Foreground = xSmoothTextBlock.Foreground = _unSelectBitRateBrush;
             break;
         case PlayFileType.SuperHD:
             xSuperTextBlock.Foreground = _selectedBitRateBrush;
             xHighTextBlock.Foreground = xSmoothTextBlock.Foreground = _unSelectBitRateBrush;
             break;
         default:
             break;
     }
 }
Пример #12
0
        public override void BtirateSelect(PlayFileType fileType)
        {
            _playFileType = fileType;
            _playMessage.StartPosition = (int)_mediaPlayer.Position.TotalSeconds;

            var item = _playInfoFactory.CreatePlayInfo(_playFileType);
            if (item != null)
                Play(item);
        }
Пример #13
0
 void xPlayerControler_BitrateChanged(object sender, PlayFileType fileType)
 {
     SetControlerState(false, true);
     _playFactory.BtirateSelect(fileType);
 }
Пример #14
0
 void xPlayerControler_BitrateChanged(object sender, PlayFileType fileType)
 {
     SetControlerState(false, true);
     _playFactory.BtirateSelect(fileType);
 }