Skip to content

Commit

Permalink
Normalize LG Sub Options
Browse files Browse the repository at this point in the history
  • Loading branch information
jaruba committed May 30, 2024
1 parent 7c0a2d3 commit 7140e41
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/WebOsVideo/WebOsVideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,15 @@ var stremioColors = {
};

function stremioSubOffsets(offset) {
if (offset === 0) {
if (offset <= 0) {
return -3;
} else if (offset <= 2) {
return -2;
} else if (offset <= 3) {
return -1;
} else if (offset <= 5) {
return 0;
return -2;
} else if (offset <= 10) {
return 1;
} else if (offset <= 25) {
return 0;
} else if (offset <= 15) {
return 2;
} else if (offset <= 50) {
return 3;
} else if (offset <= 100) {
} else {
return 4;
}
return false;
Expand All @@ -129,13 +123,15 @@ function stremioSubOffsets(offset) {
function stremioSubSizes(size) {
// there is also: 0 (tiny)
// adding zero will break the logic
if (size <= 75) {
return 1;
if (size <= 50) {
return 0;
} else if (size <= 100) {
return 1;
} else if (size <= 125) {
return 2;
} else if (size <= 150) {
return 3;
} else if (size <= 250) {
} else {
return 4;
}
return false;
Expand Down Expand Up @@ -742,7 +738,7 @@ function WebOsVideo(options) {
subtitlesOffset = propValue;
var nextOffset = stremioSubOffsets(Math.max(0, Math.min(100, parseInt(subtitlesOffset, 10))));
if (nextOffset === false) { // use default
nextOffset = -1;
nextOffset = -2;
}
subStyles.position = nextOffset;
if (videoElement.mediaId) {
Expand Down

0 comments on commit 7140e41

Please sign in to comment.