示例#1
0
        protected override void OnLoad(EventArgs e)
        {
            _control = new WPFVideoHostControl();
            this.Controls.Add(_control);
            _control.OnFailed += new EventHandler(_control_OnFailed);
            _control.OnOpened += new EventHandler(_control_OnOpened);
            StartPlay(FileName);

            //player = new WindowsMediaPlayerClass();
            //player.enableErrorDialogs = false;
            //player.mute = true;
            //player.settings.enableErrorDialogs = false;
            //StartPlay(FileName);
            //base.OnLoad(e);
        }
示例#2
0
        //public override string GetCommand
        //{
        //    get { return _command; }
        //}

        public override string DoCommand(WPFVideoHostControl player, params string[] parameters)
        {
            player.Play();
            return StateCommand.Instance.GetState(player);
        }
示例#3
0
 public override string DoCommand(WPFVideoHostControl player, params string[] parameters)
 {
     PlayerStatus playerStatus;
     int currentPosition;
     switch (player.State)
     {
         case WPFVideoHostControl.PlayState.Paused:
         case WPFVideoHostControl.PlayState.Stoped:
             playerStatus = PlayerStatus.Paused;
             break;
         case WPFVideoHostControl.PlayState.Played:
             playerStatus = PlayerStatus.Played;
             break;
         default:
             playerStatus = PlayerStatus.Unknown;
             break;
     }
     if (playerStatus != PlayerStatus.Unknown)
     {
         currentPosition = player.CurrentPosition;
     }
     else
     {
         currentPosition = 0;
     }
     return string.Format("{0}{1}{2}",
         playerStatus, _internalDelimeter, currentPosition);
 }
示例#4
0
 public string GetState(WPFVideoHostControl player)
 {
     return DoCommand(player);
 }
示例#5
0
 public override string DoCommand(WPFVideoHostControl player, params string[] parameters)
 {
     string[] commands = parameters[0].Split(_commandDelimeter);
     player.CurrentPosition = Int32.Parse(commands[1]);     // _seconds;
     return StateCommand.Instance.GetState(player);
 }
示例#6
0
 public abstract string DoCommand(WPFVideoHostControl player, params string[] parameters);