Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if we play LIVE #369

Open
NicolasSiver opened this issue Aug 18, 2015 · 5 comments
Open

Check if we play LIVE #369

NicolasSiver opened this issue Aug 18, 2015 · 5 comments

Comments

@NicolasSiver
Copy link
Contributor

Hi,

What is the best approach to find that we are playing true Live now.
By true Live I mean condition when playback is near the end of playback, otherwise it means that we play content from the DVR window.

Can I utilize any sort of properties or events for such task?

Thanks

@mangui
Copy link
Owner

mangui commented Aug 18, 2015

something like this should do the trick.

var trueLive : Boolean = (_hls.type == HLSTypes.LIVE && (hls.levels[_hls.currentLevel].duration - _hls.position) < LIVE_THRESHOLD);

up to you to define LIVE_THRESHOLD
it could be 2*hls.levels[_hls.currentLevel].targetdurationfor example

@NicolasSiver
Copy link
Contributor Author

Is there any more precise approach?
Especially when Live manifest grows.

Library tries to be in a range of 3-4 segments when it plays Live?

@NicolasSiver NicolasSiver reopened this Oct 9, 2015
@mangui
Copy link
Owner

mangui commented Oct 12, 2015

if EXT-X-ENDLIST tag is not present, flashls does not allow to seek to a position to close to the edge of the playlist ( playlist duration - 3 target duration)
https://github.com/mangui/flashls/blob/dev/src/org/mangui/hls/stream/StreamBuffer.as#L122-L141

but you can seek before that position if you want to.
this check could eventually be removed, and the responsibility could be delegated to the application running on top of flashls ...

@NicolasSiver
Copy link
Contributor Author

Now I have changed check on 4 * averageDuration, and it work much more better, there is no spikes, when new segment is added

@NicolasSiver
Copy link
Contributor Author

Ok :)
These approaches with position and durations comparison don't work good enough.
It should be implemented on level of library.
Where do you recommend to start?

Idea:
Check which fragment now plays, if it's very latest (considering all rules, like don't touch last 3 segments, etc.) - return true.

Also I think, for Live, 3 segments It's too much of delay.

Perfect: playing current, and one segment ahead awaits.
Current Implementation: playing current, and nearly 3 segments ahead await. If you will take best practices for segment sizes for Live, It's near 30 second of delay...

@NicolasSiver NicolasSiver reopened this Oct 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants