Open Hyphen-ated opened 8 years ago
I think it is important to note that the new standard in tournament rebroadcasting is to use the "MacSG" program, which is a wrapper for VLC & Livestreamer. Thus, such a solution would be extracting the delay from VLC, not from a browser.
Do you know how to find that in VLC? I've looked but never seen such a thing, as twitch reports it directly back to the browser. I don't think that VLC is capable of returning that kind of information to be honest.
The only place would possibly be in the "media stats" but it doesn't seem useful
If you can find where this is then adding it is trivial, but again, I think this is not going to be something you can find based on which API was returning the information in the browser.
I also had a look here, but nothing seems promising: http://docs.livestreamer.io/api.html#api-stream-subclasses
Those are the API commands for setting up a stream for VLC (or another player) to view it. Even less likely to have something there.
Perhaps if MacSG used the seek parameter to seek to a specific time, then the delay would be known.
It's a live stream (not pre-recorded VOD like Netflix/Hulu/Youtube), so there is technically no "time" to seek to. You can seek in your buffer but that's about it. I think by default VLC creates a 1-2 second buffer on startup so that if you have some kind of hiccup you're not going to see it right away. This is why you can hit 'n' immediately upon starting the stream and catch up on the delay. The only thing I can think is that there may be a .vlrc option to not have that 1-2 second delay, but I haven't looked at the vlrc files enough to know.
When someone is hosting a tournament and the players have twitch delay that keeps varying, it's tricky for them to set the tracker delay properly. We could help mitigate this by making an extension that gets the twitch delay and then getting that info out to the tracker somehow.
to get the delay, we can use document.getElementsByClassName("js-stat-hls-latency-broadcaster");
to get it to the tracker, options include