@clickview/player 1.2.1-dev.3 → 1.2.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 +134 -63
- package/dist/interactive-player.js +124 -2
- package/dist/player.css +68 -30
- package/dist/player.js +31 -2
- package/jest.config.js +12 -12
- package/package.json +6 -8
- 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/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
- package/dist/interactive-player.js.LICENSE.txt +0 -157
- package/dist/player.js.LICENSE.txt +0 -15
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clickview/player",
|
|
3
|
-
"version": "1.2.1-
|
|
3
|
+
"version": "1.2.1-rc.0",
|
|
4
4
|
"description": "ClickView Player",
|
|
5
5
|
"main": "dist/player-app.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,11 +26,9 @@
|
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "7.11.6",
|
|
29
|
-
"@clickview/eslint-config": "1.
|
|
29
|
+
"@clickview/eslint-config": "1.0.1",
|
|
30
30
|
"@clickview/player-font": "0.0.12",
|
|
31
|
-
"@storybook/
|
|
32
|
-
"@storybook/manager-webpack5": "6.4.22",
|
|
33
|
-
"@storybook/react": "6.4.22",
|
|
31
|
+
"@storybook/react": "6.0.26",
|
|
34
32
|
"@types/chromecast-caf-sender": "1.0.3",
|
|
35
33
|
"@types/cropperjs": "1.3.0",
|
|
36
34
|
"@types/draft-js": "0.10.44",
|
|
@@ -40,10 +38,10 @@
|
|
|
40
38
|
"@types/video.js": "7.3.11",
|
|
41
39
|
"jest": "26.1.0",
|
|
42
40
|
"ts-jest": "26.1.4",
|
|
43
|
-
"webpack-dev-server": "
|
|
41
|
+
"webpack-dev-server": "3.11.0"
|
|
44
42
|
},
|
|
45
43
|
"dependencies": {
|
|
46
|
-
"@clickview/styles": "1.
|
|
44
|
+
"@clickview/styles": "1.3.1-rc.0",
|
|
47
45
|
"@microsoft/signalr": "5.0.2",
|
|
48
46
|
"cropperjs": "1.5.6",
|
|
49
47
|
"draft-convert": "2.1.10",
|
|
@@ -55,7 +53,7 @@
|
|
|
55
53
|
"react-textarea-autosize": "8.3.2",
|
|
56
54
|
"simplebar": "5.3.0",
|
|
57
55
|
"simplebar-react": "2.3.0",
|
|
58
|
-
"video.js": "7.
|
|
56
|
+
"video.js": "7.11.2",
|
|
59
57
|
"videojs-contrib-quality-levels": "2.0.9"
|
|
60
58
|
},
|
|
61
59
|
"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 var __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
|
+
}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
object-assign
|
|
3
|
-
(c) Sindre Sorhus
|
|
4
|
-
@license MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/*!
|
|
8
|
-
Copyright (c) 2018 Jed Watson.
|
|
9
|
-
Licensed under the MIT License (MIT), see
|
|
10
|
-
http://jedwatson.github.io/classnames
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/*!
|
|
14
|
-
Copyright (c) 2017 Jed Watson.
|
|
15
|
-
Licensed under the MIT License (MIT), see
|
|
16
|
-
http://jedwatson.github.io/classnames
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/*!
|
|
20
|
-
* Cropper.js v1.5.6
|
|
21
|
-
* https://fengyuanchen.github.io/cropperjs
|
|
22
|
-
*
|
|
23
|
-
* Copyright 2015-present Chen Fengyuan
|
|
24
|
-
* Released under the MIT license
|
|
25
|
-
*
|
|
26
|
-
* Date: 2019-10-04T04:33:48.372Z
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/*!
|
|
30
|
-
* Programatically add the following
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
/*!
|
|
34
|
-
* Sizzle CSS Selector Engine v2.3.4
|
|
35
|
-
* https://sizzlejs.com/
|
|
36
|
-
*
|
|
37
|
-
* Copyright JS Foundation and other contributors
|
|
38
|
-
* Released under the MIT license
|
|
39
|
-
* https://js.foundation/
|
|
40
|
-
*
|
|
41
|
-
* Date: 2019-04-08
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
/*!
|
|
45
|
-
* jQuery JavaScript Library v3.4.1
|
|
46
|
-
* https://jquery.com/
|
|
47
|
-
*
|
|
48
|
-
* Includes Sizzle.js
|
|
49
|
-
* https://sizzlejs.com/
|
|
50
|
-
*
|
|
51
|
-
* Copyright JS Foundation and other contributors
|
|
52
|
-
* Released under the MIT license
|
|
53
|
-
* https://jquery.org/license
|
|
54
|
-
*
|
|
55
|
-
* Date: 2019-05-01T21:04Z
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
/*! @name @videojs/http-streaming @version 2.8.2 @license Apache-2.0 */
|
|
59
|
-
|
|
60
|
-
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
|
|
61
|
-
|
|
62
|
-
/*! @name m3u8-parser @version 4.7.0 @license Apache-2.0 */
|
|
63
|
-
|
|
64
|
-
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
|
65
|
-
|
|
66
|
-
/*! @name videojs-contrib-quality-levels @version 2.0.9 @license Apache-2.0 */
|
|
67
|
-
|
|
68
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @license React
|
|
72
|
-
* react-dom-server-legacy.browser.production.min.js
|
|
73
|
-
*
|
|
74
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
75
|
-
*
|
|
76
|
-
* This source code is licensed under the MIT license found in the
|
|
77
|
-
* LICENSE file in the root directory of this source tree.
|
|
78
|
-
*/
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @license React
|
|
82
|
-
* react-dom-server.browser.production.min.js
|
|
83
|
-
*
|
|
84
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
85
|
-
*
|
|
86
|
-
* This source code is licensed under the MIT license found in the
|
|
87
|
-
* LICENSE file in the root directory of this source tree.
|
|
88
|
-
*/
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @license React
|
|
92
|
-
* react-dom.production.min.js
|
|
93
|
-
*
|
|
94
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
95
|
-
*
|
|
96
|
-
* This source code is licensed under the MIT license found in the
|
|
97
|
-
* LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* @license React
|
|
102
|
-
* react-is.production.min.js
|
|
103
|
-
*
|
|
104
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
105
|
-
*
|
|
106
|
-
* This source code is licensed under the MIT license found in the
|
|
107
|
-
* LICENSE file in the root directory of this source tree.
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @license React
|
|
112
|
-
* react.production.min.js
|
|
113
|
-
*
|
|
114
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
115
|
-
*
|
|
116
|
-
* This source code is licensed under the MIT license found in the
|
|
117
|
-
* LICENSE file in the root directory of this source tree.
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* @license React
|
|
122
|
-
* scheduler.production.min.js
|
|
123
|
-
*
|
|
124
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
125
|
-
*
|
|
126
|
-
* This source code is licensed under the MIT license found in the
|
|
127
|
-
* LICENSE file in the root directory of this source tree.
|
|
128
|
-
*/
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* @license React
|
|
132
|
-
* use-sync-external-store-shim.production.min.js
|
|
133
|
-
*
|
|
134
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
135
|
-
*
|
|
136
|
-
* This source code is licensed under the MIT license found in the
|
|
137
|
-
* LICENSE file in the root directory of this source tree.
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* @license React
|
|
142
|
-
* use-sync-external-store-shim/with-selector.production.min.js
|
|
143
|
-
*
|
|
144
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
145
|
-
*
|
|
146
|
-
* This source code is licensed under the MIT license found in the
|
|
147
|
-
* LICENSE file in the root directory of this source tree.
|
|
148
|
-
*/
|
|
149
|
-
|
|
150
|
-
/** @license React v16.13.1
|
|
151
|
-
* react-is.production.min.js
|
|
152
|
-
*
|
|
153
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the MIT license found in the
|
|
156
|
-
* LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Programatically add the following
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/*! @name @videojs/http-streaming @version 2.8.2 @license Apache-2.0 */
|
|
6
|
-
|
|
7
|
-
/*! @name aes-decrypter @version 3.1.2 @license Apache-2.0 */
|
|
8
|
-
|
|
9
|
-
/*! @name m3u8-parser @version 4.7.0 @license Apache-2.0 */
|
|
10
|
-
|
|
11
|
-
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
|
|
12
|
-
|
|
13
|
-
/*! @name videojs-contrib-quality-levels @version 2.0.9 @license Apache-2.0 */
|
|
14
|
-
|
|
15
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|