From 0256ebaff7b863d99ab7ce9750684b614eaecef3 Mon Sep 17 00:00:00 2001 From: "yuval.keidar" Date: Sun, 8 Nov 2020 12:21:39 +0200 Subject: [PATCH] fix(FEC-10643): seek to live edge on first play redundant Issue: seek on low level device could take few seconds, remove it when it's not needed. Solution: on first play we're already on edge so it's redundant. --- src/player.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/player.js b/src/player.js index b6fe665f1..ab74351da 100644 --- a/src/player.js +++ b/src/player.js @@ -1926,7 +1926,8 @@ export default class Player extends FakeEventTarget { } this.ready() .then(() => { - if (this.isLive() && (!this.isDvr() || (typeof this.currentTime === 'number' && this.currentTime < 0))) { + const liveOrDvrOutOfWindow = this.isLive() && (!this.isDvr() || (typeof this.currentTime === 'number' && this.currentTime < 0)); + if (!this._firstPlay && liveOrDvrOutOfWindow) { this.seekToLiveEdge(); } this._engine.play();