Open kwarismian opened 6 years ago
Thank you @kwarismian !!
I'm happy to review the PR!
@kwarismian btw, I would say that this worked at some point but maybe not with all the HLS live sources.
Definitely to set up isLive
via the VgAPI
should be way better than what I'm doing now tho.
I was reaching straight into the media object and setting it in reaction to the Hls.Events.LEVEL_LOADED
event. Would you rather I create a method in vgAPI to proxy the request through to the media object?
Within onPlayerReady:
this.hls.on(
Hls.Events.LEVEL_LOADED,
(event, data) => {
this.target.isLive = data.details.live;
}
);
I can certainly make changes to move the setting logic into vgAPI (does not currently expose isLive directly) before sending the pull request if that is your preference. I will go ahead and get it sent through, then we can discuss it in the PR.
@kwarismian since the PR is not concluded, what do I need to import to have that this.hls
available in my code? I just wish to set HLS to live.
Description
HLS Live Manifests (an m3u8 without an X-EndList) are constructed with a sliding window of time, so the reported "total time" is not infinity, causing the "isLive" check inside the Media object to report false.
Expected Behavior
isLive should be triggered when HLS is live so that controls behave as expected.
Actual Behavior
Rather than showing "Live" for the total time, it will show an ever changing sequence of numbers as segments are added, parsed, and removed from the sliding window.
Steps to Reproduce
[vgHls]
directivePull request resolving this issue is imminent.