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-13671): Aligen kaltua-player-js with the new changes provider #729

Merged
merged 10 commits into from
Feb 6, 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 .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": ["plugin:prettier/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"extends": ["plugin:prettier/recommended", "prettier", "plugin:@typescript-eslint/recommended"],
"plugins": ["prettier", "@typescript-eslint"],
"rules": {
"max-len": [
Expand All @@ -16,11 +16,11 @@
}
],
"eol-last": "off",
"prettier/prettier": "warn",
"prettier/prettier": "error",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
Expand Down
32 changes: 32 additions & 0 deletions demo/player-ott.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
<title>Title</title>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script src="./kaltura-tv-player.js" type="text/javascript"></script>
</head>
<body>
<div id="player-placeholder"></div>
<script>
var config = {
logLevel: 'DEBUG',
targetId: 'player-placeholder',
provider: {
partnerId: 3009,
env: {
serviceUrl: 'https://rest-us.ott.kaltura.com/v4_5/api_v3/'
}
}
};

try {
var kalturaPlayer = KalturaPlayer.setup(config);
kalturaPlayer.loadMedia({ entryId: '548569' });
} catch (e) {
console.error(e.message);
}
</script>
</body>
</html>
6 changes: 3 additions & 3 deletions demo/index.html → demo/player-ovp.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Kaltura Player Demo Page"/>
<meta name="description" content="Kaltura Player Demo Page" />
<title>Player</title>
<link rel="stylesheet" type="text/css" href="./style.css" />
<script src="./kaltura-ovp-player.js" type="text/javascript"></script>
Expand All @@ -21,9 +21,9 @@
partnerId: 242,
env: {
serviceUrl: 'https://api.nvq2.ovp.kaltura.com/api_v3',
cdnUrl: 'https://api.nvq2.ovp.kaltura.com',
cdnUrl: 'https://api.nvq2.ovp.kaltura.com'
}
},
}
};

const player = KalturaPlayer.setup(config);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"access": "public"
},
"scripts": {
"serve:ovp": "webpack serve --open --mode development --env playerType=ovp",
"serve:ovp": "webpack serve --open /player-ovp.html --mode development --env playerType=ovp",
"build:ovp": "webpack --mode production --env playerType=ovp",
"watch:ovp": "webpack --mode development --watch --env playerType=ovp",
"serve:ott": "webpack serve --open --mode development --env playerType=ott",
"serve:ott": "webpack serve --open /player-ott.html --mode development --env playerType=ott",
"build:ott": "webpack --mode production --env playerType=ott",
"watch:ott": "webpack --mode development --watch --env playerType=ott",
"build": "yarn run clean && yarn run build:ovp && yarn run build:ott && yarn run build:types",
Expand All @@ -52,8 +52,8 @@
"@playkit-js/playkit-js": "0.84.5",
"@playkit-js/playkit-js-dash": "1.36.2",
"@playkit-js/playkit-js-hls": "1.32.11",
"@playkit-js/playkit-js-providers": "2.40.3",
"@playkit-js/playkit-js-ui": "0.78.1-canary.0-3e307cf",
"@playkit-js/playkit-js-providers": "2.40.4-canary.0-b3e5269",
"@playkit-js/playkit-js-ui": "0.78.1-canary.0-6f60446",
"hls.js": "1.4.11",
"shaka-player": "4.7.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/common/cast/player-snapshot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { KalturaPlayer } from '../../kaltura-player';
import { TextStyle, TrackType, Utils } from '@playkit-js/playkit-js';
import { KPMediaConfig } from '../../types';
import { ProviderMediaInfoObject } from '@playkit-js/playkit-js-providers/ovp-provider';
import { ProviderMediaInfoObject } from '@playkit-js/playkit-js-providers/types';

/**
* @class PlayerSnapshot
Expand Down
2 changes: 1 addition & 1 deletion src/common/cast/remote-player.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FakeEvent, TextStyle, Track } from '@playkit-js/playkit-js';
import { ProviderMediaInfoObject } from '@playkit-js/playkit-js-providers/ovp-provider';
import { ProviderMediaInfoObject } from '@playkit-js/playkit-js-providers/types';
import { RemoteSession } from './remote-session';
import { KPMediaConfig } from '../../types';

Expand Down
2 changes: 1 addition & 1 deletion src/common/playlist/playlist-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
ProviderMediaInfoObject,
ProviderPlaylistMetadataObject,
ProviderPlaylistObject
} from '@playkit-js/playkit-js-providers/ovp-provider';
} from '@playkit-js/playkit-js-providers/types';
import { KalturaPlayer } from '../../kaltura-player';
import { PlaylistEventType } from './playlist-event-type';
import { Playlist } from './playlist';
Expand Down
2 changes: 1 addition & 1 deletion src/common/playlist/playlist.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Utils } from '@playkit-js/playkit-js';
import { ProviderPlaylistMetadataObject } from '@playkit-js/playkit-js-providers/ovp-provider';
import { ProviderPlaylistMetadataObject } from '@playkit-js/playkit-js-providers/types';
import { PlaylistItem } from './playlist-item';
import { KPPlaylistObject, SourcesConfig, PluginsConfig, MediaSourceOptionsObject } from '../../types';

Expand Down
2 changes: 1 addition & 1 deletion src/common/thumbnail-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Utils, ThumbnailInfo, MediaType, EventManager } from '@playkit-js/playkit-js';
import { Poster } from '@playkit-js/playkit-js-providers/ovp-provider';
import { Poster } from '@playkit-js/playkit-js-providers/types';
import evaluate from './utils/evaluate';
import { KalturaPlayer } from '../kaltura-player';
import { KPThumbnailConfig, UiConfig, KPMediaConfig } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion src/common/utils/setup-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
ILogLevel,
PKSourcesConfigObject
} from '@playkit-js/playkit-js';
import { ProviderOptionsObject } from '@playkit-js/playkit-js-providers/ovp-provider';
import { ProviderOptionsObject } from '@playkit-js/playkit-js-providers/types';
import { ValidationErrorType } from './validation-error';
import LocalStorageManager from '../storage/local-storage-manager';
import { KalturaPlayer } from '../../kaltura-player';
Expand Down
11 changes: 4 additions & 7 deletions src/kaltura-player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,14 @@ import {
LoggerLevels
} from '@playkit-js/playkit-js';
import {
BaseProvider,
OTTProviderMediaInfoObject,
OVPProviderMediaInfoObject,
Provider,
ProviderEntryListObject,
ProviderMediaConfigObject,
ProviderMediaConfigSourcesObject,
ProviderMediaInfoObject,
ProviderPlaylistInfoObject,
ProviderPlaylistObject
} from '@playkit-js/playkit-js-providers/ovp-provider';
} from '@playkit-js/playkit-js-providers/types';
import { Provider } from '@playkit-js/playkit-js-providers/ovp-provider';
import { UIWrapper } from './common/ui-wrapper';
import { AdsController, ControllerProvider } from './common/controllers';
import { BaseRemotePlayer } from './common/cast/base-remote-player';
Expand Down Expand Up @@ -83,7 +80,7 @@ import {
export class KalturaPlayer extends FakeEventTarget {
private static _logger: any = getLogger('KalturaPlayer' + Utils.Generator.uniqueId(5));
private _localPlayer: Player;
private _provider: BaseProvider<OVPProviderMediaInfoObject | OTTProviderMediaInfoObject>;
private _provider: Provider;
private _uiWrapper: UIWrapper;
private _controllerProvider: ControllerProvider;
private _adsController: AdsController | undefined;
Expand Down Expand Up @@ -744,7 +741,7 @@ export class KalturaPlayer extends FakeEventTarget {
return this._pluginManager.getAll();
}

public get provider(): BaseProvider<OVPProviderMediaInfoObject | OTTProviderMediaInfoObject> {
public get provider(): Provider {
return this._provider;
}

Expand Down
3 changes: 1 addition & 2 deletions src/ott/poster.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ProviderMediaConfigSourcesObject } from '@playkit-js/playkit-js-providers/ott-provider';
import { PKDimensionsConfig, PKSourcesConfigObject } from '@playkit-js/playkit-js';
import { Poster } from '@playkit-js/playkit-js-providers/ott-provider';
import { Poster, ProviderMediaConfigSourcesObject } from '@playkit-js/playkit-js-providers/types';

/**
* Add poster with player dimensions.
Expand Down
2 changes: 1 addition & 1 deletion src/ovp/poster.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { THUMBNAIL_REGEX } from '../common/thumbnail-manager';
import { ProviderMediaConfigSourcesObject } from '@playkit-js/playkit-js-providers/ovp-provider';
import { PKDimensionsConfig, PKSourcesConfigObject } from '@playkit-js/playkit-js';
import { ProviderMediaConfigSourcesObject } from '@playkit-js/playkit-js-providers/types';

/**
* Add poster with player dimensions to thumbnail API call
Expand Down
3 changes: 2 additions & 1 deletion src/types/kaltura-player-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import { UiConfig } from './ui-config';
import { ViewabilityConfig } from './visibility-config';
import { NetworkConfig } from './network-config';
import { PluginsConfig } from './plugins';
import { ProviderOptionsObject } from '@playkit-js/playkit-js-providers/ovp-provider';

import {
PKAbrConfigObject,
PKDimensionsConfig,
PKSessionConfigObject,
PKSourcesConfigObject,
PKTextConfigObject
} from '@playkit-js/playkit-js';
import { ProviderOptionsObject } from "@playkit-js/playkit-js-providers/types";

export interface KalturaPlayerConfig {
targetId: string;
Expand Down
6 changes: 2 additions & 4 deletions src/types/media-config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { PlaybackConfig } from './playback-config';
import {
ProviderMediaConfigSessionObject,
ProviderMediaConfigSourcesObject
} from '@playkit-js/playkit-js-providers/ovp-provider';
import { ProviderMediaConfigSourcesObject, ProviderMediaConfigSessionObject } from "@playkit-js/playkit-js-providers/types";


/**
* @typedef {Object} KPMediaConfig
Expand Down
2 changes: 1 addition & 1 deletion src/types/playlist-object.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PlaylistOptions } from './playlist';
import { PlaylistCountdownOptions } from './playlist';
import { PlaylistItem } from '../common/playlist/playlist-item';
import { ProviderPlaylistMetadataObject } from '@playkit-js/playkit-js-providers/ovp-provider';
import { ProviderPlaylistMetadataObject } from "@playkit-js/playkit-js-providers/types";

export interface PlaylistConfig {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion src/types/playlist/KPPlaylistObject.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PlaylistItem } from '../../common/playlist/playlist-item';
import { PlaylistConfigObject } from './playlist-config-object';
import { ProviderPlaylistMetadataObject } from '@playkit-js/playkit-js-providers/ovp-provider';
import { ProviderPlaylistMetadataObject } from "@playkit-js/playkit-js-providers/types";

/**
* @typedef {Object} KPPlaylistObject
Expand Down
2 changes: 1 addition & 1 deletion src/types/sources-config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ExternalThumbnailsConfig } from './exteranl-thumbnails-object';
import { MediaSourceOptionsObject } from './media-source-options';
import { ImageSourceOptions } from './image-player-options';
import { ProviderMediaConfigSourcesObject } from '@playkit-js/playkit-js-providers/ovp-provider';
import { ProviderMediaConfigSourcesObject } from "@playkit-js/playkit-js-providers/types";

export interface SourcesConfig
extends Omit<ProviderMediaConfigSourcesObject, 'poster'> {
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1182,15 +1182,15 @@
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-hls/-/playkit-js-hls-1.32.11.tgz#0d4d514750a660e9899d04e97482af6311355707"
integrity sha512-YWhFAYeBpONeENRQbmm6901FtkT4vwzu8O5mzrrty7TUGR3zXpBGszul1bngAZQWS6UZ5vpuvAuLSz+37BFUpg==

"@playkit-js/[email protected].3":
version "2.40.3"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-providers/-/playkit-js-providers-2.40.3.tgz#d6da4e07711b3fa5a9d650e0752018584b71f5fe"
integrity sha512-6xfG+jhNqOCoPcjI5C+h6/SVS+RV6IObiBiQ6/TtP+FEZz+3lyg1D7R6kZMoUGB02ris1ODI954IAxngFdEaDA==

"@playkit-js/[email protected]3e307cf":
version "0.78.1-canary.0-3e307cf"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-ui/-/playkit-js-ui-0.78.1-canary.0-3e307cf.tgz#7351100b24c5714308e14d43f33df808bcdae68f"
integrity sha512-x/FuSlnQ5rtaIiSkShSLfa4Hx67ThQ+CXgDNk5PhKgJ1xjwKjmIEQoQ3g2Q1h1yLvZhr31ioEUTS75v5OMF4tA==
"@playkit-js/[email protected].4-canary.0-b3e5269":
version "2.40.4-canary.0-b3e5269"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-providers/-/playkit-js-providers-2.40.4-canary.0-b3e5269.tgz#0505713d1ca5dae3178704d1ef23e043f782289a"
integrity sha512-W9fHWtdAZgsXJhfEEqXEPIbqXBLuOQsTjRq/sDZXnuaBfPXZAZYNrIG10DCGUbeXGiNq/s8oomZOEskwSbsL1Q==

"@playkit-js/[email protected]6f60446":
version "0.78.1-canary.0-6f60446"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js-ui/-/playkit-js-ui-0.78.1-canary.0-6f60446.tgz#6c20a000db964f143f4f0768a09b1544be66a177"
integrity sha512-RgiaGrB1wD97fAKXBlnSboDAGXh0Dy2m3EKzvf4GLxjuZhCm4EpTrCLgbGAixOlI9Y5SssfjUezQC8BNK2ij0w==
dependencies:
preact "10.4.6"
preact-i18n "2.0.0-preactx.2"
Expand Down
Loading