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

Dynamically change HLS parameters #422

Open
ValentinDoche opened this issue Apr 7, 2024 · 1 comment
Open

Dynamically change HLS parameters #422

ValentinDoche opened this issue Apr 7, 2024 · 1 comment

Comments

@ValentinDoche
Copy link

Hello everyone,

I'm looking for a way to dynamically change the liveSyncDuration parameter.

I have a websocket that sends a liveSyncDuration value and I'm looking for a way to put it in my ovenplayer.

Thanks to all

@SangwonOh
Copy link
Member

@ValentinDoche Hi. This little hack will help you.

let myHls = null;

// https://airensoft.gitbook.io/ovenplayer/api-reference/events#on-hlsprepared
// Get an hlsjs instance from OvenPlayer.
player.on('hlsPrepared', function (hls) {
    myHls = hls;
});

// If you change the config value of hlsjs, it will be applied in real time.
yourWebSocket.addEventListener("message", (event) => {
    myHls.config.liveSyncDuration = 2;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants