public int GetCurrentPosition()
{
if (this.CurrentStatus != MediaStatus.Stopped)
{
MediaPlayer.StandardInput.WriteLine("get_time_pos");
MediaPlayer.StandardInput.Flush();
// This is to give the HandleMediaPlayerOutputDataReceived enought time to process and set the currentPosition.
System.Threading.Thread.Sleep(100);
return this._currentPosition;
}
return -1;
}