This project has moved. For the latest updates, please go here.
1
Vote

Not show remaining time

description

Hello,

It is a very weird issue. You can easily reproduce this issue by setting source of MediaPlayer by:
  • removed -
(Note that the above source url will be expired soon. In this case, please comment and I will provide new source url.)

MediaPlayer did not show remaining time and the timeline bar was not scrollable .

Please help me to solve this issue.

Thank you in advance!

comments

henric wrote Jan 23, 2016 at 5:19 AM

This will happen if phonesm has trouble finding the duration of the stream. For HLS, this means sane durations on all the segments and a #EXT-X-ENDLIST tag.

If you take a look in the debug Output window when playing the stream, do you see any errors or warnings?

(I saw this issue too late to grab a copy, but perhaps you could attach or PM a copy of the stream .m3u8?)

lionpham wrote Jan 25, 2016 at 5:17 AM

Hi henric,

I pm you with the new source url.

Please check you pm.

henric wrote Jan 26, 2016 at 7:58 AM

There is a segment with zero duration, which trips some safety checks in HlsPlaylistSegmentManager.cs. This might be enough to get things working for you:
 Source/Libraries/SM.Media/Hls/HlsPlaylistSegmentManager.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Source/Libraries/SM.Media/Hls/HlsPlaylistSegmentManager.cs b/Source/Libraries/SM.Media/Hls/HlsPlaylistSegmentManager.cs
index a201438..1a819e2 100644
--- a/Source/Libraries/SM.Media/Hls/HlsPlaylistSegmentManager.cs
+++ b/Source/Libraries/SM.Media/Hls/HlsPlaylistSegmentManager.cs
@@ -642,7 +642,7 @@ namespace SM.Media.Hls
             if (!duration.HasValue)
                 return null;
 
-            if (duration.Value <= TimeSpan.Zero || duration.Value >= _excessiveDuration)
+            if (duration.Value < TimeSpan.Zero || duration.Value >= _excessiveDuration)
                 return null;
 
             return duration;
@@ -661,7 +661,7 @@ namespace SM.Media.Hls
                 if (!segment.Duration.HasValue)
                     return null;
 
-                if (segment.Duration <= TimeSpan.Zero || segment.Duration > _excessiveDuration)
+                if (segment.Duration < TimeSpan.Zero || segment.Duration > _excessiveDuration)
                     return null;
 
                 var segmentDuration = segment.Duration.Value;
This hasn't been tested and I need to dig into the code a bit further to make sure that this will not cause other problems before checking this into the main tree.

Let me know what happens if you get a chance to test it.

Thanks.

lionpham wrote Jan 26, 2016 at 9:03 AM

Hello henric,

Thank you very much for you support.

I have tested the above change, it worked with the video I sent you. I will do more tests to ensure it work properly for another videos and will let you know if I find any problems.

Best Regards