Skip to content

Commit

Permalink
fix(FEC-12988): fix image tracks row/cols values got mixed (#235)
Browse files Browse the repository at this point in the history
* fix(FEC-12988): fix image tracks row/cos values got mixed
  • Loading branch information
giladna authored Mar 7, 2023
1 parent 54aa3e0 commit 0ba01cd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/dash-thumbnail-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
}
Expand Down Expand Up @@ -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];
};
Expand Down
8 changes: 4 additions & 4 deletions test/src/dash-thumbnail-controller.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0ba01cd

Please sign in to comment.