From 3dff152cc95f560ad5c63962b04d756dae062ab1 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 5 Aug 2024 02:11:02 +0000 Subject: [PATCH] use init pts --- src/components/App/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index a25ec29f6f..24ad8fa47d 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx @@ -585,8 +585,9 @@ export default class App extends React.Component { hls.once(Hls.Events.LEVEL_LOADED, (_, data) => { this.setState({ isLiveStream: data.details.live }); }); - hls.once(Hls.Events.MEDIA_ATTACHED, () => { + hls.once(Hls.Events.INIT_PTS_FOUND, (event, data) => { const now = Math.floor(Date.now() / 1000); + // console.log(data.initPTS); const liveStreamStart = now - this.Player().getDuration(); console.log( 'hlsplayer time',