From 6ef3be136a1e2f98e0d292cfdc108b94eb3eb470 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Thu, 30 Jul 2020 23:36:52 +0300 Subject: [PATCH] Add parseInt radix --- src/components/subtitlesettings/subtitleappearancehelper.js | 4 ++-- src/plugins/htmlVideoPlayer/plugin.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/subtitlesettings/subtitleappearancehelper.js b/src/components/subtitlesettings/subtitleappearancehelper.js index 4b8b7aed2a..904c018bfc 100644 --- a/src/components/subtitlesettings/subtitleappearancehelper.js +++ b/src/components/subtitlesettings/subtitleappearancehelper.js @@ -89,7 +89,7 @@ function getTextStyles(settings, preview) { } if (!preview) { - const pos = parseInt(settings.verticalPosition); + const pos = parseInt(settings.verticalPosition, 10); const lineHeight = 1.35; // FIXME: It is better to read this value from element const line = Math.abs(pos * lineHeight); if (pos < 0) { @@ -108,7 +108,7 @@ function getWindowStyles(settings, preview) { const list = []; if (!preview) { - const pos = parseInt(settings.verticalPosition); + const pos = parseInt(settings.verticalPosition, 10); if (pos < 0) { list.push({ name: 'top', value: '' }); list.push({ name: 'bottom', value: '0' }); diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index 77e3253641..7ef35adf41 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -1200,7 +1200,7 @@ function tryRemoveElement(elem) { console.debug(`downloaded ${data.TrackEvents.length} track events`); const subtitleAppearance = userSettings.getSubtitleAppearanceSettings(); - const cueLine = parseInt(subtitleAppearance.verticalPosition); + const cueLine = parseInt(subtitleAppearance.verticalPosition, 10); // add some cues to show the text // in safari, the cues need to be added before setting the track mode to showing