fix(vjs-player): replace HLS quality plugin and add plugin guards

Swap videojs-hls-quality-selector for videojs-quality-selector-hls
and update package versions. Initialize plugins defensively: call the
new quality selector via qualitySelectorHls when available and wrap
both quality selector and aspectRatioPanel initializations in try/catch
blocks to avoid runtime errors if a plugin fails to load. Bump project
version to 0.18.0 and add the new dependency and packageManager entry.
This commit is contained in:
4gray committed 2026-01-13 19:50:36 +01:00
1 parent 1bbad6920a
commit 8662fa90c6
4 files changed
+38 -46

No files matched your search

@@ -12,7 +12,7 @@ import {
import '@yangkghjh/videojs-aspect-ratio-panel';
import videoJs from 'video.js';
import 'videojs-contrib-quality-levels';
import 'videojs-hls-quality-selector';
import 'videojs-quality-selector-hls';
/**
* This component contains the implementation of video player that is based on video.js library
@@ -56,10 +56,22 @@ export class VjsPlayerComponent implements OnInit, OnChanges, OnDestroy {
});
}
);
this.player.hlsQualitySelector({
displayCurrentQuality: true,
});
this.player['aspectRatioPanel']();
try {
if (typeof this.player.qualitySelectorHls === 'function') {
this.player.qualitySelectorHls({
displayCurrentQuality: true,
});
}
} catch (e) {
console.warn('qualitySelectorHls plugin failed to initialize:', e);
}
try {
if (typeof this.player['aspectRatioPanel'] === 'function') {
this.player['aspectRatioPanel']();
}
} catch (e) {
console.warn('aspectRatioPanel plugin failed to initialize:', e);
}
}
/**
+11 -21
View File
@@ -1,12 +1,12 @@
{
"name": "iptvnator",
"version": "0.17.1",
"version": "0.18.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "iptvnator",
"version": "0.17.1",
"version": "0.18.0",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
@@ -53,7 +53,7 @@
"uuid": "9.0.0",
"video.js": "8.23.4",
"videojs-contrib-quality-levels": "4.1.0",
"videojs-hls-quality-selector": "2.0.0",
"videojs-quality-selector-hls": "1.1.1",
"zone.js": "~0.15.1"
},
"devDependencies": {
@@ -105,7 +105,6 @@
"@types/node": "20.19.9",
"@types/uuid": "^10.0.0",
"@types/video.js": "7.3.29",
"@types/videojs-hls-quality-selector": "1.1.0",
"@typescript-eslint/eslint-plugin": "^8.46.2",
"@typescript-eslint/parser": "^8.46.2",
"@typescript-eslint/utils": "^8.46.2",
@@ -12814,16 +12813,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/videojs-hls-quality-selector": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@types/videojs-hls-quality-selector/-/videojs-hls-quality-selector-1.1.0.tgz",
"integrity": "sha512-ZArUmr6fsd+KMb10B7F5B/eLZrw+J50DwY892NQdrkGx8hIrplVRyrWXMlzn6Khk6Bu2IMJcG91+xZHysYukZA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/video.js": "*"
}
},
"node_modules/@types/ws": {
"version": "8.18.1",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
@@ -38489,18 +38478,19 @@
"integrity": "sha512-YPq+wiKoGy2/M7ccjmlvwi58z2xsykkkfNMyIg4xb7EZQQNwB71hcSsB3o75CqQV7/y5lXkXhI/rsGAS7jfEmQ==",
"license": "Apache-2.0"
},
"node_modules/videojs-hls-quality-selector": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/videojs-hls-quality-selector/-/videojs-hls-quality-selector-2.0.0.tgz",
"integrity": "sha512-x0AQKGwryDdD94s1it+Jolb6j1mg4Q+c7g1PlCIG6dXBdipVPaZmg71fxaFZJgx1k326DFnRaWrLxQ72/TKd2A==",
"node_modules/videojs-quality-selector-hls": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/videojs-quality-selector-hls/-/videojs-quality-selector-hls-1.1.1.tgz",
"integrity": "sha512-GR7Bs/pL4nioq+jlSASqy4nUlnnmY7NnjXY6vBPlmBJA7OuYD80ceyejuCbNeaXX7cC11WOtKTeC8QBJcKuMtA==",
"license": "MIT",
"dependencies": {
"global": "^4.4.0",
"video.js": "^8"
"video.js": "^8.3.0",
"videojs-contrib-quality-levels": "^4.0.0"
},
"engines": {
"node": ">=14",
"npm": ">=6"
"node": ">=18",
"npm": ">=9"
}
},
"node_modules/videojs-vtt.js": {
+2 -3
View File
@@ -23,7 +23,7 @@
"postinstall": "electron-builder install-app-deps",
"build:frontend": "nx build web",
"build:frontend:pwa": "nx build web --configuration=pwa",
"build:backend": "nx build electron-backend",
"build:backend": "nx build electron-backend --configuration=production",
"serve:frontend": "nx serve web --no-tui",
"serve:frontend:pwa": "nx serve web --configuration=pwa --no-tui",
"serve:backend": "nx serve electron-backend",
@@ -77,7 +77,7 @@
"uuid": "9.0.0",
"video.js": "8.23.4",
"videojs-contrib-quality-levels": "4.1.0",
"videojs-hls-quality-selector": "2.0.0",
"videojs-quality-selector-hls": "1.1.1",
"zone.js": "~0.15.1"
},
"devDependencies": {
@@ -129,7 +129,6 @@
"@types/node": "20.19.9",
"@types/uuid": "^10.0.0",
"@types/video.js": "7.3.29",
"@types/videojs-hls-quality-selector": "1.1.0",
"@typescript-eslint/eslint-plugin": "^8.46.2",
"@typescript-eslint/parser": "^8.46.2",
"@typescript-eslint/utils": "^8.46.2",
+8 -17
View File
@@ -137,9 +137,9 @@ importers:
videojs-contrib-quality-levels:
specifier: 4.1.0
version: 4.1.0(video.js@8.23.4)
videojs-hls-quality-selector:
specifier: 2.0.0
version: 2.0.0
videojs-quality-selector-hls:
specifier: 1.1.1
version: 1.1.1
zone.js:
specifier: ~0.15.1
version: 0.15.1
@@ -267,9 +267,6 @@ importers:
'@types/video.js':
specifier: 7.3.29
version: 7.3.29
'@types/videojs-hls-quality-selector':
specifier: 1.1.0
version: 1.1.0
'@typescript-eslint/eslint-plugin':
specifier: ^8.46.2
version: 8.51.0(@typescript-eslint/parser@8.51.0(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3))(eslint@9.39.2(jiti@2.6.1))(typescript@5.9.3)
@@ -3822,9 +3819,6 @@ packages:
'@types/video.js@7.3.29':
resolution: {integrity: sha512-7xP5O3tQC6dm5xljwwvDvMKTumlu/cag4k5FwezMUazoCAbni0t3NB5ToavQlNAH5OKLLP3/ZEJbPqP6ShocIA==}
'@types/videojs-hls-quality-selector@1.1.0':
resolution: {integrity: sha512-ZArUmr6fsd+KMb10B7F5B/eLZrw+J50DwY892NQdrkGx8hIrplVRyrWXMlzn6Khk6Bu2IMJcG91+xZHysYukZA==}
'@types/ws@8.18.1':
resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==}
@@ -9976,9 +9970,9 @@ packages:
videojs-font@4.2.0:
resolution: {integrity: sha512-YPq+wiKoGy2/M7ccjmlvwi58z2xsykkkfNMyIg4xb7EZQQNwB71hcSsB3o75CqQV7/y5lXkXhI/rsGAS7jfEmQ==}
videojs-hls-quality-selector@2.0.0:
resolution: {integrity: sha512-x0AQKGwryDdD94s1it+Jolb6j1mg4Q+c7g1PlCIG6dXBdipVPaZmg71fxaFZJgx1k326DFnRaWrLxQ72/TKd2A==}
engines: {node: '>=14', npm: '>=6'}
videojs-quality-selector-hls@1.1.1:
resolution: {integrity: sha512-GR7Bs/pL4nioq+jlSASqy4nUlnnmY7NnjXY6vBPlmBJA7OuYD80ceyejuCbNeaXX7cC11WOtKTeC8QBJcKuMtA==}
engines: {node: '>=18', npm: '>=9'}
videojs-vtt.js@0.15.5:
resolution: {integrity: sha512-yZbBxvA7QMYn15Lr/ZfhhLPrNpI/RmCSCqgIff57GC2gIrV5YfyzLfLyZMj0NnZSAz8syB4N0nHXpZg9MyrMOQ==}
@@ -14436,10 +14430,6 @@ snapshots:
'@types/video.js@7.3.29': {}
'@types/videojs-hls-quality-selector@1.1.0':
dependencies:
'@types/video.js': 7.3.29
'@types/ws@8.18.1':
dependencies:
'@types/node': 20.19.9
@@ -21588,10 +21578,11 @@ snapshots:
videojs-font@4.2.0: {}
videojs-hls-quality-selector@2.0.0:
videojs-quality-selector-hls@1.1.1:
dependencies:
global: 4.4.0
video.js: 8.23.4
videojs-contrib-quality-levels: 4.1.0(video.js@8.23.4)
videojs-vtt.js@0.15.5:
dependencies: