From 493e09b274a90322546e9c4029bfd47b73c7be45 Mon Sep 17 00:00:00 2001 From: Kajetan Dvoracek Date: Thu, 24 Feb 2022 10:54:37 +0100 Subject: [PATCH] Remove HLS thumbnail workaround This has been fixed in Shaka: - https://github.com/google/shaka-player/issues/3840 - https://github.com/google/shaka-player/pull/3858 --- .../JavaScript/VideoPlayer/ThumbnailPreview.js | 10 ---------- .../Private/JavaScript/VideoPlayer/VariantGroups.js | 12 ------------ 2 files changed, 22 deletions(-) diff --git a/Resources/Private/JavaScript/VideoPlayer/ThumbnailPreview.js b/Resources/Private/JavaScript/VideoPlayer/ThumbnailPreview.js index 1bf22bb..6a766ec 100644 --- a/Resources/Private/JavaScript/VideoPlayer/ThumbnailPreview.js +++ b/Resources/Private/JavaScript/VideoPlayer/ThumbnailPreview.js @@ -383,16 +383,6 @@ export default class ThumbnailPreview { * @param {SeekPosition} seekPosition */ renderImageAndShow(uri, thumb, tilesetImage, seekPosition) { - // When width/height are in the interval [0,1], we treat them as relative - // to the tileset size. See `CustomHlsParser`. - if ((0 <= thumb.width && thumb.width <= 1) && (0 <= thumb.height && thumb.height <= 1)) { - thumb.positionX *= tilesetImage.width; - thumb.width *= tilesetImage.width; - - thumb.positionY *= tilesetImage.height; - thumb.height *= tilesetImage.height; - } - this.ensureDisplaySize(thumb.width, thumb.height); this.renderImage(uri, thumb, tilesetImage); diff --git a/Resources/Private/JavaScript/VideoPlayer/VariantGroups.js b/Resources/Private/JavaScript/VideoPlayer/VariantGroups.js index 5c361ce..47369ed 100644 --- a/Resources/Private/JavaScript/VideoPlayer/VariantGroups.js +++ b/Resources/Private/JavaScript/VideoPlayer/VariantGroups.js @@ -67,18 +67,6 @@ export default class VariantGroups { for (const variant of this.manifest.variants) { this.addVariant(variant); } - - for (const imageStream of this.manifest.imageStreams) { - // The HLS parser apparently does not report dimensions of thumbnails, - // so `getThumbnails()` will not return correct size and position of a - // thumbnail within the tileset. By setting width = 1 and height = 1, - // we will at least receive the relative size and position, which in - // `ThumbnailPreview::renderImageAndShow()` we scale to the absolute - // values. - // TODO: Dispense of this - imageStream.width = 1; - imageStream.height = 1; - } } /**