Skip to content

Commit

Permalink
fix(FEC-11498): Remove product version from player config (#492)
Browse files Browse the repository at this point in the history
Remove product version from player config
  • Loading branch information
JonathanTGold committed Sep 13, 2021
1 parent db18aad commit 900ad75
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/common/utils/kaltura-params.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@flow
import {StreamType, Utils} from '@playkit-js/playkit-js';
import {getServerUIConf} from './setup-helpers';

const PLAY_MANIFEST = 'playmanifest/';
const PLAY_SESSION_ID = 'playSessionId=';
Expand Down Expand Up @@ -159,7 +160,7 @@ function addKalturaParams(player: Player, playerConfig: PartialKPOptionsObject):
handleSessionId(player, playerConfig);
const sources = playerConfig.sources;
const sessionId = playerConfig.session && playerConfig.session.id;
const productVersion = player.config.productVersion;
const productVersion = getServerUIConf()?.productVersion;
Object.values(StreamType).forEach(key => {
// $FlowFixMe
if (sources[key]) {
Expand Down
7 changes: 5 additions & 2 deletions src/common/utils/setup-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,9 @@ function getDefaultOptions(options: PartialKPOptionsObject): KPOptionsObject {
Utils.Object.mergeDeep(defaultOptions, options);

if (!options.provider.ignoreServerConfig) {
defaultOptions = Utils.Object.mergeDeep({}, supportLegacyOptions(getServerUIConf()), defaultOptions);
const serverUIConf = Utils.Object.copyDeep(getServerUIConf());
delete serverUIConf.productVersion;
defaultOptions = Utils.Object.mergeDeep({}, supportLegacyOptions(serverUIConf), defaultOptions);
}

checkNativeHlsSupport(defaultOptions);
Expand Down Expand Up @@ -732,5 +734,6 @@ export {
getDefaultOptions,
maybeSetStreamPriority,
hasYoutubeSource,
mergeProviderPluginsConfig
mergeProviderPluginsConfig,
getServerUIConf
};
4 changes: 2 additions & 2 deletions test/src/common/utils/kaltura-params.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ describe('addClientTag', function () {
it('should add client tag as first param', function () {
let source = {url: 'a/b/c/playmanifest/source'};
let productVersion = '7.37';
player.config = {session: {}, productVersion};
source.url = addClientTag(source.url, player.config.productVersion);
player.config = {session: {}};
source.url = addClientTag(source.url, productVersion);
source.url.should.be.equal('a/b/c/playmanifest/source?clientTag=html5:v' + productVersion);
});

Expand Down

0 comments on commit 900ad75

Please sign in to comment.