@playkit-js/playkit-js-kava 1.6.0 → 1.6.2-canary.0-702048e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +8 -0
- package/.eslintrc.json +60 -0
- package/.github/ISSUE_TEMPLATE.md +32 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +12 -0
- package/.github/workflows/run_canary.yaml +18 -0
- package/.github/workflows/run_prod.yaml +25 -0
- package/.github/workflows/run_tests.yaml +45 -0
- package/.prettierignore +12 -0
- package/.prettierrc +7 -0
- package/CHANGELOG.md +3 -1
- package/api-extractor.json +37 -0
- package/demo/index.html +41 -0
- package/dist/playkit-js-kava.d.ts +263 -0
- package/dist/playkit-kava.js +1 -1
- package/dist/playkit-kava.js.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/docs/configuration-api.md +309 -0
- package/docs/kava-events.md +246 -0
- package/docs/kava-parameters.md +373 -0
- package/karma.conf.js +86 -0
- package/package.json +59 -80
- package/src/application-events-model.ts +392 -0
- package/src/applications-events.ts +67 -0
- package/src/enums/application-event-type.ts +4 -0
- package/src/enums/button-type.ts +34 -0
- package/src/enums/event-bucket-name.ts +4 -0
- package/src/enums/http-method-type.ts +8 -0
- package/src/enums/kaltura-application.ts +29 -0
- package/src/enums/page-load-type.ts +14 -0
- package/src/index.ts +17 -0
- package/src/kava-event-model.ts +423 -0
- package/src/kava-model.ts +422 -0
- package/src/kava-rate-handler.ts +107 -0
- package/src/kava-timer.ts +139 -0
- package/src/kava.ts +923 -0
- package/src/temp-imported-plugins-event-names-temp.ts +38 -0
- package/src/types/index.ts +3 -0
- package/src/types/kava-config.ts +63 -0
- package/src/types/kava-event.ts +5 -0
- package/src/types/kava-http-method-type.ts +1 -0
- package/test/.eslintrc +14 -0
- package/test/e2e/kava-event-model.spec.js +286 -0
- package/test/e2e/kava-model.spec.js +140 -0
- package/test/e2e/kava-rate-handler.spec.js +147 -0
- package/test/e2e/kava.spec.js +1409 -0
- package/test/e2e/utils/test-utils.js +45 -0
- package/test/index.js +9 -0
- package/tsconfig-lib.json +10 -0
- package/tsconfig.json +19 -0
- package/webpack.config.js +72 -0
- package/_config.yml +0 -1
package/.eslintignore
ADDED
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"extends": [
|
|
5
|
+
"plugin:prettier/recommended",
|
|
6
|
+
"plugin:@typescript-eslint/recommended",
|
|
7
|
+
"prettier"
|
|
8
|
+
],
|
|
9
|
+
"plugins": [
|
|
10
|
+
"prettier",
|
|
11
|
+
"@typescript-eslint"
|
|
12
|
+
],
|
|
13
|
+
"rules": {
|
|
14
|
+
"max-len": [
|
|
15
|
+
"error",
|
|
16
|
+
{
|
|
17
|
+
"code": 150,
|
|
18
|
+
"ignoreComments": true,
|
|
19
|
+
"ignoreStrings": true,
|
|
20
|
+
"ignoreUrls": true,
|
|
21
|
+
"ignoreTemplateLiterals": true,
|
|
22
|
+
"ignoreRegExpLiterals": true
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"eol-last": "off",
|
|
26
|
+
"prettier/prettier": "error",
|
|
27
|
+
"@typescript-eslint/explicit-function-return-type": "warn",
|
|
28
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
29
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
30
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
31
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
32
|
+
"error",
|
|
33
|
+
{
|
|
34
|
+
"accessibility": "explicit",
|
|
35
|
+
"overrides": {
|
|
36
|
+
"accessors": "explicit",
|
|
37
|
+
"constructors": "no-public",
|
|
38
|
+
"methods": "explicit",
|
|
39
|
+
"properties": "explicit",
|
|
40
|
+
"parameterProperties": "explicit"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"block-scoped-var": "error",
|
|
45
|
+
"arrow-parens": "error",
|
|
46
|
+
"eqeqeq": "error",
|
|
47
|
+
"no-var": "error",
|
|
48
|
+
"no-console": "error",
|
|
49
|
+
"prefer-const": "error",
|
|
50
|
+
"prefer-arrow-callback": "error",
|
|
51
|
+
"no-trailing-spaces": "error",
|
|
52
|
+
"quotes": ["warn", "single", { "avoidEscape": true }]
|
|
53
|
+
},
|
|
54
|
+
"overrides": [],
|
|
55
|
+
"settings": {},
|
|
56
|
+
"env": {
|
|
57
|
+
"browser": true,
|
|
58
|
+
"es6": true
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<!-- If you are raising a bug playing a stream, you must fill out the following or your issue may not be responded to. For features or improvements, you may delete this. -->
|
|
2
|
+
|
|
3
|
+
##### Prerequisites
|
|
4
|
+
|
|
5
|
+
- [ ] Have you checked for duplicate [issues](https://github.com/kaltura/playkit-js/issues): **\_\_**
|
|
6
|
+
- [ ] Which Player [version](https://github.com/kaltura/playkit-js/releases) are you using: **\_\_**
|
|
7
|
+
- [ ] Can you reproduce the issue with our latest release version: **\_\_**
|
|
8
|
+
- [ ] Can you reproduce the issue with the latest code from master: **\_\_**
|
|
9
|
+
- [ ] What browser and OS names and versions are you using: **\_\_**
|
|
10
|
+
- [ ] If applicable, add test code or test page to reproduce:
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
Paste test code here
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
##### Expected behavior
|
|
17
|
+
|
|
18
|
+
What you expected to happen
|
|
19
|
+
|
|
20
|
+
##### Actual behavior
|
|
21
|
+
|
|
22
|
+
What actually happened
|
|
23
|
+
|
|
24
|
+
##### Console output
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Paste the contents of the browser console here.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
For media errors reported on Chrome browser, please also paste the output of chrome://media-internals
|
|
32
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
### Description of the Changes
|
|
2
|
+
|
|
3
|
+
Please add a detailed description of the change, weather it's an enhancement or a bugfix.
|
|
4
|
+
If the PR is related to an open issue please link to it.
|
|
5
|
+
|
|
6
|
+
### CheckLists
|
|
7
|
+
|
|
8
|
+
- [ ] changes have been done against master branch, and PR does not conflict
|
|
9
|
+
- [ ] new unit / functional tests have been added (whenever applicable)
|
|
10
|
+
- [ ] test are passing in local environment
|
|
11
|
+
- [ ] Travis tests are passing (or test results are not worse than on master branch :))
|
|
12
|
+
- [ ] Docs have been updated
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## Canary CI/CD
|
|
2
|
+
name: Canary
|
|
3
|
+
run-name: Canary
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- master
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
canary:
|
|
12
|
+
if: ${{ github.actor != 'PlaykitJs-Bot' }}
|
|
13
|
+
uses: kaltura/playkit-js-common/.github/workflows/canary_plugin.yaml@master
|
|
14
|
+
secrets: inherit
|
|
15
|
+
with:
|
|
16
|
+
node-version: "20.x"
|
|
17
|
+
schema-type: "playerV3Versions"
|
|
18
|
+
tests-yarn-run-to-execute: 'build lint type-check test'
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
## Prod CI
|
|
2
|
+
name: Prod
|
|
3
|
+
run-name: Prod
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
prod:
|
|
10
|
+
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_cicd.yaml@master
|
|
11
|
+
secrets:
|
|
12
|
+
PLAYER_CENTRAL_ACCOUNT_ID: ${{ secrets.PLAYER_CENTRAL_ACCOUNT_ID }}
|
|
13
|
+
PLAYER_SERVICES_ACCOUNT_ID: ${{ secrets.PLAYER_SERVICES_ACCOUNT_ID }}
|
|
14
|
+
PLAYER_S3_BUCKET_DEPLOYMENT: ${{ secrets.PLAYER_S3_BUCKET_DEPLOYMENT }}
|
|
15
|
+
PLAYER_S3_BUCKET_APPS: ${{ secrets.PLAYER_S3_BUCKET_APPS }}
|
|
16
|
+
PLAYER_NPM_TOKEN: ${{ secrets.PLAYER_NPM_TOKEN }}
|
|
17
|
+
PLAYER_LAMBDA_NAME: ${{ secrets.PLAYER_LAMBDA_NAME }}
|
|
18
|
+
PLAYER_MSTEAMS_WEBHOOK: ${{ secrets.PLAYER_MSTEAMS_WEBHOOK }}
|
|
19
|
+
PLAYER_GITHUB_BOT_TOKEN: ${{ secrets.PLAYER_GITHUB_BOT_TOKEN }}
|
|
20
|
+
with:
|
|
21
|
+
node-version: "20.x"
|
|
22
|
+
type: "plugin"
|
|
23
|
+
env: "prod"
|
|
24
|
+
schema-type: "playerV3Versions"
|
|
25
|
+
tests-yarn-run-to-execute: 'build lint type-check test'
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## CI - Player And Plugin Tests
|
|
2
|
+
name: Player And Plugin Tests
|
|
3
|
+
run-name: Player And Plugin Tests
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
branches:
|
|
8
|
+
- "*"
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
|
|
13
|
+
with:
|
|
14
|
+
node-version: '20.x'
|
|
15
|
+
yarn-run-to-execute: 'build'
|
|
16
|
+
test:
|
|
17
|
+
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
|
|
18
|
+
with:
|
|
19
|
+
node-version: '20.x'
|
|
20
|
+
yarn-run-to-execute: 'test'
|
|
21
|
+
type-check:
|
|
22
|
+
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
|
|
23
|
+
with:
|
|
24
|
+
node-version: '20.x'
|
|
25
|
+
yarn-run-to-execute: 'type-check'
|
|
26
|
+
build-types:
|
|
27
|
+
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
|
|
28
|
+
with:
|
|
29
|
+
node-version: '20.x'
|
|
30
|
+
yarn-run-to-execute: 'build:types'
|
|
31
|
+
lint:
|
|
32
|
+
uses: kaltura/ovp-pipelines-pub/.github/workflows/player_tests.yaml@master
|
|
33
|
+
with:
|
|
34
|
+
node-version: '20.x'
|
|
35
|
+
yarn-run-to-execute: 'lint'
|
|
36
|
+
notification:
|
|
37
|
+
if: always()
|
|
38
|
+
uses: kaltura/ovp-pipelines-pub/.github/workflows/notification.yaml@master
|
|
39
|
+
needs: [build, test, type-check, lint]
|
|
40
|
+
secrets:
|
|
41
|
+
PLAYER_MSTEAMS_WEBHOOK: ${{ secrets.PLAYER_MSTEAMS_WEBHOOK }}
|
|
42
|
+
with:
|
|
43
|
+
failure-status: ${{ contains(needs.*.result, 'failure') }}
|
|
44
|
+
cancelled-status: ${{ contains(needs.*.result, 'cancelled') }}
|
|
45
|
+
is-test: 'true'
|
package/.prettierignore
ADDED
package/.prettierrc
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### 1.6.2-canary.0-702048e (2024-03-14)
|
|
6
|
+
|
|
5
7
|
## 1.6.0 (2023-12-21)
|
|
6
8
|
|
|
7
9
|
|
|
@@ -88,7 +90,7 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
88
90
|
|
|
89
91
|
### Features
|
|
90
92
|
|
|
91
|
-
* **FEC-
|
|
93
|
+
* **FEC-11600:** Related grid analytics ([#133](https://github.com/kaltura/playkit-js-kava/issues/133)) ([52dc4b2](https://github.com/kaltura/playkit-js-kava/commit/52dc4b2))
|
|
92
94
|
|
|
93
95
|
|
|
94
96
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
|
|
4
|
+
"bundledPackages": [],
|
|
5
|
+
"compiler": {},
|
|
6
|
+
"apiReport": {
|
|
7
|
+
"enabled": false,
|
|
8
|
+
"reportFolder": "<projectFolder>/api-extractor/report",
|
|
9
|
+
"reportTempFolder": "<projectFolder>/api-extractor/report-temp"
|
|
10
|
+
},
|
|
11
|
+
"docModel": {
|
|
12
|
+
"enabled": false,
|
|
13
|
+
"apiJsonFilePath": "<projectFolder>/api-extractor/<unscopedPackageName>.api.json"
|
|
14
|
+
},
|
|
15
|
+
"dtsRollup": {
|
|
16
|
+
"enabled": true,
|
|
17
|
+
"untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"tsdocMetadata": {},
|
|
20
|
+
"messages": {
|
|
21
|
+
"compilerMessageReporting": {
|
|
22
|
+
"default": {
|
|
23
|
+
"logLevel": "warning"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"extractorMessageReporting": {
|
|
27
|
+
"default": {
|
|
28
|
+
"logLevel": "none"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"tsdocMessageReporting": {
|
|
32
|
+
"default": {
|
|
33
|
+
"logLevel": "none"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
package/demo/index.html
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="theme-color" content="#000000" />
|
|
7
|
+
<meta name="description" content="Kaltura Player Demo Page" />
|
|
8
|
+
<title>Kava</title>
|
|
9
|
+
<script src="https://unpkg.com/@playkit-js/kaltura-player-js@canary/dist/kaltura-ovp-player.js"></script>
|
|
10
|
+
<script src="./playkit-kava.js" type="text/javascript"></script>
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="player-placeholder" style="width: 640px; height: 360px;"></div>
|
|
14
|
+
<script type="text/javascript">
|
|
15
|
+
|
|
16
|
+
const config = {
|
|
17
|
+
log: {
|
|
18
|
+
level: 'DEBUG'
|
|
19
|
+
},
|
|
20
|
+
targetId: 'player-placeholder',
|
|
21
|
+
provider: {
|
|
22
|
+
partnerId: 1091,
|
|
23
|
+
env: {
|
|
24
|
+
cdnUrl: 'https://qa-apache-php7.dev.kaltura.com/',
|
|
25
|
+
serviceUrl: 'https://qa-apache-php7.dev.kaltura.com/api_v3'
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
playback: {
|
|
29
|
+
autoplay: true
|
|
30
|
+
},
|
|
31
|
+
plugins: {
|
|
32
|
+
kava: {}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const player = KalturaPlayer.setup(config);
|
|
37
|
+
player.loadMedia({ entryId: '0_wifqaipd' });
|
|
38
|
+
|
|
39
|
+
</script>
|
|
40
|
+
</body>
|
|
41
|
+
</html>
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { BasePlugin } from '@playkit-js/kaltura-player-js';
|
|
2
|
+
import { KalturaPlayer } from '@playkit-js/kaltura-player-js';
|
|
3
|
+
|
|
4
|
+
export declare const EventType: {
|
|
5
|
+
[event: string]: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export declare const HttpMethodType: KavaHttpMethodType;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {object} KavaConfigobject@typedef {object} KavaConfigobject
|
|
12
|
+
* @property {string} [serviceUrl] - The Kaltura API server.
|
|
13
|
+
* @property {number} [viewEventCountdown] - The interval in seconds that VIEW event will be sent.
|
|
14
|
+
* @property {number} [resetSessionCountdown] - The interval in seconds that Kava session will be reset.
|
|
15
|
+
* @property {number} [dvrThreshold] - Threshold in seconds from the live edge.
|
|
16
|
+
* @property {string} [applicationVersion] - Used to send the application version from which the user is playing the entry.
|
|
17
|
+
* @property {string} [application] - Used to send the application from which the user is playing the entry.
|
|
18
|
+
* @property {string} [kalturaApplicationVersion] - KalturaApplication Used to send the kaltura application name KalturaApplication:(KMC,KMS,KAF,PITCH,KMS_GO,WEBCASTING,PERSONAL_CAPTURE,KME,KME_MOBILE_APP,PATH,LECTURE_CAPTURE,EP,CHAT_AND_COLLABORATION,ANALYTICS,EXPRESS_CAPTURE,KPF,KAF_GO,SITES,STUDIO
|
|
19
|
+
) from which the user is playing the entry.
|
|
20
|
+
* @property {string} [kalturaApplication] - Used to send the kaltura application version from which the user is playing the entry.
|
|
21
|
+
* @property {string} [playbackContext] - Used to send the id of the category from which the user is playing the entry.
|
|
22
|
+
* @property {Function} [tamperAnalyticsHandler] - An optional handler to implement. Can be used to manipulate the model data before analytics event sent, or to cancel a certain analytics request.
|
|
23
|
+
* @property {object} [customVar1] - Custom objects field.
|
|
24
|
+
* @property {object} [customVar2] - Custom objects field.
|
|
25
|
+
* @property {object} [customVar3] - Custom objects field.
|
|
26
|
+
* @property {string} [userId] - custom user id .
|
|
27
|
+
* @example
|
|
28
|
+
* // Default config
|
|
29
|
+
* {
|
|
30
|
+
* serviceUrl: '//analytics.kaltura.com/api_v3/index.php',
|
|
31
|
+
* viewEventCountdown: 30,
|
|
32
|
+
* resetSessionCountdown: 30,
|
|
33
|
+
* dvrThreshold: 120,
|
|
34
|
+
* applicationVersion: '',
|
|
35
|
+
* application: '',
|
|
36
|
+
* kalturaApplicationVersion: '',
|
|
37
|
+
* kalturaApplication: ''
|
|
38
|
+
* playbackContext: ''
|
|
39
|
+
* }
|
|
40
|
+
*/
|
|
41
|
+
declare type KavaConfigObject = {
|
|
42
|
+
serviceUrl?: string;
|
|
43
|
+
tamperAnalyticsHandler?: Function;
|
|
44
|
+
viewEventCountdown?: number;
|
|
45
|
+
resetSessionCountdown?: number;
|
|
46
|
+
dvrThreshold?: number;
|
|
47
|
+
customVar1?: object;
|
|
48
|
+
customVar2?: object;
|
|
49
|
+
customVar3?: object;
|
|
50
|
+
applicationVersion?: string;
|
|
51
|
+
application?: string;
|
|
52
|
+
kalturaApplicationVersion?: string;
|
|
53
|
+
kalturaApplication?: string;
|
|
54
|
+
playbackContext?: string;
|
|
55
|
+
userId?: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
declare type KavaHttpMethodType = {
|
|
59
|
+
[stream: string]: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export declare const NAME: string;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Kaltura Advanced Analytics plugin.
|
|
66
|
+
* @class Kava
|
|
67
|
+
* @param {string} name - The plugin name.
|
|
68
|
+
* @param {Player} player - The player instance.
|
|
69
|
+
* @param {KavaConfigObject} config - The plugin config.
|
|
70
|
+
*/
|
|
71
|
+
declare class Plugin_2 extends BasePlugin {
|
|
72
|
+
private _model;
|
|
73
|
+
private _timer;
|
|
74
|
+
private _rateHandler;
|
|
75
|
+
private _viewEventEnabled;
|
|
76
|
+
private _firstPlayRequestTime;
|
|
77
|
+
private _bufferStartTime;
|
|
78
|
+
private _previousCurrentTime;
|
|
79
|
+
private _isFirstPlay;
|
|
80
|
+
private _isFirstPlaying;
|
|
81
|
+
private _isEnded;
|
|
82
|
+
private _isPaused;
|
|
83
|
+
private _isBuffering;
|
|
84
|
+
private _timePercentEvent;
|
|
85
|
+
private _isPlaying;
|
|
86
|
+
private _loadStartTime;
|
|
87
|
+
private _lastDroppedFrames;
|
|
88
|
+
private _lastTotalFrames;
|
|
89
|
+
private _performanceObserver;
|
|
90
|
+
private _performanceEntries;
|
|
91
|
+
private _pendingFragLoadedUrls;
|
|
92
|
+
private _fragLoadedFiredOnce;
|
|
93
|
+
private _canPlayOccured;
|
|
94
|
+
private _isManualPreload;
|
|
95
|
+
/**
|
|
96
|
+
* Default config of the plugin.
|
|
97
|
+
* @type {Object}
|
|
98
|
+
* @static
|
|
99
|
+
* @memberof Kava
|
|
100
|
+
*/
|
|
101
|
+
static defaultConfig: any;
|
|
102
|
+
/**
|
|
103
|
+
* @static
|
|
104
|
+
* @return {boolean} - Whether the plugin is valid in the current environment.
|
|
105
|
+
* @memberof Kava
|
|
106
|
+
*/
|
|
107
|
+
static isValid(): boolean;
|
|
108
|
+
constructor(name: string, player: KalturaPlayer, config: KavaConfigObject);
|
|
109
|
+
private _updateSoundModeInModel;
|
|
110
|
+
private _updateViewabilityModeInModel;
|
|
111
|
+
private _handleNewPerformanceEntries;
|
|
112
|
+
/**
|
|
113
|
+
* Destroys the plugin.
|
|
114
|
+
* @return {void}
|
|
115
|
+
* @memberof Kava
|
|
116
|
+
* @instance
|
|
117
|
+
*/
|
|
118
|
+
destroy(): void;
|
|
119
|
+
private _reset;
|
|
120
|
+
/**
|
|
121
|
+
* Reset the plugin.
|
|
122
|
+
* @return {void}
|
|
123
|
+
* @memberof Kava
|
|
124
|
+
* @instance
|
|
125
|
+
*/
|
|
126
|
+
reset(): void;
|
|
127
|
+
/**
|
|
128
|
+
* loadMedia of the plugin.
|
|
129
|
+
* @return {void}
|
|
130
|
+
* @memberof Kava
|
|
131
|
+
* @instance
|
|
132
|
+
*/
|
|
133
|
+
loadMedia(): void;
|
|
134
|
+
/**
|
|
135
|
+
* Gets the model object for a certain event.
|
|
136
|
+
* @param {string} event - Event name.
|
|
137
|
+
* @returns {Object} - Model object.
|
|
138
|
+
* @instance
|
|
139
|
+
* @memberof Kava
|
|
140
|
+
* @example
|
|
141
|
+
* const kava = player.plugins.kava;
|
|
142
|
+
* const viewModel = kava.getEventModel(kava.EventType.VIEW);
|
|
143
|
+
* kava.sendAnalytics(viewModel);
|
|
144
|
+
*/
|
|
145
|
+
getEventModel(event: string): any;
|
|
146
|
+
/**
|
|
147
|
+
* @returns {KavaEventType} - The kava events list.
|
|
148
|
+
* @instance
|
|
149
|
+
* @memberof Kava
|
|
150
|
+
*/
|
|
151
|
+
get EventType(): {
|
|
152
|
+
[event: string]: string;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* Sends KAVA analytics event to analytics service.
|
|
156
|
+
* @param {Object} model - Event model.
|
|
157
|
+
* @returns {Promise} - Promise to indicate request succeed or failed.
|
|
158
|
+
* @instance
|
|
159
|
+
* @memberof Kava
|
|
160
|
+
* @example
|
|
161
|
+
* player.plugins.kava.sendAnalytics({...})
|
|
162
|
+
* .then(() => {
|
|
163
|
+
* console.log('kava analytics sent successfully');
|
|
164
|
+
* })
|
|
165
|
+
* .catch(e => {
|
|
166
|
+
* console.log('kava analytics send failed', e);
|
|
167
|
+
* });
|
|
168
|
+
*/
|
|
169
|
+
sendAnalytics(model: any): Promise<void>;
|
|
170
|
+
private _resetFlags;
|
|
171
|
+
private _resetSession;
|
|
172
|
+
private _sendAnalytics;
|
|
173
|
+
private _handleServerResponseSuccess;
|
|
174
|
+
private _handleServerResponseFailed;
|
|
175
|
+
private _addBindings;
|
|
176
|
+
private _bindApplicationEvents;
|
|
177
|
+
private _onFirstPlaying;
|
|
178
|
+
private _onLoadStart;
|
|
179
|
+
private _getRates;
|
|
180
|
+
private _setInitialTracks;
|
|
181
|
+
/**
|
|
182
|
+
* gets the available buffer length
|
|
183
|
+
* @returns {number} the remaining buffer length of the current played time range
|
|
184
|
+
* @private
|
|
185
|
+
*/
|
|
186
|
+
private _getAvailableBuffer;
|
|
187
|
+
/**
|
|
188
|
+
* calculates the forward buffer health ratio
|
|
189
|
+
* @returns {number} the ratio between available buffer and the target buffer
|
|
190
|
+
* @private
|
|
191
|
+
*/
|
|
192
|
+
private _getForwardBufferHealth;
|
|
193
|
+
/**
|
|
194
|
+
* get the target buffer length from the player
|
|
195
|
+
* @returns {number} the target buffer in seconds
|
|
196
|
+
* @private
|
|
197
|
+
*/
|
|
198
|
+
private _getTargetBuffer;
|
|
199
|
+
/**
|
|
200
|
+
* calculates the dropped frames ratio since last call
|
|
201
|
+
* @returns {number} the ratio between dropped frames and the total frames
|
|
202
|
+
* @private
|
|
203
|
+
*/
|
|
204
|
+
private _getDroppedFramesRatio;
|
|
205
|
+
/**
|
|
206
|
+
* returns dropped and total frames from the VideoPlaybackQuality Interface of the browser (if supported)
|
|
207
|
+
* @returns {number} {number} the number of video frames dropped and total video frames (created and dropped)
|
|
208
|
+
* since the creation of the associated HTMLVideoElement
|
|
209
|
+
* @private
|
|
210
|
+
*/
|
|
211
|
+
private _getDroppedAndDecodedFrames;
|
|
212
|
+
private _onReport;
|
|
213
|
+
private _updateNetworkConnectionTypeinModel;
|
|
214
|
+
private _initNetworkConnectionType;
|
|
215
|
+
private _onPlaying;
|
|
216
|
+
private _onCanPlay;
|
|
217
|
+
private _onFirstPlay;
|
|
218
|
+
private _onSourceSelected;
|
|
219
|
+
private _onSeeking;
|
|
220
|
+
private _onPause;
|
|
221
|
+
private _onEnded;
|
|
222
|
+
private _onTimeUpdate;
|
|
223
|
+
private _onFragLoaded;
|
|
224
|
+
private _handleFragPerformanceObserver;
|
|
225
|
+
private _updateMaxNetworkConnectionOverhead;
|
|
226
|
+
private _updateFragLoadedStats;
|
|
227
|
+
private _onManifestLoaded;
|
|
228
|
+
private _onTimedMetadataLoaded;
|
|
229
|
+
private _onVideoTrackChanged;
|
|
230
|
+
private _onAudioTrackChanged;
|
|
231
|
+
private _onTextTrackChanged;
|
|
232
|
+
private _onError;
|
|
233
|
+
private _onPlaybackRateChanged;
|
|
234
|
+
private _onPlayerStateChanged;
|
|
235
|
+
private _onRelatedClicked;
|
|
236
|
+
private _onRelatedSelected;
|
|
237
|
+
private _onShareClicked;
|
|
238
|
+
private _onShareNetworkClicked;
|
|
239
|
+
private _onReportSubmitted;
|
|
240
|
+
private _onReportClicked;
|
|
241
|
+
private _onInfoScreenOpened;
|
|
242
|
+
private _onDownloadItemClicked;
|
|
243
|
+
private _onFullScreenChanged;
|
|
244
|
+
private _updateSessionStartTimeModel;
|
|
245
|
+
private _updateBufferModel;
|
|
246
|
+
private _updatePlayTimeSumModel;
|
|
247
|
+
private _setModelDelegates;
|
|
248
|
+
private _getKalturaApplicationId;
|
|
249
|
+
private _getPosition;
|
|
250
|
+
private _getDeliveryType;
|
|
251
|
+
private _getPlaybackType;
|
|
252
|
+
private _validate;
|
|
253
|
+
private _logMissingParam;
|
|
254
|
+
private static _getTimeDifferenceInSeconds;
|
|
255
|
+
private _updateTabModeInModel;
|
|
256
|
+
private _isTabHidden;
|
|
257
|
+
private _initTabMode;
|
|
258
|
+
}
|
|
259
|
+
export { Plugin_2 as Plugin }
|
|
260
|
+
|
|
261
|
+
export declare const VERSION: string;
|
|
262
|
+
|
|
263
|
+
export { }
|