@sgrsoft/vpe-core-sdk 0.12.1 → 0.12.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.
package/README.md CHANGED
@@ -1,2 +1,76 @@
1
1
  # VPE Core SDK
2
2
 
3
+ VPE Player를 초기화하고 설정을 검증하는 Core SDK입니다. Access Key 검증, 서버 옵션 동기화, MA 리포트 동기화, 다국어 메시지, 옵션 정규화를 제공합니다.
4
+
5
+ ## 주요 기능
6
+ - Access Key 및 App ID 기반 라이선스/설정 확인
7
+ - 플랫폼/스테이지별 서버 설정 로딩 (`pub|gov`, `prod|beta`)
8
+ - 플레이어 옵션 병합 및 검증
9
+ - 무료 요금제 강제 옵션 템플릿 적용
10
+ - MA(통계/리포트) 동기화 및 전송
11
+ - i18n 문자열 조회 (`$t`)
12
+ - HLS 마스터 플레이리스트 파싱
13
+
14
+ ## 설치
15
+ ```bash
16
+ pnpm install
17
+ ```
18
+
19
+ ## 기본 사용법
20
+ ```ts
21
+ import VpeCore from '@sgrsoft/vpe-core-sdk';
22
+
23
+ const vpe = new VpeCore({
24
+ accessKey: 'YOUR_ACCESS_KEY',
25
+ appId: location.origin,
26
+ platform: 'pub',
27
+ stage: 'prod',
28
+ isDev: false,
29
+ });
30
+
31
+ const result = await vpe.initialize();
32
+ if (result.error) {
33
+ console.error(result.error);
34
+ return;
35
+ }
36
+
37
+ const options = vpe.getValidatedOptions({
38
+ autostart: false,
39
+ });
40
+ console.log(options);
41
+ ```
42
+
43
+ ## API 요약
44
+ ### VpeCore 생성자
45
+ - `accessKey`: 인증 키
46
+ - `appId`: 앱/도메인 식별자
47
+ - `platform`: `pub` 또는 `gov`
48
+ - `stage`: `prod` 또는 `beta`
49
+ - `isDev`: 개발 모드일 때 `true`
50
+ - `language`: i18n 언어 코드
51
+
52
+ ### 주요 메서드
53
+ - `initialize()`: 서버 설정과 MA 초기화 수행
54
+ - `isInitialized()`: 서버 설정 로딩 여부
55
+ - `isPaidTier()`: 요금제 유료 여부
56
+ - `getValidatedOptions(options)`: 서버 옵션과 로컬 옵션 병합
57
+ - `$t(key)`: i18n 문자열 조회
58
+ - `getErrorState()`: 마지막 에러 상태 반환
59
+ - `hlsPaser(url)`: HLS 마스터 플레이리스트 파싱
60
+
61
+ ## 예제
62
+ - `example/` 디렉터리의 최소 연동 샘플로 동작 확인
63
+ - 실행: `pnpm dev`
64
+
65
+ ## 빌드
66
+ ```bash
67
+ pnpm build
68
+ pnpm build:types
69
+ ```
70
+
71
+ ## 배포 산출물
72
+ `dist/`에 다음 파일만 배포 대상으로 유지합니다.
73
+ - `vpe-core-sdk.es.js`
74
+ - `vpe-core-sdk.cjs.js`
75
+ - `main.d.ts`
76
+
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  import { VpeCore } from './main';
2
+ export { getTranslator } from './locales/i18n';
3
+ export type { Language } from './locales/i18n';
2
4
  export default VpeCore;
@@ -100,6 +100,38 @@ declare const _default: {
100
100
  desc: string;
101
101
  };
102
102
  };
103
+ tv: {
104
+ default: string;
105
+ quality: string;
106
+ subtitleStyle: string;
107
+ subtitleStyleDesc: string;
108
+ applyDefaultStyle: string;
109
+ fontColor: string;
110
+ fontSize: string;
111
+ textOpacity: string;
112
+ edgeStyle: string;
113
+ bgColor: string;
114
+ bgOpacity: string;
115
+ windowColor: string;
116
+ windowOpacity: string;
117
+ color: {
118
+ white: string;
119
+ black: string;
120
+ red: string;
121
+ green: string;
122
+ blue: string;
123
+ yellow: string;
124
+ magenta: string;
125
+ cyan: string;
126
+ };
127
+ edge: {
128
+ none: string;
129
+ dropShadow: string;
130
+ raised: string;
131
+ depressed: string;
132
+ uniform: string;
133
+ };
134
+ };
103
135
  alternative: {
104
136
  hour: string;
105
137
  minute: string;
@@ -101,6 +101,38 @@ export declare const translations: {
101
101
  desc: string;
102
102
  };
103
103
  };
104
+ tv: {
105
+ default: string;
106
+ quality: string;
107
+ subtitleStyle: string;
108
+ subtitleStyleDesc: string;
109
+ applyDefaultStyle: string;
110
+ fontColor: string;
111
+ fontSize: string;
112
+ textOpacity: string;
113
+ edgeStyle: string;
114
+ bgColor: string;
115
+ bgOpacity: string;
116
+ windowColor: string;
117
+ windowOpacity: string;
118
+ color: {
119
+ white: string;
120
+ black: string;
121
+ red: string;
122
+ green: string;
123
+ blue: string;
124
+ yellow: string;
125
+ magenta: string;
126
+ cyan: string;
127
+ };
128
+ edge: {
129
+ none: string;
130
+ dropShadow: string;
131
+ raised: string;
132
+ depressed: string;
133
+ uniform: string;
134
+ };
135
+ };
104
136
  alternative: {
105
137
  hour: string;
106
138
  minute: string;
@@ -216,6 +248,38 @@ export declare const translations: {
216
248
  desc: string;
217
249
  };
218
250
  };
251
+ tv: {
252
+ default: string;
253
+ quality: string;
254
+ subtitleStyle: string;
255
+ subtitleStyleDesc: string;
256
+ applyDefaultStyle: string;
257
+ fontColor: string;
258
+ fontSize: string;
259
+ textOpacity: string;
260
+ edgeStyle: string;
261
+ bgColor: string;
262
+ bgOpacity: string;
263
+ windowColor: string;
264
+ windowOpacity: string;
265
+ color: {
266
+ white: string;
267
+ black: string;
268
+ red: string;
269
+ green: string;
270
+ blue: string;
271
+ yellow: string;
272
+ magenta: string;
273
+ cyan: string;
274
+ };
275
+ edge: {
276
+ none: string;
277
+ dropShadow: string;
278
+ raised: string;
279
+ depressed: string;
280
+ uniform: string;
281
+ };
282
+ };
219
283
  alternative: {
220
284
  hour: string;
221
285
  minute: string;
@@ -331,6 +395,38 @@ export declare const translations: {
331
395
  desc: string;
332
396
  };
333
397
  };
398
+ tv: {
399
+ default: string;
400
+ quality: string;
401
+ subtitleStyle: string;
402
+ subtitleStyleDesc: string;
403
+ applyDefaultStyle: string;
404
+ fontColor: string;
405
+ fontSize: string;
406
+ textOpacity: string;
407
+ edgeStyle: string;
408
+ bgColor: string;
409
+ bgOpacity: string;
410
+ windowColor: string;
411
+ windowOpacity: string;
412
+ color: {
413
+ white: string;
414
+ black: string;
415
+ red: string;
416
+ green: string;
417
+ blue: string;
418
+ yellow: string;
419
+ magenta: string;
420
+ cyan: string;
421
+ };
422
+ edge: {
423
+ none: string;
424
+ dropShadow: string;
425
+ raised: string;
426
+ depressed: string;
427
+ uniform: string;
428
+ };
429
+ };
334
430
  alternative: {
335
431
  hour: string;
336
432
  minute: string;
@@ -453,6 +549,38 @@ export declare function getTranslator(language?: Language | string): {
453
549
  desc: string;
454
550
  };
455
551
  };
552
+ tv: {
553
+ default: string;
554
+ quality: string;
555
+ subtitleStyle: string;
556
+ subtitleStyleDesc: string;
557
+ applyDefaultStyle: string;
558
+ fontColor: string;
559
+ fontSize: string;
560
+ textOpacity: string;
561
+ edgeStyle: string;
562
+ bgColor: string;
563
+ bgOpacity: string;
564
+ windowColor: string;
565
+ windowOpacity: string;
566
+ color: {
567
+ white: string;
568
+ black: string;
569
+ red: string;
570
+ green: string;
571
+ blue: string;
572
+ yellow: string;
573
+ magenta: string;
574
+ cyan: string;
575
+ };
576
+ edge: {
577
+ none: string;
578
+ dropShadow: string;
579
+ raised: string;
580
+ depressed: string;
581
+ uniform: string;
582
+ };
583
+ };
456
584
  alternative: {
457
585
  hour: string;
458
586
  minute: string;
@@ -567,6 +695,38 @@ export declare function getTranslator(language?: Language | string): {
567
695
  desc: string;
568
696
  };
569
697
  };
698
+ tv: {
699
+ default: string;
700
+ quality: string;
701
+ subtitleStyle: string;
702
+ subtitleStyleDesc: string;
703
+ applyDefaultStyle: string;
704
+ fontColor: string;
705
+ fontSize: string;
706
+ textOpacity: string;
707
+ edgeStyle: string;
708
+ bgColor: string;
709
+ bgOpacity: string;
710
+ windowColor: string;
711
+ windowOpacity: string;
712
+ color: {
713
+ white: string;
714
+ black: string;
715
+ red: string;
716
+ green: string;
717
+ blue: string;
718
+ yellow: string;
719
+ magenta: string;
720
+ cyan: string;
721
+ };
722
+ edge: {
723
+ none: string;
724
+ dropShadow: string;
725
+ raised: string;
726
+ depressed: string;
727
+ uniform: string;
728
+ };
729
+ };
570
730
  alternative: {
571
731
  hour: string;
572
732
  minute: string;
@@ -681,6 +841,38 @@ export declare function getTranslator(language?: Language | string): {
681
841
  desc: string;
682
842
  };
683
843
  };
844
+ tv: {
845
+ default: string;
846
+ quality: string;
847
+ subtitleStyle: string;
848
+ subtitleStyleDesc: string;
849
+ applyDefaultStyle: string;
850
+ fontColor: string;
851
+ fontSize: string;
852
+ textOpacity: string;
853
+ edgeStyle: string;
854
+ bgColor: string;
855
+ bgOpacity: string;
856
+ windowColor: string;
857
+ windowOpacity: string;
858
+ color: {
859
+ white: string;
860
+ black: string;
861
+ red: string;
862
+ green: string;
863
+ blue: string;
864
+ yellow: string;
865
+ magenta: string;
866
+ cyan: string;
867
+ };
868
+ edge: {
869
+ none: string;
870
+ dropShadow: string;
871
+ raised: string;
872
+ depressed: string;
873
+ uniform: string;
874
+ };
875
+ };
684
876
  alternative: {
685
877
  hour: string;
686
878
  minute: string;
@@ -796,6 +988,38 @@ declare const _default: {
796
988
  desc: string;
797
989
  };
798
990
  };
991
+ tv: {
992
+ default: string;
993
+ quality: string;
994
+ subtitleStyle: string;
995
+ subtitleStyleDesc: string;
996
+ applyDefaultStyle: string;
997
+ fontColor: string;
998
+ fontSize: string;
999
+ textOpacity: string;
1000
+ edgeStyle: string;
1001
+ bgColor: string;
1002
+ bgOpacity: string;
1003
+ windowColor: string;
1004
+ windowOpacity: string;
1005
+ color: {
1006
+ white: string;
1007
+ black: string;
1008
+ red: string;
1009
+ green: string;
1010
+ blue: string;
1011
+ yellow: string;
1012
+ magenta: string;
1013
+ cyan: string;
1014
+ };
1015
+ edge: {
1016
+ none: string;
1017
+ dropShadow: string;
1018
+ raised: string;
1019
+ depressed: string;
1020
+ uniform: string;
1021
+ };
1022
+ };
799
1023
  alternative: {
800
1024
  hour: string;
801
1025
  minute: string;
@@ -910,6 +1134,38 @@ declare const _default: {
910
1134
  desc: string;
911
1135
  };
912
1136
  };
1137
+ tv: {
1138
+ default: string;
1139
+ quality: string;
1140
+ subtitleStyle: string;
1141
+ subtitleStyleDesc: string;
1142
+ applyDefaultStyle: string;
1143
+ fontColor: string;
1144
+ fontSize: string;
1145
+ textOpacity: string;
1146
+ edgeStyle: string;
1147
+ bgColor: string;
1148
+ bgOpacity: string;
1149
+ windowColor: string;
1150
+ windowOpacity: string;
1151
+ color: {
1152
+ white: string;
1153
+ black: string;
1154
+ red: string;
1155
+ green: string;
1156
+ blue: string;
1157
+ yellow: string;
1158
+ magenta: string;
1159
+ cyan: string;
1160
+ };
1161
+ edge: {
1162
+ none: string;
1163
+ dropShadow: string;
1164
+ raised: string;
1165
+ depressed: string;
1166
+ uniform: string;
1167
+ };
1168
+ };
913
1169
  alternative: {
914
1170
  hour: string;
915
1171
  minute: string;
@@ -1024,6 +1280,38 @@ declare const _default: {
1024
1280
  desc: string;
1025
1281
  };
1026
1282
  };
1283
+ tv: {
1284
+ default: string;
1285
+ quality: string;
1286
+ subtitleStyle: string;
1287
+ subtitleStyleDesc: string;
1288
+ applyDefaultStyle: string;
1289
+ fontColor: string;
1290
+ fontSize: string;
1291
+ textOpacity: string;
1292
+ edgeStyle: string;
1293
+ bgColor: string;
1294
+ bgOpacity: string;
1295
+ windowColor: string;
1296
+ windowOpacity: string;
1297
+ color: {
1298
+ white: string;
1299
+ black: string;
1300
+ red: string;
1301
+ green: string;
1302
+ blue: string;
1303
+ yellow: string;
1304
+ magenta: string;
1305
+ cyan: string;
1306
+ };
1307
+ edge: {
1308
+ none: string;
1309
+ dropShadow: string;
1310
+ raised: string;
1311
+ depressed: string;
1312
+ uniform: string;
1313
+ };
1314
+ };
1027
1315
  alternative: {
1028
1316
  hour: string;
1029
1317
  minute: string;
@@ -100,6 +100,38 @@ declare const _default: {
100
100
  desc: string;
101
101
  };
102
102
  };
103
+ tv: {
104
+ default: string;
105
+ quality: string;
106
+ subtitleStyle: string;
107
+ subtitleStyleDesc: string;
108
+ applyDefaultStyle: string;
109
+ fontColor: string;
110
+ fontSize: string;
111
+ textOpacity: string;
112
+ edgeStyle: string;
113
+ bgColor: string;
114
+ bgOpacity: string;
115
+ windowColor: string;
116
+ windowOpacity: string;
117
+ color: {
118
+ white: string;
119
+ black: string;
120
+ red: string;
121
+ green: string;
122
+ blue: string;
123
+ yellow: string;
124
+ magenta: string;
125
+ cyan: string;
126
+ };
127
+ edge: {
128
+ none: string;
129
+ dropShadow: string;
130
+ raised: string;
131
+ depressed: string;
132
+ uniform: string;
133
+ };
134
+ };
103
135
  alternative: {
104
136
  hour: string;
105
137
  minute: string;
@@ -100,6 +100,38 @@ declare const _default: {
100
100
  desc: string;
101
101
  };
102
102
  };
103
+ tv: {
104
+ default: string;
105
+ quality: string;
106
+ subtitleStyle: string;
107
+ subtitleStyleDesc: string;
108
+ applyDefaultStyle: string;
109
+ fontColor: string;
110
+ fontSize: string;
111
+ textOpacity: string;
112
+ edgeStyle: string;
113
+ bgColor: string;
114
+ bgOpacity: string;
115
+ windowColor: string;
116
+ windowOpacity: string;
117
+ color: {
118
+ white: string;
119
+ black: string;
120
+ red: string;
121
+ green: string;
122
+ blue: string;
123
+ yellow: string;
124
+ magenta: string;
125
+ cyan: string;
126
+ };
127
+ edge: {
128
+ none: string;
129
+ dropShadow: string;
130
+ raised: string;
131
+ depressed: string;
132
+ uniform: string;
133
+ };
134
+ };
103
135
  alternative: {
104
136
  hour: string;
105
137
  minute: string;