@operato/board 10.0.0-beta.27 → 10.0.0-beta.29
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.
- package/CHANGELOG.md +24 -0
- package/dist/src/component/container.js +1 -3
- package/dist/src/component/container.js.map +1 -1
- package/dist/src/component/etc.js +2 -10
- package/dist/src/component/etc.js.map +1 -1
- package/dist/src/component/line.js +4 -28
- package/dist/src/component/line.js.map +1 -1
- package/dist/src/component/shape.js +5 -29
- package/dist/src/component/shape.js.map +1 -1
- package/dist/src/component/text-and-media.js +2 -25
- package/dist/src/component/text-and-media.js.map +1 -1
- package/dist/src/graphql/playback-buffer.d.ts +79 -0
- package/dist/src/graphql/playback-buffer.js +139 -0
- package/dist/src/graphql/playback-buffer.js.map +1 -0
- package/dist/src/graphql/playback-buffer.test.d.ts +1 -0
- package/dist/src/graphql/playback-buffer.test.js +261 -0
- package/dist/src/graphql/playback-buffer.test.js.map +1 -0
- package/dist/src/graphql/playback-subscription.d.ts +33 -18
- package/dist/src/graphql/playback-subscription.js +158 -91
- package/dist/src/graphql/playback-subscription.js.map +1 -1
- package/dist/src/ox-playback-controls.d.ts +8 -0
- package/dist/src/ox-playback-controls.js +114 -18
- package/dist/src/ox-playback-controls.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.0.0-beta.29](https://github.com/hatiolab/operato/compare/v10.0.0-beta.28...v10.0.0-beta.29) (2026-04-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
* **board:** 플레이백 YouTube 스트리밍 방식 — PlaybackBuffer + 청크 기반 Provider ([dda8b0b](https://github.com/hatiolab/operato/commit/dda8b0b675472c4e606730195e608667a4919010))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### :mega: Other
|
|
15
|
+
|
|
16
|
+
* **board:** @types/jest 의존성 추가 — playback-buffer 테스트 빌드 오류 해결 ([c68cfb0](https://github.com/hatiolab/operato/commit/c68cfb0a75f2b7ab10e32c9d3f2446ae766a87e7))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [10.0.0-beta.28](https://github.com/hatiolab/operato/compare/v10.0.0-beta.27...v10.0.0-beta.28) (2026-04-11)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### :house: Code Refactoring
|
|
24
|
+
|
|
25
|
+
* **board:** text/image 컴포넌트 템플릿 기본값 정리 — 불필요한 default 속성 제거 ([dadbb54](https://github.com/hatiolab/operato/commit/dadbb54c9fb347402e7fdd5a42a19934973d764a))
|
|
26
|
+
* **board:** 컴포넌트 템플릿 기본값 정리 — 불필요한 default 속성 제거 ([9716220](https://github.com/hatiolab/operato/commit/97162201f2330ada26bc35711da8f05d9222acc7))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [10.0.0-beta.27](https://github.com/hatiolab/operato/compare/v10.0.0-beta.26...v10.0.0-beta.27) (2026-04-09)
|
|
7
31
|
|
|
8
32
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../../src/component/container.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,yCAAyC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAC9F,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,qCAAqC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAElF,MAAM,IAAI,GAAG;;;;;;;;;;;;;CAaZ,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAmB;IACvC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,+BAA+B;IAC5C,IAAI;IACJ,SAAS,EAAE;QACT;YACE,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE;gBACL,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;gBACX,SAAS,EAAE,MAAM;gBACjB,WAAW,EAAE,MAAM;gBACnB,KAAK,EAAE,CAAC;gBACR,MAAM,EAAE,KAAK;gBACb,SAAS,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../../src/component/container.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,yCAAyC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAC9F,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,qCAAqC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAElF,MAAM,IAAI,GAAG;;;;;;;;;;;;;CAaZ,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAmB;IACvC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,+BAA+B;IAC5C,IAAI;IACJ,SAAS,EAAE;QACT;YACE,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE;gBACL,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;gBACX,SAAS,EAAE,MAAM;gBACjB,WAAW,EAAE,MAAM;gBACnB,KAAK,EAAE,CAAC;gBACR,MAAM,EAAE,KAAK;gBACb,SAAS,EAAE,CAAC;aACb;SACF;QACD;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;gBACX,SAAS,EAAE,MAAM;gBACjB,WAAW,EAAE,eAAe;gBAC5B,MAAM,EAAE,IAAI;aACb;SACF;KACF;CACF,CAAA","sourcesContent":["import { ComponentGroup } from '../types.js'\n\nconst iconContainer = new URL('../../../icons/components/container.png', import.meta.url).href\nconst popup = new URL('../../../icons/components/popup.png', import.meta.url).href\n\nconst icon = `\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 30 30\" style=\"enable-background:new 0 0 30 30;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n .st3{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;}\n .st9{fill:none;stroke:{{strokeColor}};stroke-miterlimit:10;}\n </style>\n <g>\n <rect x=\"2.8\" y=\"10.3\" class=\"st9\" width=\"24.4\" height=\"13.8\"/>\n <polygon class=\"st0\" points=\"27.7,9.8 2.3,9.8 7.8,5.9 22.2,5.9\"/>\n <line class=\"st3\" x1=\"10.9\" y1=\"15.5\" x2=\"19.1\" y2=\"15.5\"/>\n </g>\n</svg>\n`\n\nexport const container: ComponentGroup = {\n name: 'container',\n description: 'a group of various containers',\n icon,\n templates: [\n {\n type: 'container',\n description: 'general container',\n icon: iconContainer,\n group: 'container',\n model: {\n type: 'container',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n fillStyle: '#fff',\n strokeStyle: '#999',\n alpha: 1,\n hidden: false,\n lineWidth: 1\n }\n },\n {\n type: 'popup',\n description: 'popup window',\n icon: popup,\n group: 'container',\n model: {\n type: 'popup',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n fillStyle: '#fff',\n strokeStyle: 'DarkGoldenRod',\n hidden: true\n }\n }\n ]\n}\n"]}
|
|
@@ -50,11 +50,7 @@ export const etc = {
|
|
|
50
50
|
height: 100,
|
|
51
51
|
fillStyle: '#fff',
|
|
52
52
|
strokeStyle: '#000',
|
|
53
|
-
|
|
54
|
-
hidden: false,
|
|
55
|
-
lineWidth: 1,
|
|
56
|
-
lineDash: 'solid',
|
|
57
|
-
lineCap: 'butt'
|
|
53
|
+
lineWidth: 1
|
|
58
54
|
}
|
|
59
55
|
},
|
|
60
56
|
{
|
|
@@ -70,11 +66,7 @@ export const etc = {
|
|
|
70
66
|
height: 100,
|
|
71
67
|
fillStyle: '#fff',
|
|
72
68
|
strokeStyle: '#000',
|
|
73
|
-
|
|
74
|
-
hidden: false,
|
|
75
|
-
lineWidth: 1,
|
|
76
|
-
lineDash: 'solid',
|
|
77
|
-
lineCap: 'butt'
|
|
69
|
+
lineWidth: 1
|
|
78
70
|
}
|
|
79
71
|
}
|
|
80
72
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"etc.js","sourceRoot":"","sources":["../../../src/component/etc.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,gDAAgD,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACvG,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,2CAA2C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAC7F,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,+CAA+C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAErG,MAAM,IAAI,GAAG;;;;;;;;;;;CAWZ,CAAA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,CAAC;aACb;SACF;KACF;CACF,CAAA","sourcesContent":["import { ComponentGroup } from '../types.js'\n\nconst globalReference = new URL('../../../icons/components/global-reference.png', import.meta.url).href\nconst infoWindow = new URL('../../../icons/components/info-window.png', import.meta.url).href\nconst localReference = new URL('../../../icons/components/local-reference.png', import.meta.url).href\n\nconst icon = `\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 30 30\" style=\"enable-background:new 0 0 30 30;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:{{strokeColor}};}\n </style>\n <g>\n <circle class=\"st0\" cx=\"7.1\" cy=\"15\" r=\"2\"/>\n <circle class=\"st0\" cx=\"15\" cy=\"15\" r=\"2\"/>\n <circle class=\"st0\" cx=\"22.9\" cy=\"15\" r=\"2\"/>\n </g>\n</svg>\n`\n\nexport const etc: ComponentGroup = {\n name: 'etc',\n description: 'a group of components that have not yet been defined.',\n icon,\n templates: [\n {\n type: 'info-window',\n description: 'information window',\n icon: infoWindow,\n group: 'etc',\n model: {\n type: 'info-window',\n left: 10,\n top: 10,\n width: 50,\n height: 50,\n fillStyle: '#fff',\n strokeStyle: 'DarkGoldenRod',\n hidden: true,\n frontSideTemplate:\n \"<h2 id='xxx'>\\n\\t<%= text %>\\n</h2>\\n<img src='https://www.tutorialspoint.com/images/html.gif' alt='HTML Tutorial' height='150' width='140' />\",\n backSideTemplate:\n \"<h2 id='yyy'>\\n\\t<%= text %>\\n</h2>\\n<img src='https://www.tutorialspoint.com/images/html.gif' alt='HTML Tutorial' height='150' width='140' />\",\n style:\n '#yyy {\\n\\tbackground-color:navy;\\n\\tcolor:white\\n}\\n#xxx, #yyy {\\n\\twhite-space:nowrap;\\n\\tmin-width:200px;\\n}'\n }\n },\n {\n type: 'local-ref',\n description: 'local reference',\n icon: localReference,\n group: 'etc',\n model: {\n type: 'local-ref',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1\n }\n },\n {\n type: 'global-ref',\n description: 'global reference',\n icon: globalReference,\n group: 'etc',\n model: {\n type: 'global-ref',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1\n }\n }\n ]\n}\n"]}
|
|
@@ -34,11 +34,7 @@ export const line = {
|
|
|
34
34
|
y2: 200,
|
|
35
35
|
fillStyle: '#fff',
|
|
36
36
|
strokeStyle: '#000',
|
|
37
|
-
|
|
38
|
-
hidden: false,
|
|
39
|
-
lineWidth: 3,
|
|
40
|
-
lineDash: 'solid',
|
|
41
|
-
lineCap: 'butt'
|
|
37
|
+
lineWidth: 3
|
|
42
38
|
}
|
|
43
39
|
},
|
|
44
40
|
{
|
|
@@ -54,11 +50,7 @@ export const line = {
|
|
|
54
50
|
y2: 200,
|
|
55
51
|
fillStyle: '#fff',
|
|
56
52
|
strokeStyle: '#000',
|
|
57
|
-
|
|
58
|
-
hidden: false,
|
|
59
|
-
lineWidth: 3,
|
|
60
|
-
lineDash: 'round-dot',
|
|
61
|
-
lineCap: 'butt'
|
|
53
|
+
lineWidth: 3
|
|
62
54
|
}
|
|
63
55
|
},
|
|
64
56
|
{
|
|
@@ -74,12 +66,8 @@ export const line = {
|
|
|
74
66
|
y2: 200,
|
|
75
67
|
fillStyle: '#fff',
|
|
76
68
|
strokeStyle: '#000',
|
|
77
|
-
alpha: 3,
|
|
78
|
-
hidden: false,
|
|
79
69
|
lineWidth: 3,
|
|
80
|
-
|
|
81
|
-
begin: 'arrow',
|
|
82
|
-
lineCap: 'butt'
|
|
70
|
+
begin: 'arrow'
|
|
83
71
|
}
|
|
84
72
|
},
|
|
85
73
|
{
|
|
@@ -95,13 +83,9 @@ export const line = {
|
|
|
95
83
|
y2: 200,
|
|
96
84
|
fillStyle: '#fff',
|
|
97
85
|
strokeStyle: '#000',
|
|
98
|
-
alpha: 1,
|
|
99
|
-
hidden: false,
|
|
100
86
|
lineWidth: 3,
|
|
101
|
-
lineDash: 'solid',
|
|
102
87
|
begin: 'arrow',
|
|
103
|
-
end: 'arrow'
|
|
104
|
-
lineCap: 'butt'
|
|
88
|
+
end: 'arrow'
|
|
105
89
|
}
|
|
106
90
|
},
|
|
107
91
|
{
|
|
@@ -119,11 +103,7 @@ export const line = {
|
|
|
119
103
|
],
|
|
120
104
|
fillStyle: '#fff',
|
|
121
105
|
strokeStyle: '#000',
|
|
122
|
-
alpha: 1,
|
|
123
|
-
hidden: false,
|
|
124
106
|
lineWidth: 1,
|
|
125
|
-
lineDash: 'solid',
|
|
126
|
-
lineCap: 'butt',
|
|
127
107
|
round: 10
|
|
128
108
|
}
|
|
129
109
|
},
|
|
@@ -140,11 +120,7 @@ export const line = {
|
|
|
140
120
|
y2: 200,
|
|
141
121
|
fillStyle: '#fff',
|
|
142
122
|
strokeStyle: '#000',
|
|
143
|
-
alpha: 1,
|
|
144
|
-
hidden: false,
|
|
145
123
|
lineWidth: 1,
|
|
146
|
-
lineDash: 'solid',
|
|
147
|
-
lineCap: 'butt',
|
|
148
124
|
round: 10
|
|
149
125
|
}
|
|
150
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line.js","sourceRoot":"","sources":["../../../src/component/line.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,0CAA0C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAC3F,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAChF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACpF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,wCAAwC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AAE,EAAE,GAAG;gBACP,EAAE,EAAE,GAAG;gBACP,EAAE,EAAE,GAAG;gBACP,EAAE,EAAE,GAAG;gBACP,SAAS,EAAE,MAAM;gBACjB,WAAW,EAAE,MAAM;gBACnB,SAAS,EAAE,CAAC;gBACZ,KAAK,EAAE,EAAE;aACV;SACF;KACF;CACF,CAAA","sourcesContent":["import { ComponentGroup } from '../types.js'\n\nconst bothArrow = new URL('../../../icons/components/both-arrow.png', import.meta.url).href\nconst dash = new URL('../../../icons/components/dash.png', import.meta.url).href\nconst lineIcon = new URL('../../../icons/components/line.png', import.meta.url).href\nconst polyline = new URL('../../../icons/components/polyline.png', import.meta.url).href\nconst singleArrow = new URL('../../../icons/components/single-arrow.png', import.meta.url).href\nconst ortholine = new URL('../../../icons/components/ortholine.png', import.meta.url).href\n\nconst icon = `\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 30 30\" style=\"enable-background:new 0 0 30 30;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n\t .st3{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-linecap:round;stroke-miterlimit:10;}\n\t .st4{fill:none;stroke:{{strokeColor}};stroke-width:1.5;stroke-miterlimit:10;stroke-dasharray:3,1.5;}\n </style>\n <g>\n\t <line class=\"st3\" x1=\"1.7\" y1=\"18.9\" x2=\"26.3\" y2=\"6.2\"/>\n\t <line class=\"st4\" x1=\"1.7\" y1=\"23.8\" x2=\"28.3\" y2=\"10.1\"/>\n </g>\n</svg>\n`\n\nexport const line: ComponentGroup = {\n name: 'line',\n description: 'a group of various lines',\n icon,\n templates: [\n {\n type: 'line',\n description: 'simple line',\n icon: lineIcon,\n group: 'line',\n model: {\n type: 'line',\n x1: 100,\n y1: 100,\n x2: 200,\n y2: 200,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 3\n }\n },\n {\n type: 'dash',\n description: 'dash line',\n icon: dash,\n group: 'line',\n model: {\n type: 'line',\n x1: 100,\n y1: 100,\n x2: 200,\n y2: 200,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 3\n }\n },\n {\n type: 'single arrow',\n description: 'single arrow tip line',\n icon: singleArrow,\n group: 'line',\n model: {\n type: 'line',\n x1: 100,\n y1: 100,\n x2: 200,\n y2: 200,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 3,\n begin: 'arrow'\n }\n },\n {\n type: 'both arrow',\n description: 'both arrow tip line',\n icon: bothArrow,\n group: 'line',\n model: {\n type: 'line',\n x1: 100,\n y1: 100,\n x2: 200,\n y2: 200,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 3,\n begin: 'arrow',\n end: 'arrow'\n }\n },\n {\n type: 'polyline',\n description: 'polyline',\n icon: polyline,\n group: 'line',\n model: {\n type: 'polyline',\n path: [\n { x: 100, y: 100 },\n { x: 200, y: 100 },\n { x: 200, y: 200 },\n { x: 100, y: 200 }\n ],\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1,\n round: 10\n }\n },\n {\n type: 'ortholine',\n description: 'ortholine',\n icon: ortholine,\n group: 'line',\n model: {\n type: 'ortholine',\n x1: 100,\n y1: 100,\n x2: 200,\n y2: 200,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1,\n round: 10\n }\n }\n ]\n}\n"]}
|
|
@@ -33,11 +33,7 @@ export const shape = {
|
|
|
33
33
|
height: 100,
|
|
34
34
|
fillStyle: '#fff',
|
|
35
35
|
strokeStyle: '#000',
|
|
36
|
-
|
|
37
|
-
hidden: false,
|
|
38
|
-
lineWidth: 1,
|
|
39
|
-
lineDash: 'solid',
|
|
40
|
-
lineCap: 'butt'
|
|
36
|
+
lineWidth: 1
|
|
41
37
|
}
|
|
42
38
|
},
|
|
43
39
|
{
|
|
@@ -53,11 +49,7 @@ export const shape = {
|
|
|
53
49
|
cy: 150,
|
|
54
50
|
fillStyle: '#fff',
|
|
55
51
|
strokeStyle: '#000',
|
|
56
|
-
|
|
57
|
-
hidden: false,
|
|
58
|
-
lineWidth: 1,
|
|
59
|
-
lineDash: 'solid',
|
|
60
|
-
lineCap: 'butt'
|
|
52
|
+
lineWidth: 1
|
|
61
53
|
}
|
|
62
54
|
},
|
|
63
55
|
{
|
|
@@ -74,11 +66,7 @@ export const shape = {
|
|
|
74
66
|
ratio: 30,
|
|
75
67
|
fillStyle: '#fff',
|
|
76
68
|
strokeStyle: '#000',
|
|
77
|
-
|
|
78
|
-
hidden: false,
|
|
79
|
-
lineWidth: 1,
|
|
80
|
-
lineDash: 'solid',
|
|
81
|
-
lineCap: 'butt'
|
|
69
|
+
lineWidth: 1
|
|
82
70
|
}
|
|
83
71
|
},
|
|
84
72
|
{
|
|
@@ -96,11 +84,7 @@ export const shape = {
|
|
|
96
84
|
y3: 200,
|
|
97
85
|
fillStyle: '#fff',
|
|
98
86
|
strokeStyle: '#000',
|
|
99
|
-
|
|
100
|
-
hidden: false,
|
|
101
|
-
lineWidth: 1,
|
|
102
|
-
lineDash: 'solid',
|
|
103
|
-
lineCap: 'butt'
|
|
87
|
+
lineWidth: 1
|
|
104
88
|
}
|
|
105
89
|
},
|
|
106
90
|
{
|
|
@@ -118,11 +102,7 @@ export const shape = {
|
|
|
118
102
|
],
|
|
119
103
|
fillStyle: '#fff',
|
|
120
104
|
strokeStyle: '#000',
|
|
121
|
-
alpha: 1,
|
|
122
|
-
hidden: false,
|
|
123
105
|
lineWidth: 1,
|
|
124
|
-
lineDash: 'solid',
|
|
125
|
-
lineCap: 'butt',
|
|
126
106
|
round: 10
|
|
127
107
|
}
|
|
128
108
|
},
|
|
@@ -141,11 +121,7 @@ export const shape = {
|
|
|
141
121
|
wing: 5,
|
|
142
122
|
fillStyle: '#fff',
|
|
143
123
|
strokeStyle: '#000',
|
|
144
|
-
|
|
145
|
-
hidden: false,
|
|
146
|
-
lineWidth: 1,
|
|
147
|
-
lineDash: 'solid',
|
|
148
|
-
lineCap: 'butt'
|
|
124
|
+
lineWidth: 1
|
|
149
125
|
}
|
|
150
126
|
}
|
|
151
127
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../../../src/component/shape.ts"],"names":[],"mappings":"AAEA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,qCAAqC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAClF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,uCAAuC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACtF,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,uCAAuC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACtF,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAChF,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAChF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,wCAAwC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAExF,MAAM,IAAI,GAAG;;;;;;;;;;CAUZ,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAmB;IACnC,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,gCAAgC;IAC7C,IAAI;IACJ,SAAS,EAAE;QACT;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,OAAO;YACd,KAAK,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,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d,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE;oBACJ,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;oBAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;oBAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;oBAClB,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE;iBACnB;gBACD,SAAS,EAAE,MAAM;gBACjB,WAAW,EAAE,MAAM;gBACnB,SAAS,EAAE,CAAC;gBACZ,KAAK,EAAE,EAAE;aACV;SACF;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,OAAO;YACd,KAAK,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,EAAE,EAAE,EAAE;gBACN,EAAE,EAAE,EAAE;gBACN,EAAE,EAAE,GAAG;gBACP,EAAE,EAAE,GAAG;gBACP,KAAK,EAAE,EAAE;gBACT,IAAI,EAAE,CAAC;gBACP,SAAS,EAAE,MAAM;gBACjB,WAAW,EAAE,MAAM;gBACnB,SAAS,EAAE,CAAC;aACb;SACF;KACF;CACF,CAAA","sourcesContent":["import { ComponentGroup } from '../types.js'\n\nconst donut = new URL('../../../icons/components/donut.png', import.meta.url).href\nconst ellipse = new URL('../../../icons/components/ellipse.png', import.meta.url).href\nconst polygon = new URL('../../../icons/components/polygon.png', import.meta.url).href\nconst rect = new URL('../../../icons/components/rect.png', import.meta.url).href\nconst star = new URL('../../../icons/components/star.png', import.meta.url).href\nconst triangle = new URL('../../../icons/components/triangle.png', import.meta.url).href\n\nconst icon = `\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 30 30\" style=\"enable-background:new 0 0 30 30;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n .st0{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-miterlimit:10;}\n </style>\n <g>\n <polyline class=\"st0\" points=\"21.6,9.4 21.6,4.6 1.6,4.6 1.6,17.7 12.5,17.7 \t\"/>\n <circle class=\"st0\" cx=\"21.3\" cy=\"18.3\" r=\"7\"/>\n </g>\n</svg>\n`\n\nexport const shape: ComponentGroup = {\n name: 'shape',\n description: 'a group of simple basic shapes',\n icon,\n templates: [\n {\n type: 'rect',\n description: 'rectangle shape',\n icon: rect,\n group: 'shape',\n model: {\n type: 'rect',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1\n }\n },\n {\n type: 'ellipse',\n description: 'ellipse shape',\n icon: ellipse,\n group: 'shape',\n model: {\n type: 'ellipse',\n rx: 50,\n ry: 50,\n cx: 150,\n cy: 150,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1\n }\n },\n {\n type: 'donut',\n description: 'donut shape',\n icon: donut,\n group: 'shape',\n model: {\n type: 'donut',\n rx: 50,\n ry: 50,\n cx: 150,\n cy: 150,\n ratio: 30,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1\n }\n },\n {\n type: 'triangle',\n description: 'triangle shape',\n icon: triangle,\n group: 'shape',\n model: {\n type: 'triangle',\n x1: 150,\n y1: 100,\n x2: 100,\n y2: 200,\n x3: 200,\n y3: 200,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1\n }\n },\n {\n type: 'polygon',\n description: 'polygon shape',\n icon: polygon,\n group: 'shape',\n model: {\n type: 'polygon',\n path: [\n { x: 100, y: 100 },\n { x: 200, y: 100 },\n { x: 200, y: 200 },\n { x: 100, y: 200 }\n ],\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1,\n round: 10\n }\n },\n {\n type: 'star',\n description: 'star shape',\n icon: star,\n group: 'shape',\n model: {\n type: 'star',\n rx: 50,\n ry: 50,\n cx: 150,\n cy: 150,\n ratio: 30,\n wing: 5,\n fillStyle: '#fff',\n strokeStyle: '#000',\n lineWidth: 1\n }\n }\n ]\n}\n"]}
|
|
@@ -35,16 +35,8 @@ export const textAndMedia = {
|
|
|
35
35
|
width: 200,
|
|
36
36
|
height: 50,
|
|
37
37
|
text: 'Text',
|
|
38
|
-
fillStyle: '#fff',
|
|
39
|
-
strokeStyle: '#000',
|
|
40
|
-
alpha: 1,
|
|
41
|
-
hidden: false,
|
|
42
|
-
lineWidth: 5,
|
|
43
|
-
lineDash: 'solid',
|
|
44
|
-
lineCap: 'butt',
|
|
45
38
|
textAlign: 'left',
|
|
46
39
|
textBaseline: 'top',
|
|
47
|
-
textWrap: false,
|
|
48
40
|
fontFamily: 'serif',
|
|
49
41
|
fontSize: 30
|
|
50
42
|
}
|
|
@@ -59,15 +51,7 @@ export const textAndMedia = {
|
|
|
59
51
|
left: 100,
|
|
60
52
|
top: 100,
|
|
61
53
|
width: 100,
|
|
62
|
-
height: 100
|
|
63
|
-
isGray: false,
|
|
64
|
-
fillStyle: '#fff',
|
|
65
|
-
strokeStyle: '#000',
|
|
66
|
-
alpha: 1,
|
|
67
|
-
hidden: false,
|
|
68
|
-
lineWidth: 1,
|
|
69
|
-
lineDash: 'solid',
|
|
70
|
-
lineCap: 'butt'
|
|
54
|
+
height: 100
|
|
71
55
|
}
|
|
72
56
|
},
|
|
73
57
|
{
|
|
@@ -81,14 +65,7 @@ export const textAndMedia = {
|
|
|
81
65
|
top: 100,
|
|
82
66
|
width: 100,
|
|
83
67
|
height: 100,
|
|
84
|
-
isGray: true
|
|
85
|
-
fillStyle: '#fff',
|
|
86
|
-
strokeStyle: '#000',
|
|
87
|
-
alpha: 1,
|
|
88
|
-
hidden: false,
|
|
89
|
-
lineWidth: 1,
|
|
90
|
-
lineDash: 'solid',
|
|
91
|
-
lineCap: 'butt'
|
|
68
|
+
isGray: true
|
|
92
69
|
}
|
|
93
70
|
},
|
|
94
71
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-and-media.js","sourceRoot":"","sources":["../../../src/component/text-and-media.ts"],"names":[],"mappings":"AAEA,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,qCAAqC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAClF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,2CAA2C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAC7F,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,yCAAyC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AACzF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,0CAA0C,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAC3F,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAEhF,MAAM,IAAI,GAAG;;;;;;;;;;;;;;CAcZ,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAmB;IAC1C,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,8CAA8C;IAC3D,IAAI;IACJ,SAAS,EAAE;QACT;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,MAAM;YACnB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,MAAM;gBACZ,SAAS,EAAE,MAAM;gBACjB,
|
|
1
|
+
{"version":3,"file":"text-and-media.js","sourceRoot":"","sources":["../../../src/component/text-and-media.ts"],"names":[],"m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L,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;aACZ;SACF;QACD;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE;gBACL,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;gBACX,MAAM,EAAE,IAAI;aACb;SACF;QACD;YACE,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE;gBACL,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;aACZ;SACF;QACD;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,OAAO;YACpB,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,GAAG;gBACT,GAAG,EAAE,GAAG;gBACR,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,GAAG;aACZ;SACF;KACF;CACF,CAAA","sourcesContent":["import { ComponentGroup } from '../types.js'\n\nconst audio = new URL('../../../icons/components/audio.png', import.meta.url).href\nconst colorImage = new URL('../../../icons/components/color-image.png', import.meta.url).href\nconst gifImage = new URL('../../../icons/components/gif-image.png', import.meta.url).href\nconst grayImage = new URL('../../../icons/components/gray-image.png', import.meta.url).href\nconst text = new URL('../../../icons/components/text.png', import.meta.url).href\n\nconst icon = `\n<svg version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 30 30\" style=\"enable-background:new 0 0 30 30;\" xml:space=\"preserve\">\n <style type=\"text/css\">\n\t .st0{fill:none;stroke:{{strokeColor}};stroke-width:2;stroke-miterlimit:10;}\n\t .st1{fill:{{strokeColor}};}\n </style>\n <g>\n\t <polyline class=\"st0\" points=\"20.6,12.8 20.6,5.1 1.6,5.1 1.6,18 15,18\"/>\n\t <path class=\"st1\" d=\"M5.7,7.9c-0.9,0-1.6,0.7-1.6,1.6s0.7,1.6,1.6,1.6s1.6-0.7,1.6-1.6S6.6,7.9,5.7,7.9z\"/>\n\t <polygon class=\"st1\" points=\"12.8,8.6 8.5,14.7 5.9,12.7 3.2,16.1 15.1,16.1 15.2,13.7\"/>\n\t <path class=\"st1\" d=\"M24.1,15.1h2.1l0.6,2.8h1.7l-0.1-3.8H16.5l-0.1,3.8h1.7l0.4-2.8h2.1c0.1,2,0.1,3.1,0.1,5.2V21\n\t\t c0,1.6,0,1.9,0,2.7l-1.8,0.2V25h6.9v-1.1L24,23.7c0-0.9,0-1.1,0-2.7v-0.7C24,18.1,24,17,24.1,15.1z\"/>\n </g>\n</svg>\n`\n\nexport const textAndMedia: ComponentGroup = {\n name: 'textAndMedia',\n description: 'a group of text and various media components',\n icon,\n templates: [\n {\n type: 'text',\n description: 'text',\n icon: text,\n group: 'textAndMedia',\n model: {\n type: 'text',\n left: 100,\n top: 100,\n width: 200,\n height: 50,\n text: 'Text',\n textAlign: 'left',\n textBaseline: 'top',\n fontFamily: 'serif',\n fontSize: 30\n }\n },\n {\n type: 'color image',\n description: 'color image',\n icon: colorImage,\n group: 'textAndMedia',\n model: {\n type: 'image-view',\n left: 100,\n top: 100,\n width: 100,\n height: 100\n }\n },\n {\n type: 'gray image',\n description: 'gray image',\n icon: grayImage,\n group: 'textAndMedia',\n model: {\n type: 'image-view',\n left: 100,\n top: 100,\n width: 100,\n height: 100,\n isGray: true\n }\n },\n {\n type: 'gif image',\n description: 'gif image',\n icon: gifImage,\n group: 'textAndMedia',\n model: {\n type: 'gif-view',\n left: 100,\n top: 100,\n width: 100,\n height: 100\n }\n },\n {\n type: 'audio',\n description: 'audio',\n icon: audio,\n group: 'textAndMedia',\n model: {\n type: 'audio',\n left: 100,\n top: 100,\n width: 100,\n height: 100\n }\n }\n ]\n}\n"]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlaybackBuffer — YouTube 스트리밍 방식의 청크 기반 플레이백 버퍼
|
|
3
|
+
*
|
|
4
|
+
* - 10분 단위 청크로 데이터를 fetch
|
|
5
|
+
* - 남은 데이터가 1분 이하이면 다음 청크를 prefetch
|
|
6
|
+
* - seek 시 기존 버퍼 전체 폐기 후 새 위치에서 fresh fetch
|
|
7
|
+
*/
|
|
8
|
+
export interface PlaybackSnapshot {
|
|
9
|
+
timestamp: number;
|
|
10
|
+
data: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
export interface PlaybackChunk {
|
|
13
|
+
fromTime: number;
|
|
14
|
+
toTime: number;
|
|
15
|
+
snapshots: PlaybackSnapshot[];
|
|
16
|
+
}
|
|
17
|
+
export interface ChunkFetcher {
|
|
18
|
+
(fromTime: Date, toTime: Date): Promise<PlaybackSnapshot[]>;
|
|
19
|
+
}
|
|
20
|
+
declare const CHUNK_DURATION: number;
|
|
21
|
+
declare const PREFETCH_THRESHOLD: number;
|
|
22
|
+
export declare class PlaybackBuffer {
|
|
23
|
+
private _chunks;
|
|
24
|
+
private _fetcher;
|
|
25
|
+
private _prefetching;
|
|
26
|
+
private _totalRange;
|
|
27
|
+
constructor(fetcher: ChunkFetcher, totalRange: {
|
|
28
|
+
from: Date;
|
|
29
|
+
to: Date;
|
|
30
|
+
});
|
|
31
|
+
get totalRange(): {
|
|
32
|
+
from: number;
|
|
33
|
+
to: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* 버퍼에 로드된 시간 범위들을 반환 (시크바 버퍼 표시용)
|
|
37
|
+
*/
|
|
38
|
+
getBufferedRanges(): {
|
|
39
|
+
from: number;
|
|
40
|
+
to: number;
|
|
41
|
+
}[];
|
|
42
|
+
/**
|
|
43
|
+
* 현재 playHead 시점의 스냅샷을 찾는다.
|
|
44
|
+
* playHead 이하인 스냅샷 중 가장 가까운 것을 반환.
|
|
45
|
+
*/
|
|
46
|
+
getSnapshotAt(playHead: number): PlaybackSnapshot | null;
|
|
47
|
+
/**
|
|
48
|
+
* playHead와 가장 가까운 다음 스냅샷의 timestamp를 반환.
|
|
49
|
+
* 타이머 간격 계산에 사용.
|
|
50
|
+
*/
|
|
51
|
+
getNextSnapshotTime(playHead: number): number | null;
|
|
52
|
+
/**
|
|
53
|
+
* 버퍼의 마지막 시점 (가장 먼 미래)
|
|
54
|
+
*/
|
|
55
|
+
getBufferedEnd(): number;
|
|
56
|
+
/**
|
|
57
|
+
* 초기 로드: 지정 시점부터 10분 fetch
|
|
58
|
+
*/
|
|
59
|
+
loadInitial(fromTime: number): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* prefetch 필요 여부 확인 + 자동 실행
|
|
62
|
+
* playHead: 현재 재생 위치 (ms)
|
|
63
|
+
*/
|
|
64
|
+
checkPrefetch(playHead: number): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* seek: 기존 버퍼 전체 폐기 + 새 위치에서 fresh fetch
|
|
67
|
+
*/
|
|
68
|
+
seek(toTime: number): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* 버퍼 전체 폐기
|
|
71
|
+
*/
|
|
72
|
+
clear(): void;
|
|
73
|
+
/**
|
|
74
|
+
* 특정 시점이 버퍼에 있는지 확인
|
|
75
|
+
*/
|
|
76
|
+
hasDataAt(time: number): boolean;
|
|
77
|
+
private _fetchChunk;
|
|
78
|
+
}
|
|
79
|
+
export { CHUNK_DURATION, PREFETCH_THRESHOLD };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlaybackBuffer — YouTube 스트리밍 방식의 청크 기반 플레이백 버퍼
|
|
3
|
+
*
|
|
4
|
+
* - 10분 단위 청크로 데이터를 fetch
|
|
5
|
+
* - 남은 데이터가 1분 이하이면 다음 청크를 prefetch
|
|
6
|
+
* - seek 시 기존 버퍼 전체 폐기 후 새 위치에서 fresh fetch
|
|
7
|
+
*/
|
|
8
|
+
const CHUNK_DURATION = 10 * 60 * 1000; // 10분 (ms)
|
|
9
|
+
const PREFETCH_THRESHOLD = 1 * 60 * 1000; // 1분 남았을 때 prefetch
|
|
10
|
+
export class PlaybackBuffer {
|
|
11
|
+
constructor(fetcher, totalRange) {
|
|
12
|
+
this._chunks = [];
|
|
13
|
+
this._prefetching = false;
|
|
14
|
+
this._fetcher = fetcher;
|
|
15
|
+
this._totalRange = { from: totalRange.from.getTime(), to: totalRange.to.getTime() };
|
|
16
|
+
}
|
|
17
|
+
get totalRange() {
|
|
18
|
+
return this._totalRange;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 버퍼에 로드된 시간 범위들을 반환 (시크바 버퍼 표시용)
|
|
22
|
+
*/
|
|
23
|
+
getBufferedRanges() {
|
|
24
|
+
return this._chunks.map(c => ({ from: c.fromTime, to: c.toTime }));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 현재 playHead 시점의 스냅샷을 찾는다.
|
|
28
|
+
* playHead 이하인 스냅샷 중 가장 가까운 것을 반환.
|
|
29
|
+
*/
|
|
30
|
+
getSnapshotAt(playHead) {
|
|
31
|
+
let best = null;
|
|
32
|
+
for (const chunk of this._chunks) {
|
|
33
|
+
if (chunk.fromTime > playHead)
|
|
34
|
+
break;
|
|
35
|
+
for (const snap of chunk.snapshots) {
|
|
36
|
+
if (snap.timestamp <= playHead) {
|
|
37
|
+
best = snap;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return best;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* playHead와 가장 가까운 다음 스냅샷의 timestamp를 반환.
|
|
48
|
+
* 타이머 간격 계산에 사용.
|
|
49
|
+
*/
|
|
50
|
+
getNextSnapshotTime(playHead) {
|
|
51
|
+
for (const chunk of this._chunks) {
|
|
52
|
+
for (const snap of chunk.snapshots) {
|
|
53
|
+
if (snap.timestamp > playHead) {
|
|
54
|
+
return snap.timestamp;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 버퍼의 마지막 시점 (가장 먼 미래)
|
|
62
|
+
*/
|
|
63
|
+
getBufferedEnd() {
|
|
64
|
+
if (this._chunks.length === 0)
|
|
65
|
+
return 0;
|
|
66
|
+
return this._chunks[this._chunks.length - 1].toTime;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 초기 로드: 지정 시점부터 10분 fetch
|
|
70
|
+
*/
|
|
71
|
+
async loadInitial(fromTime) {
|
|
72
|
+
this._chunks = [];
|
|
73
|
+
await this._fetchChunk(fromTime);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* prefetch 필요 여부 확인 + 자동 실행
|
|
77
|
+
* playHead: 현재 재생 위치 (ms)
|
|
78
|
+
*/
|
|
79
|
+
async checkPrefetch(playHead) {
|
|
80
|
+
if (this._prefetching)
|
|
81
|
+
return;
|
|
82
|
+
const bufferedEnd = this.getBufferedEnd();
|
|
83
|
+
const remaining = bufferedEnd - playHead;
|
|
84
|
+
if (remaining <= PREFETCH_THRESHOLD && bufferedEnd < this._totalRange.to) {
|
|
85
|
+
this._prefetching = true;
|
|
86
|
+
try {
|
|
87
|
+
await this._fetchChunk(bufferedEnd);
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
this._prefetching = false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* seek: 기존 버퍼 전체 폐기 + 새 위치에서 fresh fetch
|
|
96
|
+
*/
|
|
97
|
+
async seek(toTime) {
|
|
98
|
+
this._chunks = [];
|
|
99
|
+
this._prefetching = false;
|
|
100
|
+
await this._fetchChunk(toTime);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 버퍼 전체 폐기
|
|
104
|
+
*/
|
|
105
|
+
clear() {
|
|
106
|
+
this._chunks = [];
|
|
107
|
+
this._prefetching = false;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 특정 시점이 버퍼에 있는지 확인
|
|
111
|
+
*/
|
|
112
|
+
hasDataAt(time) {
|
|
113
|
+
return this._chunks.some(c => c.fromTime <= time && time < c.toTime);
|
|
114
|
+
}
|
|
115
|
+
async _fetchChunk(fromTime) {
|
|
116
|
+
const toTime = Math.min(fromTime + CHUNK_DURATION, this._totalRange.to);
|
|
117
|
+
if (fromTime >= toTime)
|
|
118
|
+
return;
|
|
119
|
+
const snapshots = await this._fetcher(new Date(fromTime), new Date(toTime));
|
|
120
|
+
// 중복 청크 방지
|
|
121
|
+
if (this._chunks.some(c => c.fromTime === fromTime))
|
|
122
|
+
return;
|
|
123
|
+
const chunk = {
|
|
124
|
+
fromTime,
|
|
125
|
+
toTime,
|
|
126
|
+
snapshots: snapshots.sort((a, b) => a.timestamp - b.timestamp)
|
|
127
|
+
};
|
|
128
|
+
// 시간순 삽입
|
|
129
|
+
const insertIdx = this._chunks.findIndex(c => c.fromTime > fromTime);
|
|
130
|
+
if (insertIdx === -1) {
|
|
131
|
+
this._chunks.push(chunk);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
this._chunks.splice(insertIdx, 0, chunk);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export { CHUNK_DURATION, PREFETCH_THRESHOLD };
|
|
139
|
+
//# sourceMappingURL=playback-buffer.js.map
|