@clickview/player 1.3.0-rc.0 → 1.3.1-rc.0
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/.eslintrc.json +2 -2
- package/dist/en.json +1 -1
- package/dist/interactive-player.css +59 -130
- package/dist/interactive-player.js +1 -1
- package/dist/interactive-player.js.LICENSE.txt +52 -8
- package/dist/player.css +38 -72
- package/dist/player.js +1 -1
- package/dist/player.js.LICENSE.txt +3 -3
- package/jest.config.js +12 -12
- package/package.json +9 -10
- package/test/players/test-player.ts +31 -31
- package/test/setupTests.ts +7 -7
- package/test/utils/test-helpers.ts +21 -21
- package/typings/libs/cloneDeep.d.ts +5 -0
- package/typings/libs/draft-convert.d.ts +3 -3
- package/typings/libs/videojs-contrib-quality-levels.d.ts +28 -28
- package/typings/utils/globals.d.ts +1 -1
- package/typings/utils/imports.d.ts +12 -12
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Programatically add the following
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
/*! @name @videojs/http-streaming @version 2.
|
|
5
|
+
/*! @name @videojs/http-streaming @version 2.8.2 @license Apache-2.0 */
|
|
6
6
|
|
|
7
|
-
/*! @name
|
|
7
|
+
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
|
|
8
8
|
|
|
9
|
-
/*! @name
|
|
9
|
+
/*! @name m3u8-parser @version 4.7.0 @license Apache-2.0 */
|
|
10
10
|
|
|
11
11
|
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
|
12
12
|
|
package/jest.config.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const getBaseConfig = require('../../libs/testing/jest.base.config');
|
|
2
|
-
const { compilerOptions } = require('./tsconfig');
|
|
3
|
-
|
|
4
|
-
const paths = { ...compilerOptions.paths };
|
|
5
|
-
|
|
6
|
-
delete paths['*'];
|
|
7
|
-
|
|
8
|
-
const baseConfig = getBaseConfig(paths);
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
...baseConfig,
|
|
12
|
-
setupFilesAfterEnv: [...baseConfig.setupFilesAfterEnv, './test/setupTests.ts'],
|
|
1
|
+
const getBaseConfig = require('../../libs/testing/jest.base.config');
|
|
2
|
+
const { compilerOptions } = require('./tsconfig');
|
|
3
|
+
|
|
4
|
+
const paths = { ...compilerOptions.paths };
|
|
5
|
+
|
|
6
|
+
delete paths['*'];
|
|
7
|
+
|
|
8
|
+
const baseConfig = getBaseConfig(paths);
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
...baseConfig,
|
|
12
|
+
setupFilesAfterEnv: [...baseConfig.setupFilesAfterEnv, './test/setupTests.ts'],
|
|
13
13
|
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clickview/player",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1-rc.0",
|
|
4
4
|
"description": "ClickView Player",
|
|
5
5
|
"main": "dist/player-app.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"start": "
|
|
8
|
-
"build": "
|
|
9
|
-
"build-font": "
|
|
10
|
-
"build-docker": "export NODE_ENV=production&& webpack --config ./tooling/webpack.config.js",
|
|
7
|
+
"start": "cross-env NODE_ENV=development webpack -w --config ./tooling/webpack.config.js",
|
|
8
|
+
"build": "cross-env NODE_ENV=production webpack --config ./tooling/webpack.config.js",
|
|
9
|
+
"build-font": "cross-env NODE_ENV=development npm run start",
|
|
11
10
|
"storybook": "start-storybook -s ./.storybook/stories/assets -p 6006",
|
|
12
11
|
"build-storybook": "build-storybook",
|
|
13
12
|
"test": "jest",
|
|
14
13
|
"test-watch": "jest --watch",
|
|
15
|
-
"webpack-dev-server": "
|
|
14
|
+
"webpack-dev-server": "cross-env NODE_ENV=development webpack-dev-server --config ./tooling/webpack.config.js"
|
|
16
15
|
},
|
|
17
16
|
"repository": {
|
|
18
17
|
"type": "git",
|
|
@@ -26,8 +25,8 @@
|
|
|
26
25
|
"license": "ISC",
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"@babel/core": "7.11.6",
|
|
29
|
-
"@clickview/eslint-config": "1.
|
|
30
|
-
"@clickview/player-font": "0.0.
|
|
28
|
+
"@clickview/eslint-config": "1.1.1",
|
|
29
|
+
"@clickview/player-font": "0.0.13",
|
|
31
30
|
"@storybook/builder-webpack5": "6.4.22",
|
|
32
31
|
"@storybook/manager-webpack5": "6.4.22",
|
|
33
32
|
"@storybook/react": "6.4.22",
|
|
@@ -43,7 +42,7 @@
|
|
|
43
42
|
"webpack-dev-server": "4.8.1"
|
|
44
43
|
},
|
|
45
44
|
"dependencies": {
|
|
46
|
-
"@clickview/styles": "1.
|
|
45
|
+
"@clickview/styles": "1.10.1-dev.1",
|
|
47
46
|
"@microsoft/signalr": "5.0.2",
|
|
48
47
|
"cropperjs": "1.5.6",
|
|
49
48
|
"draft-convert": "2.1.10",
|
|
@@ -55,7 +54,7 @@
|
|
|
55
54
|
"react-textarea-autosize": "8.3.2",
|
|
56
55
|
"simplebar": "5.3.0",
|
|
57
56
|
"simplebar-react": "2.3.0",
|
|
58
|
-
"video.js": "7.
|
|
57
|
+
"video.js": "7.12.4",
|
|
59
58
|
"videojs-contrib-quality-levels": "2.0.9"
|
|
60
59
|
},
|
|
61
60
|
"babel": {
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { VideoJsPlayer } from 'video.js';
|
|
2
|
-
import { BasePlayer, BasePlayerOptions } from '../../src/players/base-player';
|
|
3
|
-
|
|
4
|
-
export interface TestPlayerOptions extends BasePlayerOptions {
|
|
5
|
-
configurePlugins?: (player: VideoJsPlayer) => void;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export class TestPlayer extends BasePlayer {
|
|
9
|
-
protected options: TestPlayerOptions;
|
|
10
|
-
|
|
11
|
-
public player: VideoJsPlayer;
|
|
12
|
-
|
|
13
|
-
constructor(id: string | Element, options: TestPlayerOptions) {
|
|
14
|
-
super(id, options);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* TODO: Look at reimplementing this. At the moment it's causing
|
|
19
|
-
* problems because the test will dispose of the player before the
|
|
20
|
-
* fetch has completed.
|
|
21
|
-
*/
|
|
22
|
-
protected async fetch(): Promise<void> {
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
protected configurePlugins(): void {
|
|
26
|
-
if (!(typeof this.options.configurePlugins === 'function'))
|
|
27
|
-
return;
|
|
28
|
-
|
|
29
|
-
this.options.configurePlugins(this.player);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
1
|
+
import { VideoJsPlayer } from 'video.js';
|
|
2
|
+
import { BasePlayer, BasePlayerOptions } from '../../src/players/base-player';
|
|
3
|
+
|
|
4
|
+
export interface TestPlayerOptions extends BasePlayerOptions {
|
|
5
|
+
configurePlugins?: (player: VideoJsPlayer) => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class TestPlayer extends BasePlayer {
|
|
9
|
+
protected options: TestPlayerOptions;
|
|
10
|
+
|
|
11
|
+
public player: VideoJsPlayer;
|
|
12
|
+
|
|
13
|
+
constructor(id: string | Element, options: TestPlayerOptions) {
|
|
14
|
+
super(id, options);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* TODO: Look at reimplementing this. At the moment it's causing
|
|
19
|
+
* problems because the test will dispose of the player before the
|
|
20
|
+
* fetch has completed.
|
|
21
|
+
*/
|
|
22
|
+
protected async fetch(): Promise<void> {
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
protected configurePlugins(): void {
|
|
26
|
+
if (!(typeof this.options.configurePlugins === 'function'))
|
|
27
|
+
return;
|
|
28
|
+
|
|
29
|
+
this.options.configurePlugins(this.player);
|
|
30
|
+
}
|
|
31
|
+
}
|
package/test/setupTests.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Media playback isn't supported by the DOM provided by Jest
|
|
3
|
-
* so we mock the following functions.
|
|
4
|
-
*/
|
|
5
|
-
window.HTMLMediaElement.prototype.load = () => { };
|
|
6
|
-
window.HTMLMediaElement.prototype.play = (() => { }) as any;
|
|
7
|
-
window.HTMLMediaElement.prototype.pause = () => { };
|
|
1
|
+
/**
|
|
2
|
+
* Media playback isn't supported by the DOM provided by Jest
|
|
3
|
+
* so we mock the following functions.
|
|
4
|
+
*/
|
|
5
|
+
window.HTMLMediaElement.prototype.load = () => { };
|
|
6
|
+
window.HTMLMediaElement.prototype.play = (() => { }) as any;
|
|
7
|
+
window.HTMLMediaElement.prototype.pause = () => { };
|
|
8
8
|
window.HTMLMediaElement.prototype.addTextTrack = (() => { }) as any;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { TestPlayer, TestPlayerOptions } from '../players/test-player';
|
|
2
|
-
|
|
3
|
-
interface PlayerOptions extends Omit<TestPlayerOptions, 'viewKey'> { }
|
|
4
|
-
|
|
5
|
-
export const TestHelpers = {
|
|
6
|
-
makeEl(): HTMLElement {
|
|
7
|
-
const el = document.createElement('div');
|
|
8
|
-
el.id = 'test-player';
|
|
9
|
-
return el;
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
makePlayer(playerOptions?: PlayerOptions, containerEl?: HTMLElement): TestPlayer {
|
|
13
|
-
containerEl = containerEl || TestHelpers.makeEl();
|
|
14
|
-
|
|
15
|
-
document.body.innerHTML = '';
|
|
16
|
-
document.body.appendChild(containerEl);
|
|
17
|
-
|
|
18
|
-
playerOptions = playerOptions || {};
|
|
19
|
-
|
|
20
|
-
return new TestPlayer(containerEl, playerOptions as TestPlayerOptions);
|
|
21
|
-
}
|
|
1
|
+
import { TestPlayer, TestPlayerOptions } from '../players/test-player';
|
|
2
|
+
|
|
3
|
+
interface PlayerOptions extends Omit<TestPlayerOptions, 'viewKey'> { }
|
|
4
|
+
|
|
5
|
+
export const TestHelpers = {
|
|
6
|
+
makeEl(): HTMLElement {
|
|
7
|
+
const el = document.createElement('div');
|
|
8
|
+
el.id = 'test-player';
|
|
9
|
+
return el;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
makePlayer(playerOptions?: PlayerOptions, containerEl?: HTMLElement): TestPlayer {
|
|
13
|
+
containerEl = containerEl || TestHelpers.makeEl();
|
|
14
|
+
|
|
15
|
+
document.body.innerHTML = '';
|
|
16
|
+
document.body.appendChild(containerEl);
|
|
17
|
+
|
|
18
|
+
playerOptions = playerOptions || {};
|
|
19
|
+
|
|
20
|
+
return new TestPlayer(containerEl, playerOptions as TestPlayerOptions);
|
|
21
|
+
}
|
|
22
22
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare module 'draft-convert' {
|
|
2
|
-
export const convertFromHTML: (options: any) => (html: string) => any;
|
|
3
|
-
export const convertToHTML: (options: any) => (draftJsContent: any) => string;
|
|
1
|
+
declare module 'draft-convert' {
|
|
2
|
+
export const convertFromHTML: (options: any) => (html: string) => any;
|
|
3
|
+
export const convertToHTML: (options: any) => (draftJsContent: any) => string;
|
|
4
4
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import videojs from 'video.js';
|
|
2
|
-
|
|
3
|
-
declare module 'video.js' {
|
|
4
|
-
export interface VideoJsPlayer {
|
|
5
|
-
qualityLevels(): QualityLevelList;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare module 'videojs-contrib-quality-levels' {
|
|
10
|
-
export interface QualityLevelList extends videojs.EventTarget {
|
|
11
|
-
[id: string]: QualityLevel;
|
|
12
|
-
selectedIndex: number;
|
|
13
|
-
length: number;
|
|
14
|
-
addQualityLevel(representation: Representation): QualityLevel;
|
|
15
|
-
removeQualityLevel(qualityLevel: QualityLevel): QualityLevel;
|
|
16
|
-
getQualityLevelById(id: string): QualityLevel;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface QualityLevel {
|
|
20
|
-
id: string;
|
|
21
|
-
label: string;
|
|
22
|
-
enabled: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface Representation {
|
|
26
|
-
id: string;
|
|
27
|
-
enabled(enabled: boolean): boolean;
|
|
28
|
-
}
|
|
1
|
+
import videojs from 'video.js';
|
|
2
|
+
|
|
3
|
+
declare module 'video.js' {
|
|
4
|
+
export interface VideoJsPlayer {
|
|
5
|
+
qualityLevels(): QualityLevelList;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare module 'videojs-contrib-quality-levels' {
|
|
10
|
+
export interface QualityLevelList extends videojs.EventTarget {
|
|
11
|
+
[id: string]: QualityLevel;
|
|
12
|
+
selectedIndex: number;
|
|
13
|
+
length: number;
|
|
14
|
+
addQualityLevel(representation: Representation): QualityLevel;
|
|
15
|
+
removeQualityLevel(qualityLevel: QualityLevel): QualityLevel;
|
|
16
|
+
getQualityLevelById(id: string): QualityLevel;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface QualityLevel {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface Representation {
|
|
26
|
+
id: string;
|
|
27
|
+
enabled(enabled: boolean): boolean;
|
|
28
|
+
}
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare let __ENVIRONMENT__: 'development' | 'production';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define our templates as a module so that we can use
|
|
3
|
-
* import statements just the same as we do for other
|
|
4
|
-
* ts/js code.
|
|
5
|
-
*/
|
|
6
|
-
declare module '*.scss';
|
|
7
|
-
declare module '*.svg';
|
|
8
|
-
|
|
9
|
-
declare module '*.json' {
|
|
10
|
-
export const value: any;
|
|
11
|
-
export default value;
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Define our templates as a module so that we can use
|
|
3
|
+
* import statements just the same as we do for other
|
|
4
|
+
* ts/js code.
|
|
5
|
+
*/
|
|
6
|
+
declare module '*.scss';
|
|
7
|
+
declare module '*.svg';
|
|
8
|
+
|
|
9
|
+
declare module '*.json' {
|
|
10
|
+
export const value: any;
|
|
11
|
+
export default value;
|
|
12
|
+
}
|