Skip to content

HLS.js + React <MediaLiveButton /> is never live (always grey) #749

Answered by luwes
brandonhub asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for reporting!

This can be resolved by adding a hls.js config:

        // Mimic the media element with an Infinity duration for live streams.
        liveDurationInfinity: true

See a fork of your example:
https://codesandbox.io/s/mediachrome-hls-js-live-indicator-forked-hj4zft?file=/src/App.js:456-569

I believe that is needed otherwise it's very difficult to accurately figure out what stream type it is.

There's a few media-controller attributes that are related to this.
See https://www.media-chrome.org/docs/en/components/media-controller#liveedgeoffset


Also have a look at https://github.com/muxinc/hls-video-element which adds that config and some other handy logic like preloading …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by luwes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #748 on October 14, 2023 18:22.