Skip to content

Commit

Permalink
use init pts
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Aug 5, 2024
1 parent e1cfbb3 commit 3dff152
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,9 @@ export default class App extends React.Component<AppProps, AppState> {
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',
Expand Down

0 comments on commit 3dff152

Please sign in to comment.