Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FEC-14000): Decoupling Plugins from Audio Player #805

Merged
merged 6 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions demo/player-ovp.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
provider: {
partnerId: 242,
env: {
cdnUrl: 'https://api.nvq2.ovp.kaltura.com',
cdnUrl: 'https://cfvod.nvq2.ovp.kaltura.com',
serviceUrl: 'https://api.nvq2.ovp.kaltura.com/api_v3'
}
}
},
};

const player = KalturaPlayer.setup(config);
player.loadMedia({ entryId: '0_sv5tx4d8' });
player.loadMedia({ entryId: '0_bfj8lg0f' });
</script>
</body>
</html>
26 changes: 26 additions & 0 deletions src/common/plugins/base-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ export class BasePlugin {
* @member
*/
protected static defaultConfig: any = {};
/**
* The display name of the plugin.
* Inherited plugins should override this property.
* @type {string}
* @static
* @member
*/
public displayName!: string;
/**
* The svg icon metadata of the plugin.
* Inherited plugins should override this property.
* @type {svgUrl: string, viewBox: string}
* @static
* @member
*/
public symbol!: { svgUrl: string; viewBox: string };

/**
* Returns under what conditions the plugin is valid.
Expand Down Expand Up @@ -112,6 +128,16 @@ export class BasePlugin {
*/
public loadMedia(): void {}

/**
* should to overridden by a plugin which open overlay once activated
* @public
* @virtual
* @returns {void}
*/
public open(): void {
throw new Error(Error.Severity.CRITICAL, Error.Category.PLAYER, Error.Code.RUNTIME_ERROR_METHOD_NOT_IMPLEMENTED, 'showOverlay()');
}

/**
* Runs the destroy logic of the plugin.
* plugin must implement this method.
Expand Down
Loading