From 59d2e09e98a66558e65c33b7d55ea8345f3f8099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Fri, 3 Feb 2023 11:26:52 +0100 Subject: [PATCH] fix: Failed to set 'currentTime' property on 'HTMLMediaElement' on a Hisense TV (#4962) Fixes https://github.com/shaka-project/shaka-player/issues/4888 --- lib/media/video_wrapper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/media/video_wrapper.js b/lib/media/video_wrapper.js index 9048b6f778..6ddc5e0346 100644 --- a/lib/media/video_wrapper.js +++ b/lib/media/video_wrapper.js @@ -135,15 +135,15 @@ shaka.media.VideoWrapper = class { // calling |Player.load|, meaning that |currentTime| is more meaningful than // |startTime|. // - // Seeking to the current time is a work around for Issue 1298. If we don't - // do this, the video may get stuck and not play. + // Seeking to the current time is a work around for Issue 1298 and 4888. + // If we don't do this, the video may get stuck and not play. // // TODO: Need further investigation why it happens. Before and after // setting the current time, video.readyState is 1, video.paused is true, // and video.buffered's TimeRanges length is 0. // See: https://github.com/shaka-project/shaka-player/issues/1298 this.mover_.moveTo( - this.video_.currentTime == 0 ? + (!this.video_.currentTime || this.video_.currentTime == 0) ? startTime : this.video_.currentTime); }