Example #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);
        }
Example #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);
        }
Example #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);
 }
Example #4
0
 public string GetState(WPFVideoHostControl player)
 {
     return DoCommand(player);
 }
Example #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);
 }
Example #6
0
 public abstract string DoCommand(WPFVideoHostControl player, params string[] parameters);