diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index 5d34f4b7b9..90e64a68fc 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx @@ -1659,9 +1659,17 @@ export default class App extends React.Component { } target = Math.max(target, 0); this.Player().seekVideo(target); - const hlsTarget = - Math.floor(Date.now() / 1000) - this.HTMLInterface.getDuration() + target; - this.socket.emit('CMD:seek', this.state.isLiveStream ? hlsTarget : target); + // Livestreams sync to network using timestamp since video time may be different for each viewer + if (this.state.isLiveStream) { + const now = Math.floor(Date.now() / 1000); + let liveStreamTarget = now - this.HTMLInterface.getDuration() + target; + // If livestream and seeking close to edge, set target as max + if (now - liveStreamTarget <= 5) { + liveStreamTarget = Number.MAX_SAFE_INTEGER; + } + target = liveStreamTarget; + } + this.socket.emit('CMD:seek', target); }; onFullScreenChange = () => { diff --git a/src/components/Controls/Controls.tsx b/src/components/Controls/Controls.tsx index 6b336b8267..2cc90d47fc 100644 --- a/src/components/Controls/Controls.tsx +++ b/src/components/Controls/Controls.tsx @@ -146,9 +146,11 @@ export class Controls extends React.Component { { + if (duration < Infinity && !this.props.disabled) { + roomSeek(e, time); + } + }} onMouseOver={this.onMouseOver} onMouseOut={this.onMouseOut} onMouseMove={this.onMouseMove}