private void OnVideoPlayerPrepared(object sender, EventArgs e)
 {
     model.IsPrepared = true;
     SetBusy(false);
     model.Duration        = TimeSpan.FromMilliseconds(nativePlayer.Duration);
     model.CurrentPosition = TimeSpan.Zero;
     model.DisplaySeekbar  = true;
     Prepared?.Invoke(this, EventArgs.Empty);
     if (Mute)
     {
         model.IsMute = true;
         SetVolume();
     }
     else
     {
         model.IsMute = false;
         SetVolume();
     }
     if (AutoPlay)
     {
         model.IsPlaying  = true;
         model.IsPrepared = true;
         nativePlayer.Play();
     }
 }
Exemple #2
0
        public void Show(string path)
        {
            Show();
            var    wih  = new WindowInteropHelper(this);
            IntPtr hwnd = wih.Handle;

            _playerIntPtr = NativePlayer.GetRtspPlayer(path, null, null, null, 10000, hwnd);
            if (_playerIntPtr != IntPtr.Zero)
            {
                //ShowFfmpeg(path);
                NativePlayer.Play(_playerIntPtr);
            }
            else
            {
                Close();
            }
        }