From db2e1aafb18faf8ea3c48be9c9c51a9af2cbb2ec Mon Sep 17 00:00:00 2001 From: DispatchCommit Date: Mon, 8 Mar 2021 16:33:56 -0800 Subject: [PATCH] rename getHls to getVhs adds deprecation warning and allows for backwards compatibility --- .../videojs-hls-quality-selector/plugin.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ui/component/viewers/videoViewer/internal/plugins/videojs-hls-quality-selector/plugin.js b/ui/component/viewers/videoViewer/internal/plugins/videojs-hls-quality-selector/plugin.js index 683a5d33c..fd72ae3a5 100644 --- a/ui/component/viewers/videoViewer/internal/plugins/videojs-hls-quality-selector/plugin.js +++ b/ui/component/viewers/videoViewer/internal/plugins/videojs-hls-quality-selector/plugin.js @@ -50,8 +50,8 @@ class HlsQualitySelectorPlugin { } updatePlugin() { - // If there is the HLS tech - if (this.getHls()) { + // If there is the VHS tech + if (this.getVhs()) { // Show quality selector this._qualityButton.show(); } else { @@ -61,11 +61,21 @@ class HlsQualitySelectorPlugin { } /** - * Returns HLS Plugin + * Deprecated, returns VHS plugin * - * @return {*} - videojs-hls-contrib plugin. + * @return {*} - videojs-http-streaming plugin. */ getHls() { + console.warn('hls-quality-selector: WARN: Using getHls options is deprecated. Use getVhs instead.') + return this.getVhs(); + } + + /** + * Returns VHS Plugin + * + * @return {*} - videojs-http-streaming plugin. + */ + getVhs() { return this.player.tech({ IWillNotUseThisInPlugins: true }).vhs; }