Skip to content

Commit

Permalink
fix(FEC-12562): Ignore ks configuration on kava plugin incase of ottA…
Browse files Browse the repository at this point in the history
…nalytics exists on player (#574)

* if kava && ottAnalytics  exists remove the ks from kava plugin
  • Loading branch information
giladna authored Sep 22, 2022
1 parent a98960f commit b01430b
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ module.name_mapper='player-defaults' -> '<PROJECT_ROOT>/src/ovp/player-defaults'
module.name_mapper='player-defaults' -> '<PROJECT_ROOT>/src/ott/player-defaults'
module.name_mapper='poster' -> '<PROJECT_ROOT>/src/ovp/poster'
module.name_mapper='poster' -> '<PROJECT_ROOT>/src/ott/poster'
module.name_mapper='plugins-config-store' -> '<PROJECT_ROOT>/src/ovp/plugins/plugins-config-store'
module.name_mapper='plugins-config-store' -> '<PROJECT_ROOT>/src/ott/plugins/plugins-config-store'
esproposal.optional_chaining=enable
7 changes: 4 additions & 3 deletions src/common/plugins/plugins-config-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,16 @@ const removeUndefineds = (obj: Object = {}): Object =>
return product;
}, {});

class PluginConfigStore {
class BasePluginConfigStore {
_basePluginsConfig: dataStoreType;
_config: dataStoreType;

/**
* constructor
* @constructor
*/
constructor() {
this._config = Utils.Object.copyDeep(defaultConfig);
this._basePluginsConfig = Utils.Object.copyDeep(defaultConfig);
}

/**
Expand Down Expand Up @@ -132,4 +133,4 @@ class PluginConfigStore {
}
}

export {PluginConfigStore, templateRegex};
export {BasePluginConfigStore, templateRegex};
2 changes: 1 addition & 1 deletion src/common/plugins/plugins-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@flow
import {PluginConfigStore, templateRegex} from './plugins-config-store.js';
import {PluginConfigStore, templateRegex} from 'plugins-config-store';
import evaluate from '../utils/evaluate';
import {getReferrer} from '../utils/kaltura-params';
import {Utils} from '@playkit-js/playkit-js';
Expand Down
1 change: 0 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
} catch (e) {
console.error(e.message);
}

</script>
</body>
</html>
21 changes: 21 additions & 0 deletions src/ott/plugins/plugins-config-store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@flow

import {BasePluginConfigStore, templateRegex} from '../../common/plugins/plugins-config-store';

import {Utils} from '@playkit-js/playkit-js';

class PluginConfigStore extends BasePluginConfigStore {
_ottPluginsConfig: {[pluginName: string]: Object} = {
kava: {
ks: ''
}
};

constructor() {
super();

this._config = Utils.Object.mergeDeep({}, this._basePluginsConfig, this._ottPluginsConfig);
}
}

export {PluginConfigStore, templateRegex};
19 changes: 19 additions & 0 deletions src/ovp/plugins/plugins-config-store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//@flow

import {BasePluginConfigStore, templateRegex} from '../../common/plugins/plugins-config-store';

import {Utils} from '@playkit-js/playkit-js';

class PluginConfigStore extends BasePluginConfigStore {
_ovpPluginsConfig: {[pluginName: string]: Object} = {
ottAnalytics: {}
};

constructor() {
super();

this._config = Utils.Object.mergeDeep({}, this._basePluginsConfig, this._ovpPluginsConfig);
}
}

export {PluginConfigStore, templateRegex};
6 changes: 3 additions & 3 deletions ts-typed/base-middleware.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare namespace KalturaPlayerTypes {
export interface BaseMiddleware {
callNext(next: Function): void;
}
export interface BaseMiddleware {
callNext(next: Function): void;
}
}
16 changes: 8 additions & 8 deletions ts-typed/engine-decorator.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
interface FakeEvent {
type: string;
type: string;
}
declare namespace KalturaPlayerTypes {
export interface IEngineDecorator {
dispatchEvent(event: FakeEvent): boolean;
active: boolean;
}
export interface IEngineDecoratorProvider {
getEngineDecorator(engine: any, dispatchEventHandler: Function): IEngineDecorator;
}
export interface IEngineDecorator {
dispatchEvent(event: FakeEvent): boolean;
active: boolean;
}
export interface IEngineDecoratorProvider {
getEngineDecorator(engine: any, dispatchEventHandler: Function): IEngineDecorator;
}
}
10 changes: 5 additions & 5 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as preactLib from 'preact';
declare module 'kaltura-player-js' {
export const ui: typeof PlaykitUI;
export class FakeEvent implements CustomEvent {
readonly payload: any
readonly payload: any;
readonly AT_TARGET: number;
readonly BUBBLING_PHASE: number;
readonly CAPTURING_PHASE: number;
Expand Down Expand Up @@ -76,10 +76,10 @@ export interface Logger {
}

export interface EventTypes {
Core: {[event: string]: string},
UI: {[event: string]: string},
Cast: {[event: string]: string},
Playlist: {[event: string]: string}
Core: {[event: string]: string};
UI: {[event: string]: string};
Cast: {[event: string]: string};
Playlist: {[event: string]: string};
}

declare module PlaykitUI {
Expand Down
3 changes: 2 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ function createConfig(env, argv, target) {
'playkit-js-providers': path.resolve(`./node_modules/playkit-js-providers/dist/playkit-${playerType}-provider`),
'player-defaults': path.resolve(`./src/${playerType}/player-defaults`),
'hls.js': path.resolve('./node_modules/hls.js/dist/hls.min.js'),
poster: path.resolve(`./src/${playerType}/poster`)
poster: path.resolve(`./src/${playerType}/poster`),
'plugins-config-store': path.resolve(`./src/${playerType}/plugins/plugins-config-store`)
},
modules: [path.resolve(__dirname, 'src'), 'node_modules']
}
Expand Down

0 comments on commit b01430b

Please sign in to comment.