This project has moved and is read-only. For the latest updates, please go here.

HLS Live streams, how to "Go Live"?

Jun 19, 2014 at 12:44 PM
Edited Jun 19, 2014 at 12:44 PM
Hi, I'm just testing our HLS Live stream, and no matter what I do, the "Go Live" button in MediaPlayer is always disabled, even calling manually the SeekToLive does nothing.

So the question is: is the GoLive button and SeekToLive method wired with the StreamingMediaPlugin and is it indicating properly, whether I am live or not?
Jun 21, 2014 at 4:26 AM
I think what is going on is that phonesm is forbidding seek on the stream (likely because it is not getting a duration for the program), so the "CanSeek" is false, which makes Player Framework's IsGoLiveAllowed false.

The last time I looked at this, I didn't find a good way of testing the #EXT-X-PLAYLIST-TYPE:EVENT case, where the playlist changes, but segments are never removed from the beginning. As long as there is some way to test this, I'm pretty sure that getting it working with phonesm would be simple.

I have not really looked into the more general case of dealing with a live stream with a window large enough to make seeks useful (which should be seekable, but does not have a finite duration).
Jun 23, 2014 at 2:51 PM
Hi, thanks for the response. I guess detecting whether I am live or won't work right now.
But do you know how to at least manually Go To Live position in the stream, because this should be possible even in HLS stream? When I tried the SeekToLive method, it did nothing.
Jun 23, 2014 at 9:08 PM
Edited Jun 23, 2014 at 9:22 PM
You might try changing this line in TsMediaStreamSource:
    var canSeek = duration.HasValue;
    var canSeek = true;
to see what happens. I don't think I've mucked with that code since before WP8 was out, so I'm not sure, but it may help.

If you want to know if phonesm thinks it is a live stream, then I think you can look at your MediaElement's NaturalDuration property.