@sub37/webvtt-adapter 1.1.2 → 1.1.3
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.
|
@@ -40,11 +40,14 @@ export function parseRegion(rawRegionData) {
|
|
|
40
40
|
region[key] = value;
|
|
41
41
|
break;
|
|
42
42
|
}
|
|
43
|
-
case "lines":
|
|
44
|
-
case "width": {
|
|
43
|
+
case "lines": {
|
|
45
44
|
region[key] = parseInt(value);
|
|
46
45
|
break;
|
|
47
46
|
}
|
|
47
|
+
case "width": {
|
|
48
|
+
region[key] = `${parseInt(value)}%`;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
48
51
|
default:
|
|
49
52
|
break;
|
|
50
53
|
}
|
|
@@ -73,7 +76,7 @@ class WebVTTRegion {
|
|
|
73
76
|
/**
|
|
74
77
|
* Region width expressed in percentage
|
|
75
78
|
*/
|
|
76
|
-
width = 100;
|
|
79
|
+
width = "100%";
|
|
77
80
|
lines = 3;
|
|
78
81
|
scroll;
|
|
79
82
|
/**
|
|
@@ -94,7 +97,7 @@ class WebVTTRegion {
|
|
|
94
97
|
* It is still not very clear to me why we base on current width and height, but
|
|
95
98
|
* a thing that I know is that we need low numbers.
|
|
96
99
|
*/
|
|
97
|
-
const leftOffset = (regionAnchorWidth * this.width) / 100;
|
|
100
|
+
const leftOffset = (regionAnchorWidth * parseFloat(this.width)) / 100;
|
|
98
101
|
const topOffset = (regionAnchorHeight * height) / 100;
|
|
99
102
|
const originX = `${viewportAnchorWidth - leftOffset}%`;
|
|
100
103
|
const originY = `${viewportAnchorHeight - topOffset}%`;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sub37/webvtt-adapter",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "A subtitles adapter for WebVTT subtitles",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"peerDependencies": {
|
|
8
|
-
"@sub37/server": "1.1.
|
|
8
|
+
"@sub37/server": "1.1.2"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "rm -rf lib && pnpm tsc --build --force",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"lib/**/*.+(js|d.ts)!(*.map)"
|
|
27
27
|
],
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "8d290c6b3c3bd11fd97e1574b28e94e14bde72b6"
|
|
29
29
|
}
|