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

Keep player as close as possible to live mode #408

Open
Pernifloss opened this issue Jan 12, 2024 · 1 comment
Open

Keep player as close as possible to live mode #408

Pernifloss opened this issue Jan 12, 2024 · 1 comment

Comments

@Pernifloss
Copy link

Hello, I'm using Oven to stream sport's events, especially Ski.
Low latency is key because we display the stream alongside the result on a webpage updated though web socket.

And I can't find a way to keep the player as close to "live" mode as possible. I'd love to disable seek bar completely, If possible.

My client's often stream from places with low bandwidth and unstable connection.
So when I tried HLS Options > Manage Latency with max latency option, the player was sometimes stuck in a buffering loop.

Also, it seems that browser pause video when tab is not on foreground, resulting in player not being "live" when returning

I tried

      addEventListener("visibilitychange", (event) => {
                    if (document.visibilityState === "visible") {
                        player.seek(Number.MAX_VALUE);
                    }
                });

But it sometime gets stuck and it pause the video.

Do you have any advice for me?

I can update player code if needed, I already customized it to display viewer count.

I stream on OME server with this config:

                       <OutputProfile>
                           <Name>bypass_stream</Name>
                           <OutputStreamName>${OriginStreamName}</OutputStreamName>
                           <!--LLHLS URL : https://domain/app/stream/llhls.m3u8 -->
                           <Playlist>
                               <Name>llhls</Name>
                               <FileName>llhls</FileName>
                               <Rendition>
                                   <Name>bypass</Name>
                                   <Video>bypass_video</Video>
                                   <Audio>bypass_audio</Audio>
                               </Rendition>
                           </Playlist>
                           <Encodes>
                               <Audio>
                                   <Name>bypass_audio</Name>
                                   <Bypass>true</Bypass>
                               </Audio>
                               <Video>
                                   <Name>bypass_video</Name>
                                   <Bypass>true</Bypass>
                               </Video>
                           </Encodes>
                       </OutputProfile>
                       ...
                       <LLHLS>
                           <OriginMode>true</OriginMode>
                           <ChunkDuration>0.5</ChunkDuration>
                           <PartHoldBack>1.5</PartHoldBack>
                           <SegmentDuration>6</SegmentDuration>
                           <SegmentCount>10</SegmentCount>
                           <CrossDomains>
                               <Url>*</Url>
                           </CrossDomains>
                       </LLHLS>
@SangwonOh
Copy link
Member

@Pernifloss Hi. To keep your live stream fresh, try OvenMediaEngine's WebRTC streaming instead of LLHLS playback. WebRTC streams always play the most recent.
(Document: https://airensoft.gitbook.io/ovenmediaengine/streaming/webrtc-publishing)

OvenMediaEngine's WebRTC streaming supports ABR, so it can respond even to users' poor network environments.
This will also solve the problem when a tab returns from the background to the foreground.

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