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

Is it possible to call flushBuffer() from JS for an OSMF based player? #282

Open
osmestad opened this issue May 20, 2015 · 3 comments
Open

Comments

@osmestad
Copy link

Hello,
I see that v0.4.0.7 added hls.flushBuffer() and exposed hls object in flashlsOSMF. Should it then be possible to call this directly from JavaScript when using the Grind player from your examples? Or will it require some proxying in Flash to expose that?

Great HLS player by the way!

/Øyvind

@mangui
Copy link
Owner

mangui commented May 20, 2015

@osmestad
are you intending to flush the buffer to speed up the level switching ?
if that is the case , I modified the API in dev-API-changes branch
https://github.com/mangui/flashls/blob/dev-API-changes/src/org/mangui/hls/HLS.as#L125-L141

there are now 3 ways of performing level switching
instant level switch (flush the whole buffer, change level, and seek to current position to force an immediate switch)
smooth level switch (flush next buffered fragment, change level, and fetch next fragment @ new quality level)
bw conservative level switch (change level ... next fetched fragment will use new level)

if your intention was to tweak this level switch behavior, best would be to add a new level switch option for players, either instant/smooth/conservative

cheers,
Mangui

@osmestad
Copy link
Author

Yes the intention was to speed up level switching (some users were confused that the requested quality was not being set, if they had a lot of data buffered already I assume). So it would be great to get a level switch option for players :)

@mangui
Copy link
Owner

mangui commented May 21, 2015

in order to speed up level switching, I tried to replace hls.loadLevel by hls.nextLevel
here, https://github.com/mangui/flashls/blob/dev/src/org/mangui/osmf/plugins/traits/HLSDynamicStreamTrait.as#L63
and there https://github.com/mangui/flashls/blob/dev/src/org/mangui/osmf/plugins/traits/HLSDynamicStreamTrait.as#L76

and also I removed the forced seek here :
https://github.com/mangui/flashls/blob/dev/src/org/mangui/osmf/plugins/traits/HLSDynamicStreamTrait.as#L65-L66

but GrindPlayer seems to force a seek in some level switching case ... because of this, the behaviour is not really better. I won't have time to dig into it, but if anybody volunteers to understand the GrindPlayer logic this would be great

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