From 0ba01cdcc3b8fd3f0d09a3804860a6ea509535b1 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 7 Mar 2023 20:40:27 +0200 Subject: [PATCH] fix(FEC-12988): fix image tracks row/cols values got mixed (#235) * fix(FEC-12988): fix image tracks row/cos values got mixed --- package.json | 2 +- src/dash-thumbnail-controller.js | 8 ++++---- test/src/dash-thumbnail-controller.spec.js | 8 ++++---- yarn.lock | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 12034d09..85a76ba1 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "@babel/preset-env": "^7.10.4", "@babel/preset-flow": "^7.10.4", "@babel/register": "^7.10.5", - "@playkit-js/playkit-js": "canary", + "@playkit-js/playkit-js": "0.82.1-canary.cbb9ad0", "babel-eslint": "^10.1.0", "babel-loader": "^8.1.0", "babel-plugin-istanbul": "^6.0.0", diff --git a/src/dash-thumbnail-controller.js b/src/dash-thumbnail-controller.js index a2976f81..ee6e1474 100644 --- a/src/dash-thumbnail-controller.js +++ b/src/dash-thumbnail-controller.js @@ -37,8 +37,8 @@ class DashThumbnailController { return new ThumbnailInfo({ width: Math.floor(sliceWidth), height: Math.floor(sliceHeight), - x: Math.floor(thumbIndex % rows) * sliceWidth, - y: Math.floor(thumbIndex / rows) * sliceHeight, + x: Math.floor(thumbIndex % cols) * sliceWidth, + y: Math.floor(thumbIndex / cols) * sliceHeight, url: this._buildUrlFromTemplate(activeTrack, page) }); } @@ -77,8 +77,8 @@ class DashThumbnailController { cols = 1; if (value.includes('x')) { const values = value.split('x'); - rows = parseInt(values[0]); - cols = parseInt(values[1]); + cols = parseInt(values[0]); + rows = parseInt(values[1]); } return [rows, cols]; }; diff --git a/test/src/dash-thumbnail-controller.spec.js b/test/src/dash-thumbnail-controller.spec.js index e2caad1a..6c03f952 100644 --- a/test/src/dash-thumbnail-controller.spec.js +++ b/test/src/dash-thumbnail-controller.spec.js @@ -21,8 +21,8 @@ describe('DashThumbnailController', () => { imageTrack.index.should.equal(0); imageTrack.id.should.equal('thumbnails_320x180'); imageTrack.duration.should.equal(100); - imageTrack.cols.should.equal(1); - imageTrack.rows.should.equal(10); + imageTrack.cols.should.equal(10); + imageTrack.rows.should.equal(1); imageTrack.height.should.equal(180); imageTrack.width.should.equal(3200); imageTrack.url.should.equal('my/stream/thumbnails_320x180/tile_$Number$.jpg'); @@ -48,8 +48,8 @@ describe('DashThumbnailController', () => { imageTrack1.index.should.equal(0); imageTrack1.id.should.equal('thumbnails_102x58'); imageTrack1.duration.should.equal(634.566); - imageTrack1.cols.should.equal(20); - imageTrack1.rows.should.equal(10); + imageTrack1.cols.should.equal(10); + imageTrack1.rows.should.equal(20); imageTrack1.height.should.equal(1152); imageTrack1.width.should.equal(1024); imageTrack1.url.should.equal('my/stream/thumbnails_102x58/tile_$Number$.jpg'); diff --git a/yarn.lock b/yarn.lock index 603c0497..ad225803 100644 --- a/yarn.lock +++ b/yarn.lock @@ -853,10 +853,10 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd" integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw== -"@playkit-js/playkit-js@canary": - version "0.78.1-canary.bf28e11" - resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js/-/playkit-js-0.78.1-canary.bf28e11.tgz#3e8e3d2be59729781fad6db90574310047516605" - integrity sha512-tLGBBS80gVh5DLpYNCfBStFaEvmS50Mk/3emU9sY65HjJkhueq1sj3Nj1UM2x1tksc77Q6NSNLX/DFUtsqpNdg== +"@playkit-js/playkit-js@0.82.1-canary.cbb9ad0": + version "0.82.1-canary.cbb9ad0" + resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js/-/playkit-js-0.82.1-canary.cbb9ad0.tgz#027c45584c99cfe55cff4254b17c6b4dcf94941b" + integrity sha512-oDEyI9BtvyEFrMgYWHVsirD2C/gpeW3suvSq2/7ikqykIadaJMqumP/yWGiBrU9vNDFbuVLeGdVPmLyxQMT0Jg== dependencies: js-logger "^1.6.0" ua-parser-js "1.0.2"