bitmovin-player-ui 3.76.0 → 3.78.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.
@@ -103,10 +103,10 @@ var Container = /** @class */ (function (_super) {
103
103
  * the DOM, their content gets preserved in all browsers.
104
104
  */
105
105
  var component;
106
- while (component = this.componentsToRemove.shift()) {
106
+ while ((component = this.componentsToRemove.shift()) !== undefined) {
107
107
  component.getDomElement().remove();
108
108
  }
109
- while (component = this.componentsToAdd.shift()) {
109
+ while ((component = this.componentsToAdd.shift()) !== undefined) {
110
110
  this.innerContainerElement.append(component.getDomElement());
111
111
  }
112
112
  };
@@ -49,9 +49,9 @@ var ListSelector = /** @class */ (function (_super) {
49
49
  return _this;
50
50
  }
51
51
  ListSelector.prototype.getItemIndex = function (key) {
52
- for (var index in this.items) {
53
- if (key === this.items[index].key) {
54
- return parseInt(index);
52
+ for (var i = 0; i < this.items.length; i++) {
53
+ if (this.items[i].key === key) {
54
+ return i;
55
55
  }
56
56
  }
57
57
  return -1;
@@ -173,8 +173,7 @@ var PlaybackTimeLabel = /** @class */ (function (_super) {
173
173
  this.setText("".concat(currentTime, " / ").concat(totalTime));
174
174
  break;
175
175
  case PlaybackTimeLabelMode.RemainingTime:
176
- var remainingTime = stringutils_1.StringUtils.secondsToTime(durationSeconds - playbackSeconds, this.timeFormat);
177
- this.setText("".concat(remainingTime));
176
+ this.setText("".concat(stringutils_1.StringUtils.secondsToTime(durationSeconds - playbackSeconds, this.timeFormat)));
178
177
  break;
179
178
  }
180
179
  };
@@ -42,9 +42,11 @@ var SeekBarController = /** @class */ (function () {
42
42
  };
43
43
  SeekBarController.prototype.seekBarControls = function (type) {
44
44
  if (type === SeekBarType.Live) {
45
+ // eslint-disable-next-line @typescript-eslint/unbound-method
45
46
  return this.arrowKeyControls(this.player.getTimeShift(), { min: this.player.getMaxTimeShift(), max: 0 }, this.player.timeShift);
46
47
  }
47
48
  else if (type === SeekBarType.Vod) {
49
+ // eslint-disable-next-line @typescript-eslint/unbound-method
48
50
  return this.arrowKeyControls(this.player.getCurrentTime(), { min: 0, max: this.player.getDuration() }, this.player.seek);
49
51
  }
50
52
  else if (type === SeekBarType.Volume && this.volumeController != null) {
@@ -305,6 +305,7 @@ var SettingsPanel = exports.SettingsPanel = /** @class */ (function (_super) {
305
305
  SettingsPanel.prototype.forceBrowserReflow = function () {
306
306
  // Force the browser to reflow the layout
307
307
  // https://gist.github.com/paulirish/5d52fb081b3570c81e3a
308
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
308
309
  this.getDomElement().get(0).offsetLeft;
309
310
  };
310
311
  /**
@@ -84,6 +84,7 @@ var I18n = /** @class */ (function () {
84
84
  }
85
85
  return matches
86
86
  .map(function (m) { return ({ match: m, key: m.slice(1, -1) }); })
87
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
87
88
  .reduce(function (str, _a) {
88
89
  var key = _a.key, match = _a.match;
89
90
  return config.hasOwnProperty(key) ? str.replace(match, config[key]) : str;
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.ClickOverlay = exports.VolumeControlButton = exports.TitleBar = exports.SubtitleSelectBox = exports.SubtitleOverlay = exports.SeekBarLabel = exports.RecommendationOverlay = exports.ErrorMessageOverlay = exports.Component = exports.CastToggleButton = exports.CastStatusOverlay = exports.AudioTrackSelectBox = exports.AudioQualitySelectBox = exports.Label = exports.Container = exports.UIContainer = exports.Watermark = exports.VRToggleButton = exports.VolumeToggleButton = exports.VideoQualitySelectBox = exports.ToggleButton = exports.SettingsToggleButton = exports.SettingsPanel = exports.ItemSelectionList = exports.SelectBox = exports.SeekBar = exports.PlaybackToggleButton = exports.PlaybackTimeLabelMode = exports.PlaybackTimeLabel = exports.HugePlaybackToggleButton = exports.FullscreenToggleButton = exports.ControlBar = exports.Button = exports.ListOrientation = exports.ListNavigationGroup = exports.RootNavigationGroup = exports.NavigationGroup = exports.SpatialNavigation = exports.I18n = exports.i18n = exports.ErrorUtils = exports.StorageUtils = exports.BrowserUtils = exports.UIUtils = exports.PlayerUtils = exports.StringUtils = exports.ArrayUtils = exports.DemoFactory = exports.UIFactory = exports.version = void 0;
18
18
  exports.ListSelector = exports.QuickSeekButton = exports.ReplayButton = exports.SettingsPanelItem = exports.SubtitleSettingsPanelPage = exports.SettingsPanelPageOpenButton = exports.SettingsPanelPageBackButton = exports.SettingsPanelPage = exports.AudioTrackListBox = exports.SubtitleListBox = exports.ListBox = exports.SubtitleSettingsResetButton = exports.WindowOpacitySelectBox = exports.WindowColorSelectBox = exports.SubtitleSettingsLabel = exports.SubtitleSettingSelectBox = exports.FontSizeSelectBox = exports.FontOpacitySelectBox = exports.FontFamilySelectBox = exports.FontColorSelectBox = exports.CharacterEdgeSelectBox = exports.BackgroundOpacitySelectBox = exports.BackgroundColorSelectBox = exports.Spacer = exports.PictureInPictureToggleButton = exports.VolumeSlider = exports.AirPlayToggleButton = exports.MetadataLabelContent = exports.MetadataLabel = exports.CloseButton = exports.PlaybackToggleOverlay = exports.CastUIContainer = exports.BufferingOverlay = exports.HugeReplayButton = exports.PlaybackSpeedSelectBox = exports.AdClickOverlay = exports.AdMessageLabel = exports.AdSkipButton = void 0;
19
- exports.version = '3.76.0';
19
+ exports.version = '3.78.0';
20
20
  // Management
21
21
  __exportStar(require("./uimanager"), exports);
22
22
  __exportStar(require("./uiconfig"), exports);
@@ -89,6 +89,7 @@ var NavigationGroup = /** @class */ (function () {
89
89
  }
90
90
  return;
91
91
  }
92
+ // eslint-disable-next-line @typescript-eslint/unbound-method
92
93
  this.handleInput(direction, this.defaultNavigationHandler, this.onNavigation);
93
94
  };
94
95
  /**
@@ -97,6 +98,7 @@ var NavigationGroup = /** @class */ (function () {
97
98
  * @param action The action of the event
98
99
  */
99
100
  NavigationGroup.prototype.handleAction = function (action) {
101
+ // eslint-disable-next-line @typescript-eslint/unbound-method
100
102
  this.handleInput(action, this.defaultActionHandler, this.onAction);
101
103
  };
102
104
  /**
@@ -730,6 +730,7 @@ var PlayerWrapper = /** @class */ (function () {
730
730
  var _loop_1 = function (method) {
731
731
  wrapper[method] = function () {
732
732
  // console.log('called ' + member); // track method calls on the player
733
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
733
734
  return player[method].apply(player, arguments);
734
735
  };
735
736
  };
@@ -0,0 +1,49 @@
1
+ // @ts-check
2
+
3
+ import { dirname } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import eslint from '@eslint/js';
6
+ import tseslint from 'typescript-eslint';
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+
10
+ export default tseslint.config({
11
+ files: [
12
+ 'src/**/*.ts',
13
+ 'spec/**/*.ts',
14
+ ],
15
+ extends: [
16
+ eslint.configs.recommended,
17
+ ...tseslint.configs.recommendedTypeChecked,
18
+ {
19
+ languageOptions: {
20
+ parserOptions: {
21
+ projectService: true,
22
+ tsconfigRootDir: __dirname,
23
+ },
24
+ },
25
+ },
26
+ ],
27
+ rules: {
28
+ 'no-prototype-builtins': 'off',
29
+ 'prefer-const': 'off', // TODO: enable rule and run autofix
30
+ 'prefer-rest-params': 'off',
31
+ '@typescript-eslint/ban-ts-comment': 'off',
32
+ '@typescript-eslint/no-explicit-any': 'off',
33
+ '@typescript-eslint/no-namespace': 'off',
34
+ '@typescript-eslint/no-empty-object-type': 'off',
35
+ '@typescript-eslint/no-wrapper-object-types': 'off',
36
+ '@typescript-eslint/no-unused-vars': 'off',
37
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off',
38
+ '@typescript-eslint/no-unsafe-enum-comparison': 'off',
39
+ '@typescript-eslint/no-unsafe-member-access': 'off',
40
+ '@typescript-eslint/no-unsafe-return': 'off',
41
+ '@typescript-eslint/no-unsafe-assignment': 'off',
42
+ '@typescript-eslint/no-unsafe-argument': 'off',
43
+ '@typescript-eslint/no-redundant-type-constituents': 'off',
44
+ '@typescript-eslint/no-floating-promises': 'off',
45
+ '@typescript-eslint/no-unused-expressions': ['error', {
46
+ allowTernary: true,
47
+ }]
48
+ },
49
+ });
package/gulpfile.js CHANGED
@@ -7,7 +7,7 @@ var cssBase64 = require('gulp-css-base64');
7
7
  var postcss = require('gulp-postcss');
8
8
  var uglify = require('gulp-uglify');
9
9
  var rename = require('gulp-rename');
10
- var tslint = require('gulp-tslint');
10
+ var gulpESLintNew = require('gulp-eslint-new');
11
11
  var sassLint = require('gulp-sass-lint');
12
12
  var ts = require('gulp-typescript');
13
13
  var replace = require('gulp-replace');
@@ -29,7 +29,6 @@ var buffer = require('vinyl-buffer');
29
29
  var del = require('del');
30
30
  var browserSync = require('browser-sync');
31
31
  var merge = require('merge2');
32
- var nativeTslint = require('tslint');
33
32
  var npmPackage = require('./package.json');
34
33
  var path = require('path');
35
34
  var combine = require('stream-combiner2');
@@ -93,18 +92,10 @@ gulp.task('copy-json', function() {
93
92
 
94
93
  // TypeScript linting
95
94
  gulp.task('lint-ts', function() {
96
- // The program is required for type checking rules to work: https://palantir.github.io/tslint/usage/type-checking/
97
- var program = nativeTslint.Linter.createProgram("./tsconfig.json");
98
-
99
95
  return gulp.src(paths.source.ts)
100
- .pipe(tslint({
101
- formatter: 'verbose',
102
- program: program,
103
- }))
104
- .pipe(tslint.report({
105
- // Print just the number of errors (instead of printing all errors again)
106
- summarizeFailureOutput: true
107
- }))
96
+ .pipe(gulpESLintNew())
97
+ .pipe(gulpESLintNew.format()) // Output lint results to the console.
98
+ .pipe(gulpESLintNew.failAfterError());
108
99
  });
109
100
 
110
101
  // Sass/SCSS linting
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitmovin-player-ui",
3
- "version": "3.76.0",
3
+ "version": "3.78.0",
4
4
  "description": "Bitmovin Player UI Framework",
5
5
  "main": "./dist/js/framework/main.js",
6
6
  "types": "./dist/js/framework/main.d.ts",
@@ -23,6 +23,7 @@
23
23
  "Firefox ESR"
24
24
  ],
25
25
  "devDependencies": {
26
+ "@eslint/js": "^9.17.0",
26
27
  "@inrupt/jest-jsdom-polyfills": "^1.6.0",
27
28
  "@types/jest": "^29.5.0",
28
29
  "@types/jsdom": "^21.1.0",
@@ -32,8 +33,10 @@
32
33
  "browserify": "^17.0.0",
33
34
  "cssnano": "^5.1.15",
34
35
  "del": "^2.2.2",
36
+ "eslint": "^9.17.0",
35
37
  "gulp": "^4.0.2",
36
38
  "gulp-css-base64": "^2.0.0",
39
+ "gulp-eslint-new": "^2.4.0",
37
40
  "gulp-header": "^2.0.9",
38
41
  "gulp-postcss": "^9.0.1",
39
42
  "gulp-rename": "^2.0.0",
@@ -41,7 +44,6 @@
41
44
  "gulp-sass": "^5.1.0",
42
45
  "gulp-sass-lint": "^1.4.0",
43
46
  "gulp-sourcemaps": "^3.0.0",
44
- "gulp-tslint": "^8.1.4",
45
47
  "gulp-typescript": "^5.0.1",
46
48
  "gulp-uglify": "^3.0.2",
47
49
  "jest": "^29.5.0",
@@ -53,9 +55,9 @@
53
55
  "stream-combiner2": "^1.1.1",
54
56
  "ts-jest": "^29.0.5",
55
57
  "tsify": "^5.0.4",
56
- "tslint": "^5.20.1",
57
58
  "typedoc": "^0.26.5",
58
59
  "typescript": "^5.0.2",
60
+ "typescript-eslint": "^8.18.1",
59
61
  "vinyl-buffer": "^1.0.1",
60
62
  "vinyl-source-stream": "^2.0.0",
61
63
  "watchify": "^4.0.0",
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
1
  type Constructor<T = unknown> = { new (...params: any[]): T };
3
2
  type GenericMock = { [key: string]: jest.Mock };
4
3
 
@@ -1,3 +1,4 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
1
2
  const { defineReleaseVersion } = require('../../.github/scripts/defineVersion');
2
3
 
3
4
  describe('defineReleaseVersion', () => {
@@ -111,11 +111,11 @@ export class Container<Config extends ContainerConfig> extends Component<Config>
111
111
  */
112
112
  let component;
113
113
 
114
- while (component = this.componentsToRemove.shift()) {
114
+ while ((component = this.componentsToRemove.shift()) !== undefined) {
115
115
  component.getDomElement().remove();
116
116
  }
117
117
 
118
- while (component = this.componentsToAdd.shift()) {
118
+ while ((component = this.componentsToAdd.shift()) !== undefined) {
119
119
  this.innerContainerElement.append(component.getDomElement());
120
120
  }
121
121
  }
@@ -77,11 +77,12 @@ export abstract class ListSelector<Config extends ListSelectorConfig> extends Co
77
77
  }
78
78
 
79
79
  private getItemIndex(key: string): number {
80
- for (let index in this.items) {
81
- if (key === this.items[index].key) {
82
- return parseInt(index);
80
+ for (let i = 0; i < this.items.length; i++) {
81
+ if (this.items[i].key === key) {
82
+ return i;
83
83
  }
84
84
  }
85
+
85
86
  return -1;
86
87
  }
87
88
 
@@ -192,8 +192,7 @@ export class PlaybackTimeLabel extends Label<PlaybackTimeLabelConfig> {
192
192
  this.setText(`${currentTime} / ${totalTime}`);
193
193
  break;
194
194
  case PlaybackTimeLabelMode.RemainingTime:
195
- let remainingTime = StringUtils.secondsToTime(durationSeconds - playbackSeconds, this.timeFormat);
196
- this.setText(`${remainingTime}`);
195
+ this.setText(`${StringUtils.secondsToTime(durationSeconds - playbackSeconds, this.timeFormat)}`);
197
196
  break;
198
197
  }
199
198
  }
@@ -70,8 +70,10 @@ export class SeekBarController {
70
70
 
71
71
  protected seekBarControls(type: SeekBarType) {
72
72
  if (type === SeekBarType.Live) {
73
+ // eslint-disable-next-line @typescript-eslint/unbound-method
73
74
  return this.arrowKeyControls(this.player.getTimeShift(), { min: this.player.getMaxTimeShift(), max: 0 }, this.player.timeShift);
74
75
  } else if (type === SeekBarType.Vod) {
76
+ // eslint-disable-next-line @typescript-eslint/unbound-method
75
77
  return this.arrowKeyControls(this.player.getCurrentTime(), { min: 0, max: this.player.getDuration() }, this.player.seek);
76
78
  } else if (type === SeekBarType.Volume && this.volumeController != null) {
77
79
  const volumeTransition = this.volumeController.startTransition();
@@ -367,6 +367,7 @@ export class SettingsPanel extends Container<SettingsPanelConfig> {
367
367
  private forceBrowserReflow(): void {
368
368
  // Force the browser to reflow the layout
369
369
  // https://gist.github.com/paulirish/5d52fb081b3570c81e3a
370
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
370
371
  this.getDomElement().get(0).offsetLeft;
371
372
  }
372
373
 
@@ -80,7 +80,7 @@ export namespace ErrorUtils {
80
80
 
81
81
  if (errorMessage) {
82
82
  // Use the error message text if there is one
83
- return `${errorMessage}\n(${error.name})`; // default error message style
83
+ return `${errorMessage as string}\n(${error.name})`; // default error message style
84
84
  } else {
85
85
  // Fallback to error code/name if no message is defined
86
86
  return `${error.code} ${error.name}`;
@@ -184,6 +184,7 @@ export class I18n {
184
184
 
185
185
  return matches
186
186
  .map((m: string) => ({ match: m, key: m.slice(1, -1) }))
187
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
187
188
  .reduce((str, { key, match }) => config.hasOwnProperty(key) ? str.replace(match, config[key]) : str, text);
188
189
  }
189
190
 
@@ -122,6 +122,8 @@ export class NavigationGroup {
122
122
  }
123
123
  return;
124
124
  }
125
+
126
+ // eslint-disable-next-line @typescript-eslint/unbound-method
125
127
  this.handleInput(direction, this.defaultNavigationHandler, this.onNavigation);
126
128
  }
127
129
 
@@ -131,6 +133,7 @@ export class NavigationGroup {
131
133
  * @param action The action of the event
132
134
  */
133
135
  public handleAction(action: Action): void {
136
+ // eslint-disable-next-line @typescript-eslint/unbound-method
134
137
  this.handleInput(action, this.defaultActionHandler, this.onAction);
135
138
  }
136
139
 
@@ -887,6 +887,7 @@ export class PlayerWrapper {
887
887
  for (let method of methods) {
888
888
  wrapper[method] = function() {
889
889
  // console.log('called ' + member); // track method calls on the player
890
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
890
891
  return (<any>player)[method].apply(player, arguments);
891
892
  };
892
893
  }
package/tsconfig.json CHANGED
@@ -8,6 +8,7 @@
8
8
  "declaration": true,
9
9
  "outDir": "dist/js/framework",
10
10
  "lib": ["es6", "dom", "scripthost"],
11
+ "skipLibCheck": true,
11
12
  // To be able to import Json Files.
12
13
  "resolveJsonModule": true,
13
14
  "esModuleInterop": true
package/tslint.json DELETED
@@ -1,39 +0,0 @@
1
- {
2
- "rules": {
3
- "class-name": true,
4
- "comment-format": [true, "check-space"],
5
- "indent": [true, "spaces"],
6
- "no-duplicate-variable": true,
7
- "no-eval": true,
8
- "no-internal-module": true,
9
- "no-trailing-whitespace": true,
10
- "no-var-keyword": false,
11
- "one-line": [true, "check-open-brace", "check-whitespace"],
12
- "quotemark": [true, "single"],
13
- "semicolon": [true, "always", "ignore-bound-class-methods"],
14
- "triple-equals": [true, "allow-null-check"],
15
- "typedef-whitespace": [true, {
16
- "call-signature": "nospace",
17
- "index-signature": "nospace",
18
- "parameter": "nospace",
19
- "property-declaration": "nospace",
20
- "variable-declaration": "nospace"
21
- }],
22
- "variable-name": [true, "ban-keywords"],
23
- "whitespace": [true,
24
- "check-branch",
25
- "check-decl",
26
- "check-operator",
27
- "check-separator",
28
- "check-type"
29
- ],
30
- "trailing-comma": [true, {"multiline": {
31
- "arrays": "always",
32
- "exports": "always",
33
- "functions": "always",
34
- "imports": "always",
35
- "objects": "always",
36
- "typeLiterals": "always"
37
- }, "singleline": "never"}]
38
- }
39
- }