Skip to content

Commit

Permalink
fix(FEC-8355): on change media the config hold the old seekbar config…
Browse files Browse the repository at this point in the history
…uration (#136)

take the ui config from the player config instead of from the ui config which could be irrelevant
  • Loading branch information
odedhutzler authored and yairans committed Jul 4, 2018
1 parent 87633ff commit 0f6b036
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/common/ui-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class UIWrapper {
this.setConfig({hasError: false}, 'engine');
}

setSeekbarConfig(mediaConfig: ProviderMediaConfigObject): void {
setSeekbarConfig(mediaConfig: ProviderMediaConfigObject, uiConfig: UIOptionsObject): void {
if (this._disabled) return;
const seekbarConfig = Utils.Object.getPropertyPath(this._uiManager, 'config.components.seekbar');
const seekbarConfig = Utils.Object.getPropertyPath(uiConfig, 'components.seekbar');
const previewThumbnailConfig = getPreviewThumbnailConfig(mediaConfig, seekbarConfig);
this.setConfig(Utils.Object.mergeDeep({}, previewThumbnailConfig, seekbarConfig), 'seekbar');
}
Expand Down
2 changes: 1 addition & 1 deletion src/kaltura-player.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class KalturaPlayer {
Object.keys(this._player.config.plugins).forEach(name => {playerConfig.plugins[name] = {}});
addKalturaPoster(playerConfig.sources, mediaConfig.sources, this._player.dimensions);
addKalturaParams(this._player, playerConfig);
this._uiWrapper.setSeekbarConfig(mediaConfig);
this._uiWrapper.setSeekbarConfig(mediaConfig, this._player.config.ui);
this._player.configure(playerConfig);
}

Expand Down
10 changes: 5 additions & 5 deletions test/src/common/utils/ui-wrapper.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('UIWrapper', function () {
});
done();
});
uiWrapper.setSeekbarConfig(mediaConfig);
uiWrapper.setSeekbarConfig(mediaConfig, uiConfig);
});

it('should set the configured thumbs sprite with configured sizes', function (done) {
Expand All @@ -90,7 +90,7 @@ describe('UIWrapper', function () {
});
done();
});
uiWrapper.setSeekbarConfig(mediaConfig);
uiWrapper.setSeekbarConfig(mediaConfig, uiConfig);
});

it('should set the backend thumbs sprite with default sizes', function (done) {
Expand All @@ -103,7 +103,7 @@ describe('UIWrapper', function () {
config.thumbsSprite.startsWith(mediaConfig.sources.poster).should.be.true;
done();
});
uiWrapper.setSeekbarConfig(mediaConfig);
uiWrapper.setSeekbarConfig(mediaConfig, uiConfig);
});

it('should set the backend thumbs sprite with configured sizes', function (done) {
Expand All @@ -119,7 +119,7 @@ describe('UIWrapper', function () {
config.thumbsSprite.startsWith(mediaConfig.sources.poster).should.be.true;
done();
});
uiWrapper.setSeekbarConfig(mediaConfig);
uiWrapper.setSeekbarConfig(mediaConfig, uiConfig);
});

it('should not set seek bar config', function (done) {
Expand All @@ -131,7 +131,7 @@ describe('UIWrapper', function () {
config.should.deep.equal({});
done();
});
uiWrapper.setSeekbarConfig(mediaConfig);
uiWrapper.setSeekbarConfig(mediaConfig, uiConfig);
});
});
});

0 comments on commit 0f6b036

Please sign in to comment.