From 230de6f4d7ae284deff8ecf461ff7114c0d087df Mon Sep 17 00:00:00 2001 From: Long Tang Date: Fri, 18 Aug 2017 00:08:38 -0700 Subject: [PATCH] Fixed #243 --- .../Video/VideoPlayerImplementation.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/MediaManager.Android/Video/VideoPlayerImplementation.cs b/MediaManager.Android/Video/VideoPlayerImplementation.cs index 868a8474..10c3fd68 100644 --- a/MediaManager.Android/Video/VideoPlayerImplementation.cs +++ b/MediaManager.Android/Video/VideoPlayerImplementation.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using Android.Media; @@ -234,10 +234,11 @@ public async Task Play(IMediaFile mediaFile = null) if (Status == MediaPlayerStatus.Paused) { - //We are simply paused so just continue - VideoViewCanvas.SeekTo(lastPosition); - VideoViewCanvas.Start(); - Status = MediaPlayerStatus.Playing; + //We are simply paused so just continue + VideoViewCanvas.SeekTo(lastPosition); + VideoViewCanvas.Start(); + + Status = MediaPlayerStatus.Playing; return; } @@ -255,7 +256,10 @@ public async Task Play(IMediaFile mediaFile = null) public async Task Seek(TimeSpan position) { - VideoViewCanvas.SeekTo(Convert.ToInt32(position.TotalMilliseconds)); + int msec = Convert.ToInt32(position.TotalMilliseconds); + VideoViewCanvas.SeekTo(msec); + lastPosition = VideoViewCanvas.CurrentPosition; + await Task.CompletedTask; }