@sgrsoft/vpe-core-sdk 0.5.0 → 0.7.0

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.
@@ -0,0 +1,2 @@
1
+ import { VpeCore } from './main';
2
+ export default VpeCore;
@@ -15,7 +15,7 @@ declare class MaManager {
15
15
  /**
16
16
  * 객체가 순수 객체인지 확인합니다.
17
17
  */
18
- isPlainObject(value: any): boolean;
18
+ isPlainObject(value: any): value is Record<string, any>;
19
19
  /**
20
20
  * MA 리포트를 전송합니다.
21
21
  */
package/dist/main.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Language } from './locales/i18n';
2
- import { type VpePlayerProps } from './options';
2
+ import { VpePlayerOptions, type VpePlayerProps } from './options';
3
3
  declare const ENCODED_API_PATH: {
4
4
  gov: {
5
5
  prod: {
@@ -76,7 +76,79 @@ export declare class VpeCore {
76
76
  initialize(): Promise<{
77
77
  error: {
78
78
  errorCode: string;
79
- errorMessage: any;
79
+ errorMessage: {
80
+ title: string;
81
+ desc: string;
82
+ } | {
83
+ title: string;
84
+ desc: string;
85
+ } | {
86
+ title: string;
87
+ desc: string;
88
+ } | {
89
+ title: string;
90
+ desc: string;
91
+ } | {
92
+ title: string;
93
+ desc: string;
94
+ } | {
95
+ title: string;
96
+ desc: string;
97
+ } | {
98
+ title: string;
99
+ desc: string;
100
+ } | {
101
+ title: string;
102
+ desc: string;
103
+ } | {
104
+ title: string;
105
+ desc: string;
106
+ } | {
107
+ title: string;
108
+ desc: string;
109
+ } | {
110
+ title: string;
111
+ desc: string;
112
+ } | {
113
+ title: string;
114
+ desc: string;
115
+ } | {
116
+ title: string;
117
+ desc: string;
118
+ } | {
119
+ title: string;
120
+ desc: string;
121
+ } | {
122
+ title: string;
123
+ desc: string;
124
+ } | {
125
+ title: string;
126
+ desc: string;
127
+ } | {
128
+ title: string;
129
+ desc: string;
130
+ } | {
131
+ title: string;
132
+ desc: string;
133
+ } | {
134
+ title: string;
135
+ desc: string;
136
+ } | {
137
+ title: string;
138
+ desc: string;
139
+ } | {
140
+ title: string;
141
+ desc: string;
142
+ } | {
143
+ title: string;
144
+ desc: string;
145
+ } | {
146
+ title: string;
147
+ desc: string;
148
+ } | {
149
+ title: string;
150
+ desc: string;
151
+ };
80
152
  };
81
153
  options?: undefined;
82
154
  playerInfo?: undefined;
@@ -91,11 +163,11 @@ export declare class VpeCore {
91
163
  private setErrorRun;
92
164
  isPaidTier(): boolean;
93
165
  isInitialized(): boolean;
94
- getValidatedOptions(options?: Partial<VpePlayerProps>): VpePlayerProps;
166
+ getValidatedOptions(options?: Partial<VpePlayerOptions>): VpePlayerOptions;
95
167
  /**
96
168
  *
97
169
  * @param key
98
170
  */
99
171
  $t(key: string): string;
100
172
  }
101
- export default VpeCore;
173
+ export {};
package/dist/options.d.ts CHANGED
@@ -5,7 +5,7 @@ export interface VpePlayerOptions {
5
5
  autostart?: boolean;
6
6
  muted?: boolean;
7
7
  aspectRatio?: string;
8
- objectFit?: 'contain' | 'cover' | 'fill' | 'scale-down';
8
+ objectFit?: 'contain' | 'cover' | 'fill' | 'scale-down' | 'stretch';
9
9
  controls?: boolean;
10
10
  allowsPictureInPicture?: boolean;
11
11
  staysActiveInBackground?: boolean;
@@ -47,7 +47,7 @@ export interface VpePlayerOptions {
47
47
  devTestAppId?: string;
48
48
  token?: string;
49
49
  override?: any;
50
- captionStyle: VpePlayerCaptionStyle;
50
+ captionStyle?: VpePlayerCaptionStyle;
51
51
  }
52
52
  export interface VpePlayerCaptionStyle {
53
53
  fontSize?: number;
@@ -75,7 +75,7 @@ export interface VpePlayerEvents {
75
75
  error?: (data: any) => void;
76
76
  }
77
77
  export interface VpePlayerProps {
78
- options?: VpePlayerOptions;
78
+ options?: Partial<VpePlayerOptions>;
79
79
  events?: VpePlayerEvents;
80
80
  accessKey?: string;
81
81
  devTestAppId?: string;
@@ -87,10 +87,11 @@ export interface VpePlayerProps {
87
87
  override?: any;
88
88
  icon?: any;
89
89
  isDev?: any;
90
+ maUse?: 'Y' | 'N';
90
91
  }
91
92
  /**
92
93
  * 사용자가 전달한 옵션과 기본 옵션을 병합하여 완전한 옵션 객체를 반환합니다.
93
94
  * @param options - 사용자가 VpePlayer에 전달한 옵션 객체
94
95
  * @returns 기본값이 채워진 완전한 옵션 객체
95
96
  */
96
- export declare const getValidatedOptions: (options?: VpePlayerOptions) => VpePlayerOptions;
97
+ export declare const getValidatedOptions: (options?: Partial<VpePlayerOptions>) => VpePlayerOptions;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y={common:{cancel:"Cancel",auto:"Auto",normal:"Normal",notUse:"Not used",prev:"Previous video",next:"Next video",delayText:"seconds until auto-play",license:"License",play:"Play",pause:"Pause",replay:"Replay",fullOn:"Fullscreen",fullOff:"Exit fullscreen",muteOn:"Mute",muteOff:"Unmute",captionOff:"Turn off captions",captionOn:"Turn on captions",setting:"Settings",live:"LIVE",miniPlayer:"Mini player",isMute:"You are muted.",subtitle:"Subtitles",subtitleNot:"Subtitles not available"},settings:{autoplay:"Autoplay",playbackRate:"Playback speed",captions:"Subtitles",quality:"Quality"},error:{"01":{title:"Cannot play video",desc:"Invalid access. Please check your access_key."},"02":{title:"Cannot play video",desc:"You do not have permission to play this video."},"03":{title:"Authentication Failed",desc:"The network connection is unstable."},"04":{title:"Cannot play video",desc:"The video could not be played."},"05":{title:"Cannot play video",desc:"The license is not valid."},"06":{title:"Cannot play video",desc:"Monthly basic API calls exceeded. Please switch to a paid version."},"07":{title:"Cannot play video",desc:"Unsupported format."},"08":{title:"Cannot play video",desc:"Invalid URL format."},"09":{title:"Cannot play video",desc:"The live stream is OFFLINE."},10:{title:"Cannot play video",desc:"Cannot play DASH video on iOS."},11:{title:"Cannot play video",desc:"Invalid DRM token."},12:{title:"Cannot play video",desc:"Failed to communicate with the DRM license server."},13:{title:"Cannot play video",desc:"FairPlay certificate validation failed."},14:{title:"Cannot play video",desc:"Screen capture / screen recording has been detected."}},alternative:{hour:"hour(s)",minute:"minute(s)",second:"second(s)",after:"In a moment",afterMin:"min",afterHour:"hour",afterDay:"day",startPlay:"Video will start in {timeTxt}.",nextPlay:"Next video will play in {timeTxt} seconds.",afterPlay:"Scheduled"}},g={common:{cancel:"취소",auto:"자동",normal:"보통",notUse:"사용안함",prev:"이전 동영상",next:"다음 동영상",delayText:"초 뒤 자동재생",license:"라이선스",play:"재생",pause:"일시정지",replay:"다시보기",fullOn:"전체화면",fullOff:"전체화면 해제",muteOn:"음소거",muteOff:"음소거 해제",captionOff:"자막끄기",captionOn:"자막켜기",setting:"설정",live:"실시간",miniPlayer:"미니플레이어",isMute:"음소거 상태입니다.",subtitle:"자막",subtitleNot:"자막 사용 불가"},settings:{autoplay:"자동재생",playbackRate:"재생 속도",captions:"자막",quality:"해상도"},error:{"01":{title:"동영상을 재생할 수 없음",desc:"잘못된 접근입니다. access_key를 확인해주세요."},"02":{title:"동영상을 재생할 수 없음",desc:"동영상을 재생할 권한이 없습니다."},"03":{title:"인증 실패",desc:"네트워크 연결이 원활하지 않습니다."},"04":{title:"동영상을 재생할 수 없음",desc:"동영상을 재생할 수 없습니다."},"05":{title:"동영상을 재생할 수 없음",desc:"라이선스가 유효하지 않습니다."},"06":{title:"동영상을 재생할 수 없음",desc:"월 기본 제공 호출 건수를 초과하였습니다. 유료 버전으로 전환 후 사용 부탁 드립니다."},"07":{title:"동영상을 재생할 수 없음",desc:"지원하지 않는 형식입니다."},"08":{title:"동영상을 재생할 수 없음",desc:"URL 형식이 잘못되었습니다."},"09":{title:"동영상을 재생할 수 없음",desc:"라이브스트림이 OFFLINE 입니다."},10:{title:"동영상을 재생할 수 없음",desc:"iOS에서 Dash 비디오를 재생할 수 없습니다."},11:{title:"동영상을 재생할 수 없음",desc:"DRM 토큰이 잘못되었습니다."},12:{title:"동영상을 재생할 수 없음",desc:"DRM 라이선스 서버와 통신에 실패하였습니다."},13:{title:"동영상을 재생할 수 없음",desc:"FairPlay 인증서 검증에 실패하였습니다."},14:{title:"동영상을 재생할 수 없음",desc:"화면 캡쳐 / 화면 녹화가 감지되었습니다."}},alternative:{hour:"시",minute:"분",second:"초",after:"잠시 ",afterMin:"분 ",afterHour:"시간 ",afterDay:"일 ",startPlay:"{timeTxt} 후 영상이 시작됩니다.",nextPlay:"{timeTxt}초 후 다음 영상이 재생됩니다.",afterPlay:"예정"}},m={common:{cancel:"キャンセル",auto:"自動",normal:"標準",notUse:"使用しない",prev:"前の動画",next:"次の動画",delayText:"秒後に自動再生",license:"ライセンス",play:"再生",pause:"一時停止",replay:"リプレイ",fullOn:"全画面表示",fullOff:"全画面表示を終了",muteOn:"ミュート",muteOff:"ミュート解除",captionOff:"字幕をオフにする",captionOn:"字幕をオンにする",setting:"設定",live:"ライブ",miniPlayer:"ミニプレーヤー",isMute:"ミュート状態です。",subtitle:"字幕",subtitleNot:"字幕は利用できません"},settings:{autoplay:"自動再生",playbackRate:"再生速度",captions:"字幕",quality:"画質"},error:{"01":{title:"動画を再生できません",desc:"不正なアクセスです。access_keyを確認してください。"},"02":{title:"動画を再生できません",desc:"この動画を再生する権限がありません。"},"03":{title:"認証に失敗しました",desc:"ネットワーク接続が不安定です。"},"04":{title:"動画を再生できません",desc:"動画を再生できませんでした。"},"05":{title:"動画を再生できません",desc:"ライセンスが無効です。"},"06":{title:"動画を再生できません",desc:"月間の基本提供呼び出し回数を超過しました。有料版に切り替えてご利用ください。"},"07":{title:"動画を再生できません",desc:"サポートされていない形式です。"},"08":{title:"動画を再生できません",desc:"URLの形式が正しくありません。"},"09":{title:"動画を再生できません",desc:"ライブストリームはオフラインです。"},10:{title:"動画を再生できません",desc:"iOSではDASHビデオを再生できません。"},11:{title:"動画を再生できません",desc:"DRMトークンが無効です。"},12:{title:"動画を再生できません",desc:"DRMライセンスサーバーとの通信に失敗しました。"},13:{title:"動画を再生できません",desc:"FairPlay証明書の検証に失敗しました。"},14:{title:"動画を再生できません",desc:"画面キャプチャ/画面録画が検出されました。"}},alternative:{hour:"時間",minute:"分",second:"秒",after:"しばらくして",afterMin:"分後",afterHour:"時間後",afterDay:"日後",startPlay:"{timeTxt}後に動画が始まります。",nextPlay:"{timeTxt}秒後に次の動画が再生されます。",afterPlay:"予定"}},h={common:{cancel:"取消",auto:"自动",normal:"一般",notUse:"不使用",prev:"上一个视频",next:"下一个视频",delayText:"{0}秒后自动播放",license:"许可",play:"播放",pause:"暂停",replay:"重新观看",fullOn:"全屏",fullOff:"解除全屏",muteOn:"静音",muteOff:"解除静音",captionOff:"关闭字幕",captionOn:"开启字幕",setting:"设定",live:"LIVE",miniPlayer:"迷你播放器",isMute:"当前处于静音状态。"},settings:{autoplay:"自动播放",playbackRate:"播放速度",captions:"字幕",quality:"分辨率"},error:{"01":{title:"无法播放视频",desc:"错误的访问。"},"02":{title:"无法播放视频",desc:"因权限问题,无法播放视频。"},"03":{title:"认证失败",desc:"网络连接不稳定。"},"04":{title:"无法播放视频",desc:"无法播放视频。"},"05":{title:"无法播放视频",desc:"该许可无效。"},"06":{title:"无法播放视频",desc:"已超过每月基本提供的调用次数。请转换为付费版本后使用。"}},alternative:{hour:"小时",minute:"分钟",second:"秒",after:"请稍后",afterMin:"分钟后",afterHour:"小时后",afterDay:"天后",startPlay:"{timeTxt}之后开始播放视频。",nextPlay:"{timeTxt}秒后,将播放下一个视频。",afterPlay:"预计"}},c={en:y,ko:g,ja:m,zh:h},v=()=>typeof navigator<"u"&&typeof navigator.language<"u";function S(t){const e=t.split("-")[0];return e in c?e:"en"}function u(t){let e="en";t?e=t:v()&&(e=navigator.language);const n=S(e);return c[n]}u();const b={AF:"Afghanistan",AX:"Åland Islands",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia (Plurinational State of)",BQ:"Bonaire, Sint Eustatius and Saba",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",CV:"Cabo Verde",KH:"Cambodia",CM:"Cameroon",CA:"Canada",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:"Congo",CD:"Congo (Democratic Republic of the)",CK:"Cook Islands",CR:"Costa Rica",CI:"Côte d'Ivoire",HR:"Croatia",CU:"Cuba",CW:"Curaçao",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands (Malvinas)",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and McDonald Islands",VA:"Holy See",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran (Islamic Republic of)",IQ:"Iraq",IE:"Ireland",IM:"Isle of Man",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JE:"Jersey",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"Korea (Democratic People's Republic of)",KR:"Korea, Republic of",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Lao People's Democratic Republic",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MK:"Macedonia (the former Yugoslav Republic of)",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia (Federated States of)",MD:"Moldova (Republic of)",MC:"Monaco",MN:"Mongolia",ME:"Montenegro",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestine, State of",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russian Federation",RW:"Rwanda",BL:"Saint Barthélemy",SH:"Saint Helena, Ascension and Tristan da Cunha",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",MF:"Saint Martin (French part)",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",RS:"Serbia",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SX:"Sint Maarten (Dutch part)",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and the South Sandwich Islands",SS:"South Sudan",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Swaziland",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:"Taiwan",TJ:"Tajikistan",TZ:"Tanzania, United Republic of",TH:"Thailand",TL:"Timor-Leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States of America",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela (Bolivarian Republic of)",VN:"Viet Nam",VG:"Virgin Islands (British)",VI:"Virgin Islands (U.S.)",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe"},M={gov:{prod:{log:"https://papi.vpe.gov-ntruss.com/player/maSync",report:"https://log.vpe.gov-ntruss.com/stats"},beta:{log:"https://papi.beta-vpe.gov-ntruss.com/player/maSync",report:"https://log.beta-vpe.gov-ntruss.com/stats"}},pub:{prod:{log:"https://papi.vpe.naverncp.com/player/maSync",report:"https://log.vpe.naverncp.com/stats"},beta:{log:"https://papi.beta-vpe.naverncp.com/player/maSync",report:"https://log.beta-vpe.naverncp.com/stats"}}};let s={video:{},browser:{},device:{},connection:{},screen:{},player_version:"latest",extra:{sessionId:null,playerType:"VPE React Native"},log_type:"vpe",privacy:{cookie_enabled:!0}},l={platform:"pub",stage:"prod",sync:!1,syncResult:{}};const C=new Date().getTime(),d=()=>{const t=new Date,e=r=>String(r).padStart(2,"0"),n=`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())} ${e(t.getHours())}:${e(t.getMinutes())}:${e(t.getSeconds())}`,a=Math.floor(t.getTime()/1e3),i=new Date().getTime()-C;return{logDate:n,logDateUnix:a,thisSec:i}};function I(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function w(t,e){Object.entries(e).forEach(([n,a])=>{I(a)?(t[n]||(t[n]={}),Object.entries(a).forEach(([i,r])=>{r!=null&&(t[n][i]=r)})):a!=null&&(t[n]=a)})}function P(t){const e=[];return t?.r1&&e.push(t.r1),t?.r2&&e.push(t.r2),t?.r3&&e.push(t.r3),e.join(" ")}function T(t){try{const e=l.syncResult?.geoLocation;e&&(t.address=P(e),t.isp=e.net||"",t.ip=l.syncResult?.ip||"",t.nation=e.country||"")}catch{}}const R=async t=>{if(!t)return;const{platform:e,stage:n}=l,a=M[e][n].log;try{const r=await(await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({access_key:t})})).json();l.sync=r.result?.sync||!1,l.syncResult=r.result||{};const{logDate:o,logDateUnix:f}=d();return s.extra.logDate=o,s.extra.logDateUnix=f,l.syncResult?.geoLocation&&T(s.extra),r}catch(i){return console.error("MA config initialization failed:",i),null}};async function B(t,e,n,a,i){l.platform=t,l.stage=e,w(s,n),s.browser.lang=b[s.extra.nation]||"ko-KR";const{logDate:r,logDateUnix:o}=d();s.extra.logDate=r,s.extra.logDateUnix=o,s.extra.created_at=o}const A=(t={})=>{const e={autostart:!0,muted:!1,aspectRatio:"16/9",objectFit:"contain",controls:!0,keyboardShortcut:!1,startMutedInfoNotVisible:!1,allowsPictureInPicture:!1,staysActiveInBackground:!1,screenRecordingPrevention:!1,modalFullscreen:!1,lang:"ko",ui:"all",controlBtn:{play:!0,fullscreen:!0,progressBar:!0,volume:!1,times:!0,pictureInPicture:!0,setting:!0,subtitle:!0},progressBarColor:"#4299f5",controlActiveTime:3e3,playRateSetting:[.5,.75,1,1.5,2],autoPause:!1,repeat:!1,setStartTime:null,playIndex:0,lowLatencyMode:!0,touchGestures:!0,descriptionNotVisible:!1,devTestAppId:null,token:"",visibleWatermark:!1,watermarkText:"NAVER CLOUD PLATFORM",watermarkConfig:{randPosition:!0,randPositionInterVal:3e3,x:10,y:10,opacity:.5},captionStyle:{fontSize:12,color:"#ffffff",backgroundColor:"rgba(0, 0, 0, 0.4)",edgeStyle:"dropshadow"},override:null},n={...e,...t};return t.controlBtn&&(n.controlBtn={...e.controlBtn,...t.controlBtn}),t.watermarkConfig&&(n.watermarkConfig={...e.watermarkConfig,...t.watermarkConfig}),t.captionStyle&&(n.captionStyle={...e.captionStyle,...t.captionStyle}),n.objectFit=="fill"&&(n.objectFit="stretch"),n.controlBtn.progressBar==null&&(n.controlBtn.progressBar=!0),n},L={gov:{prod:{config:"aHR0cHM6Ly9wYXBpLnZwZS5nb3YtbnRydXNzLmNvbS9wbGF5ZXIvY29uZmln",report:"aHR0cHM6Ly9sb2cudnBlLmdvdi1udHJ1c3MuY29tL3N0YXRz"},beta:{config:"aHR0cHM6Ly9wYXBpLmJldGEtdnBlLmdvdi1udHJ1c3MuY29tL3BsYXllci9jb25maWc=",report:"aHR0cHM6Ly9sb2cuYmV0YS12cGUuZ292LW50cnVzcy5jb20vc3RhdHM="}},pub:{prod:{config:"aHR0cHM6Ly9wYXBpLnZwZS5uYXZlcm5jcC5jb20vcGxheWVyL2NvbmZpZw==",report:"aHR0cHM6Ly9sb2cudnBlLm5hdmVybmNwLmNvbS9zdGF0cw=="},beta:{config:"aHR0cHM6Ly9wYXBpLmJldGEtdnBlLm5hdmVybmNwLmNvbS9wbGF5ZXIvY29uZmln",report:"aHR0cHM6Ly9sb2cuYmV0YS12cGUubmF2ZXJuY3AuY29tL3N0YXRz"}}},E=t=>{try{return atob(t)}catch(e){return console.error("Base64 decoding failed:",e),""}},N=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";class p{serverConfig={};playerInfo=null;accessKey;appId;platform;stage;isDev;translator;constructor({accessKey:e,appId:n,platform:a,stage:i,isDev:r=!1,language:o}){this.accessKey=e,this.appId=N()?location.origin:n,this.platform=a,this.stage=i,this.isDev=r,this.translator=u(o)}async initialize(){if(!this.accessKey||!this.appId)return console.warn("VPE Player: accessKey 또는 appId가 없어 키 인증을 건너뜁니다."),{error:this.setErrorRun("E0002")};try{const e=await this.performKeyCheck();return e.code!==200?{error:this.setErrorRun("E0001")}:(this.serverConfig=e,this.playerInfo=this.createPlayerInfo(e),await B(this.platform,this.stage,this.playerInfo,this.appId,this.accessKey),await R(this.accessKey),{options:this.serverConfig.result?.options,playerInfo:this.playerInfo})}catch(e){return console.error("VPE SDK Initialization failed:",e),{error:this.setErrorRun("E0003")}}}async performKeyCheck(){const e=this.isDev?"?preview=true":"",n=E(L[this.platform][this.stage].config)+e,a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({access_key:this.accessKey,domain:this.appId})});if(!a.ok)throw new Error(`API Error: ${a.status} ${a.statusText}`);return a.json()}getBrowserInfo(){const e=navigator.userAgent;return/Edg\/(\d+\.\d+)/.test(e)?{origin:"Edge",version:RegExp.$1}:/Chrome\/(\d+\.\d+)/.test(e)&&!e.includes("Edg")?{origin:"Chrome",version:RegExp.$1}:/Firefox\/(\d+\.\d+)/.test(e)?{origin:"Firefox",version:RegExp.$1}:/Version\/(\d+\.\d+)/.test(e)&&e.includes("Safari")?{origin:"Safari",version:RegExp.$1}:{origin:"Unknown",version:"Unknown"}}createPlayerInfo(e){const[n,a]=e.result.name.split("|"),i=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=this.getBrowserInfo(),o=navigator.userAgentData;return{cid:e.result.cid,player_name:n,player_version:a,pricing:e.result.pricing,maUse:e.result.options?.maUse==="Y"?"Y":"N",browser:{lang:navigator.language,ua:navigator.userAgent},screen:{width:window.screen.width,height:window.screen.height},connection:{network:i?.effectiveType??"unknown",downlink:i?.downlink??null,rtt:i?.rtt??null,save_data:i?.saveData??!1},device:{platform:o?.platform??"Unknown",mobile:o?.mobile??!1,memory:navigator.deviceMemory??null,processor:navigator.hardwareConcurrency??null},video:{url:""},extra:{vpeKey:this.accessKey,playerType:"VPE",playerVersion:a,device:o?.platform??"Unknown",os:o?.platform??"Unknown",osOrigin:o?.platform??"Unknown",osVersion:o?.platformVersion??"Unknown",vpePackageId:this.appId,actionDuration:0,actionType:"ready",browser:r.origin,browserOrigin:r.origin,browserVersion:r.version,protocol:location.protocol,quality:"Other",qualityOrigin:"Auto",host:`${this.appId}&${o?.platform??"Unknown"}&${o?.platformVersion??"Unknown"}`,location:`${this.appId}://appView/video/vpe`,title:""}}}setErrorRun(e){const n=e.slice(-2),a=this.translator.error[n]||this.translator.error["01"],i={errorCode:e,errorMessage:a};return console.log("VPE Error : ",i),i}isPaidTier(){return this.serverConfig.result?.pricing==="pay"}isInitialized(){return!!this.serverConfig.result}getValidatedOptions(e){const n=A(this.serverConfig.result?.options),a={...n,...e??{}};return e?.controlBtn&&(a.controlBtn={...n.controlBtn,...e.controlBtn}),e?.watermarkConfig&&(a.watermarkConfig={...n.watermarkConfig,...e.watermarkConfig}),a.playlist&&!Array.isArray(a.playlist)&&(a.playlist=[{file:a.playlist}]),a}$t(e){const n=e.split(".");let a=this.translator;for(const i of n)if(a&&typeof a=="object"&&i in a)a=a[i];else return e;return typeof a=="string"?a:e}}exports.VpeCore=p;exports.default=p;
1
+ "use strict";const f={common:{cancel:"Cancel",auto:"Auto",normal:"Normal",notUse:"Not used",prev:"Previous video",next:"Next video",delayText:"seconds until auto-play",license:"License",play:"Play",pause:"Pause",replay:"Replay",fullOn:"Fullscreen",fullOff:"Exit fullscreen",muteOn:"Mute",muteOff:"Unmute",captionOff:"Turn off captions",captionOn:"Turn on captions",setting:"Settings",live:"LIVE",miniPlayer:"Mini player",isMute:"You are muted.",subtitle:"Subtitles",subtitleNot:"Subtitles not available"},settings:{autoplay:"Autoplay",playbackRate:"Playback speed",captions:"Subtitles",quality:"Quality"},error:{"01":{title:"Cannot play video",desc:"Invalid access. Please check your access_key."},"02":{title:"Cannot play video",desc:"You do not have permission to play this video."},"03":{title:"Authentication Failed",desc:"The network connection is unstable."},"04":{title:"Cannot play video",desc:"The video could not be played."},"05":{title:"Cannot play video",desc:"The license is not valid."},"06":{title:"Cannot play video",desc:"Monthly basic API calls exceeded. Please switch to a paid version."},"07":{title:"Cannot play video",desc:"Unsupported format."},"08":{title:"Cannot play video",desc:"Invalid URL format."},"09":{title:"Cannot play video",desc:"The live stream is OFFLINE."},10:{title:"Cannot play video",desc:"Cannot play DASH video on iOS."},11:{title:"Cannot play video",desc:"Invalid DRM token."},12:{title:"Cannot play video",desc:"Failed to communicate with the DRM license server."},13:{title:"Cannot play video",desc:"FairPlay certificate validation failed."},14:{title:"Cannot play video",desc:"Screen capture / screen recording has been detected."}},alternative:{hour:"hour(s)",minute:"minute(s)",second:"second(s)",after:"In a moment",afterMin:"min",afterHour:"hour",afterDay:"day",startPlay:"Video will start in {timeTxt}.",nextPlay:"Next video will play in {timeTxt} seconds.",afterPlay:"Scheduled"}},y={common:{cancel:"취소",auto:"자동",normal:"보통",notUse:"사용안함",prev:"이전 동영상",next:"다음 동영상",delayText:"초 뒤 자동재생",license:"라이선스",play:"재생",pause:"일시정지",replay:"다시보기",fullOn:"전체화면",fullOff:"전체화면 해제",muteOn:"음소거",muteOff:"음소거 해제",captionOff:"자막끄기",captionOn:"자막켜기",setting:"설정",live:"실시간",miniPlayer:"미니플레이어",isMute:"음소거 상태입니다.",subtitle:"자막",subtitleNot:"자막 사용 불가"},settings:{autoplay:"자동재생",playbackRate:"재생 속도",captions:"자막",quality:"해상도"},error:{"01":{title:"동영상을 재생할 수 없음",desc:"잘못된 접근입니다. access_key를 확인해주세요."},"02":{title:"동영상을 재생할 수 없음",desc:"동영상을 재생할 권한이 없습니다."},"03":{title:"인증 실패",desc:"네트워크 연결이 원활하지 않습니다."},"04":{title:"동영상을 재생할 수 없음",desc:"동영상을 재생할 수 없습니다."},"05":{title:"동영상을 재생할 수 없음",desc:"라이선스가 유효하지 않습니다."},"06":{title:"동영상을 재생할 수 없음",desc:"월 기본 제공 호출 건수를 초과하였습니다. 유료 버전으로 전환 후 사용 부탁 드립니다."},"07":{title:"동영상을 재생할 수 없음",desc:"지원하지 않는 형식입니다."},"08":{title:"동영상을 재생할 수 없음",desc:"URL 형식이 잘못되었습니다."},"09":{title:"동영상을 재생할 수 없음",desc:"라이브스트림이 OFFLINE 입니다."},10:{title:"동영상을 재생할 수 없음",desc:"iOS에서 Dash 비디오를 재생할 수 없습니다."},11:{title:"동영상을 재생할 수 없음",desc:"DRM 토큰이 잘못되었습니다."},12:{title:"동영상을 재생할 수 없음",desc:"DRM 라이선스 서버와 통신에 실패하였습니다."},13:{title:"동영상을 재생할 수 없음",desc:"FairPlay 인증서 검증에 실패하였습니다."},14:{title:"동영상을 재생할 수 없음",desc:"화면 캡쳐 / 화면 녹화가 감지되었습니다."}},alternative:{hour:"시",minute:"분",second:"초",after:"잠시 ",afterMin:"분 ",afterHour:"시간 ",afterDay:"일 ",startPlay:"{timeTxt} 후 영상이 시작됩니다.",nextPlay:"{timeTxt}초 후 다음 영상이 재생됩니다.",afterPlay:"예정"}},g={common:{cancel:"キャンセル",auto:"自動",normal:"標準",notUse:"使用しない",prev:"前の動画",next:"次の動画",delayText:"秒後に自動再生",license:"ライセンス",play:"再生",pause:"一時停止",replay:"リプレイ",fullOn:"全画面表示",fullOff:"全画面表示を終了",muteOn:"ミュート",muteOff:"ミュート解除",captionOff:"字幕をオフにする",captionOn:"字幕をオンにする",setting:"設定",live:"ライブ",miniPlayer:"ミニプレーヤー",isMute:"ミュート状態です。",subtitle:"字幕",subtitleNot:"字幕は利用できません"},settings:{autoplay:"自動再生",playbackRate:"再生速度",captions:"字幕",quality:"画質"},error:{"01":{title:"動画を再生できません",desc:"不正なアクセスです。access_keyを確認してください。"},"02":{title:"動画を再生できません",desc:"この動画を再生する権限がありません。"},"03":{title:"認証に失敗しました",desc:"ネットワーク接続が不安定です。"},"04":{title:"動画を再生できません",desc:"動画を再生できませんでした。"},"05":{title:"動画を再生できません",desc:"ライセンスが無効です。"},"06":{title:"動画を再生できません",desc:"月間の基本提供呼び出し回数を超過しました。有料版に切り替えてご利用ください。"},"07":{title:"動画を再生できません",desc:"サポートされていない形式です。"},"08":{title:"動画を再生できません",desc:"URLの形式が正しくありません。"},"09":{title:"動画を再生できません",desc:"ライブストリームはオフラインです。"},10:{title:"動画を再生できません",desc:"iOSではDASHビデオを再生できません。"},11:{title:"動画を再生できません",desc:"DRMトークンが無効です。"},12:{title:"動画を再生できません",desc:"DRMライセンスサーバーとの通信に失敗しました。"},13:{title:"動画を再生できません",desc:"FairPlay証明書の検証に失敗しました。"},14:{title:"動画を再生できません",desc:"画面キャプチャ/画面録画が検出されました。"}},alternative:{hour:"時間",minute:"分",second:"秒",after:"しばらくして",afterMin:"分後",afterHour:"時間後",afterDay:"日後",startPlay:"{timeTxt}後に動画が始まります。",nextPlay:"{timeTxt}秒後に次の動画が再生されます。",afterPlay:"予定"}},m={common:{cancel:"取消",auto:"自动",normal:"一般",notUse:"不使用",prev:"上一个视频",next:"下一个视频",delayText:"{0}秒后自动播放",license:"许可",play:"播放",pause:"暂停",replay:"重新观看",fullOn:"全屏",fullOff:"解除全屏",muteOn:"静音",muteOff:"解除静音",captionOff:"关闭字幕",captionOn:"开启字幕",setting:"设定",live:"LIVE",miniPlayer:"迷你播放器",isMute:"当前处于静音状态。"},settings:{autoplay:"自动播放",playbackRate:"播放速度",captions:"字幕",quality:"分辨率"},error:{"01":{title:"无法播放视频",desc:"错误的访问。"},"02":{title:"无法播放视频",desc:"因权限问题,无法播放视频。"},"03":{title:"认证失败",desc:"网络连接不稳定。"},"04":{title:"无法播放视频",desc:"无法播放视频。"},"05":{title:"无法播放视频",desc:"该许可无效。"},"06":{title:"无法播放视频",desc:"已超过每月基本提供的调用次数。请转换为付费版本后使用。"}},alternative:{hour:"小时",minute:"分钟",second:"秒",after:"请稍后",afterMin:"分钟后",afterHour:"小时后",afterDay:"天后",startPlay:"{timeTxt}之后开始播放视频。",nextPlay:"{timeTxt}秒后,将播放下一个视频。",afterPlay:"预计"}},c={en:f,ko:y,ja:g,zh:m},h=()=>typeof navigator<"u"&&typeof navigator.language<"u";function v(t){const e=t.split("-")[0];return e in c?e:"en"}function u(t){let e="en";t?e=t:h()&&(e=navigator.language);const n=v(e);return c[n]}u();const S={AF:"Afghanistan",AX:"Åland Islands",AL:"Albania",DZ:"Algeria",AS:"American Samoa",AD:"Andorra",AO:"Angola",AI:"Anguilla",AQ:"Antarctica",AG:"Antigua and Barbuda",AR:"Argentina",AM:"Armenia",AW:"Aruba",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BS:"Bahamas",BH:"Bahrain",BD:"Bangladesh",BB:"Barbados",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BM:"Bermuda",BT:"Bhutan",BO:"Bolivia (Plurinational State of)",BQ:"Bonaire, Sint Eustatius and Saba",BA:"Bosnia and Herzegovina",BW:"Botswana",BV:"Bouvet Island",BR:"Brazil",IO:"British Indian Ocean Territory",BN:"Brunei Darussalam",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",CV:"Cabo Verde",KH:"Cambodia",CM:"Cameroon",CA:"Canada",KY:"Cayman Islands",CF:"Central African Republic",TD:"Chad",CL:"Chile",CN:"China",CX:"Christmas Island",CC:"Cocos (Keeling) Islands",CO:"Colombia",KM:"Comoros",CG:"Congo",CD:"Congo (Democratic Republic of the)",CK:"Cook Islands",CR:"Costa Rica",CI:"Côte d'Ivoire",HR:"Croatia",CU:"Cuba",CW:"Curaçao",CY:"Cyprus",CZ:"Czech Republic",DK:"Denmark",DJ:"Djibouti",DM:"Dominica",DO:"Dominican Republic",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",GQ:"Equatorial Guinea",ER:"Eritrea",EE:"Estonia",ET:"Ethiopia",FK:"Falkland Islands (Malvinas)",FO:"Faroe Islands",FJ:"Fiji",FI:"Finland",FR:"France",GF:"French Guiana",PF:"French Polynesia",TF:"French Southern Territories",GA:"Gabon",GM:"Gambia",GE:"Georgia",DE:"Germany",GH:"Ghana",GI:"Gibraltar",GR:"Greece",GL:"Greenland",GD:"Grenada",GP:"Guadeloupe",GU:"Guam",GT:"Guatemala",GG:"Guernsey",GN:"Guinea",GW:"Guinea-Bissau",GY:"Guyana",HT:"Haiti",HM:"Heard Island and McDonald Islands",VA:"Holy See",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran (Islamic Republic of)",IQ:"Iraq",IE:"Ireland",IM:"Isle of Man",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JE:"Jersey",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KI:"Kiribati",KP:"Korea (Democratic People's Republic of)",KR:"Korea, Republic of",KW:"Kuwait",KG:"Kyrgyzstan",LA:"Lao People's Democratic Republic",LV:"Latvia",LB:"Lebanon",LS:"Lesotho",LR:"Liberia",LY:"Libya",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",MO:"Macao",MK:"Macedonia (the former Yugoslav Republic of)",MG:"Madagascar",MW:"Malawi",MY:"Malaysia",MV:"Maldives",ML:"Mali",MT:"Malta",MH:"Marshall Islands",MQ:"Martinique",MR:"Mauritania",MU:"Mauritius",YT:"Mayotte",MX:"Mexico",FM:"Micronesia (Federated States of)",MD:"Moldova (Republic of)",MC:"Monaco",MN:"Mongolia",ME:"Montenegro",MS:"Montserrat",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NA:"Namibia",NR:"Nauru",NP:"Nepal",NL:"Netherlands",NC:"New Caledonia",NZ:"New Zealand",NI:"Nicaragua",NE:"Niger",NG:"Nigeria",NU:"Niue",NF:"Norfolk Island",MP:"Northern Mariana Islands",NO:"Norway",OM:"Oman",PK:"Pakistan",PW:"Palau",PS:"Palestine, State of",PA:"Panama",PG:"Papua New Guinea",PY:"Paraguay",PE:"Peru",PH:"Philippines",PN:"Pitcairn",PL:"Poland",PT:"Portugal",PR:"Puerto Rico",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russian Federation",RW:"Rwanda",BL:"Saint Barthélemy",SH:"Saint Helena, Ascension and Tristan da Cunha",KN:"Saint Kitts and Nevis",LC:"Saint Lucia",MF:"Saint Martin (French part)",PM:"Saint Pierre and Miquelon",VC:"Saint Vincent and the Grenadines",WS:"Samoa",SM:"San Marino",ST:"Sao Tome and Principe",SA:"Saudi Arabia",SN:"Senegal",RS:"Serbia",SC:"Seychelles",SL:"Sierra Leone",SG:"Singapore",SX:"Sint Maarten (Dutch part)",SK:"Slovakia",SI:"Slovenia",SB:"Solomon Islands",SO:"Somalia",ZA:"South Africa",GS:"South Georgia and the South Sandwich Islands",SS:"South Sudan",ES:"Spain",LK:"Sri Lanka",SD:"Sudan",SR:"Suriname",SJ:"Svalbard and Jan Mayen",SZ:"Swaziland",SE:"Sweden",CH:"Switzerland",SY:"Syrian Arab Republic",TW:"Taiwan",TJ:"Tajikistan",TZ:"Tanzania, United Republic of",TH:"Thailand",TL:"Timor-Leste",TG:"Togo",TK:"Tokelau",TO:"Tonga",TT:"Trinidad and Tobago",TN:"Tunisia",TR:"Turkey",TM:"Turkmenistan",TC:"Turks and Caicos Islands",TV:"Tuvalu",UG:"Uganda",UA:"Ukraine",AE:"United Arab Emirates",GB:"United Kingdom",US:"United States of America",UM:"United States Minor Outlying Islands",UY:"Uruguay",UZ:"Uzbekistan",VU:"Vanuatu",VE:"Venezuela (Bolivarian Republic of)",VN:"Viet Nam",VG:"Virgin Islands (British)",VI:"Virgin Islands (U.S.)",WF:"Wallis and Futuna",EH:"Western Sahara",YE:"Yemen",ZM:"Zambia",ZW:"Zimbabwe"},b={gov:{prod:{log:"https://papi.vpe.gov-ntruss.com/player/maSync",report:"https://log.vpe.gov-ntruss.com/stats"},beta:{log:"https://papi.beta-vpe.gov-ntruss.com/player/maSync",report:"https://log.beta-vpe.gov-ntruss.com/stats"}},pub:{prod:{log:"https://papi.vpe.naverncp.com/player/maSync",report:"https://log.vpe.naverncp.com/stats"},beta:{log:"https://papi.beta-vpe.naverncp.com/player/maSync",report:"https://log.beta-vpe.naverncp.com/stats"}}};let s={video:{},browser:{},device:{},connection:{},screen:{},player_version:"latest",extra:{sessionId:null,playerType:"VPE React Native"},log_type:"vpe",privacy:{cookie_enabled:!0}},l={platform:"pub",stage:"prod",sync:!1,syncResult:{}};const M=new Date().getTime(),d=()=>{const t=new Date,e=r=>String(r).padStart(2,"0"),n=`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())} ${e(t.getHours())}:${e(t.getMinutes())}:${e(t.getSeconds())}`,a=Math.floor(t.getTime()/1e3),i=new Date().getTime()-M;return{logDate:n,logDateUnix:a,thisSec:i}};function C(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function I(t,e){Object.entries(e).forEach(([n,a])=>{C(a)?(t[n]||(t[n]={}),Object.entries(a).forEach(([i,r])=>{r!=null&&(t[n][i]=r)})):a!=null&&(t[n]=a)})}function w(t){const e=[];return t?.r1&&e.push(t.r1),t?.r2&&e.push(t.r2),t?.r3&&e.push(t.r3),e.join(" ")}function P(t){try{const e=l.syncResult?.geoLocation;e&&(t.address=w(e),t.isp=e.net||"",t.ip=l.syncResult?.ip||"",t.nation=e.country||"")}catch{}}const T=async t=>{if(!t)return;const{platform:e,stage:n}=l,a=b[e][n].log;try{const r=await(await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({access_key:t})})).json();l.sync=r.result?.sync||!1,l.syncResult=r.result||{};const{logDate:o,logDateUnix:p}=d();return s.extra.logDate=o,s.extra.logDateUnix=p,l.syncResult?.geoLocation&&P(s.extra),r}catch(i){return console.error("MA config initialization failed:",i),null}};async function R(t,e,n,a,i){l.platform=t,l.stage=e,I(s,n),s.extra.nation?s.browser.lang=S[s.extra.nation]||"ko-KR":s.browser.lang="ko-KR";const{logDate:r,logDateUnix:o}=d();s.extra.logDate=r,s.extra.logDateUnix=o,s.extra.created_at=o}const B=(t={})=>{const e={autostart:!0,muted:!1,aspectRatio:"16/9",objectFit:"contain",controls:!0,keyboardShortcut:!1,startMutedInfoNotVisible:!1,allowsPictureInPicture:!1,staysActiveInBackground:!1,screenRecordingPrevention:!1,modalFullscreen:!1,lang:"ko",ui:"all",controlBtn:{play:!0,fullscreen:!0,progressBar:!0,volume:!1,times:!0,pictureInPicture:!0,setting:!0,subtitle:!0},progressBarColor:"#4299f5",controlActiveTime:3e3,playRateSetting:[.5,.75,1,1.5,2],autoPause:!1,repeat:!1,setStartTime:void 0,playIndex:0,lowLatencyMode:!0,touchGestures:!0,descriptionNotVisible:!1,devTestAppId:void 0,token:"",visibleWatermark:!1,watermarkText:"NAVER CLOUD PLATFORM",watermarkConfig:{randPosition:!0,randPositionInterVal:3e3,x:10,y:10,opacity:.5},captionStyle:{fontSize:12,color:"#ffffff",backgroundColor:"rgba(0, 0, 0, 0.4)",edgeStyle:"dropshadow"},override:null},n={...e,...t};return t.controlBtn&&(n.controlBtn={...e.controlBtn,...t.controlBtn}),t.watermarkConfig&&(n.watermarkConfig={...e.watermarkConfig,...t.watermarkConfig}),t.captionStyle&&(n.captionStyle={...e.captionStyle,...t.captionStyle}),n.objectFit==="fill"&&(n.objectFit="stretch"),n.controlBtn?.progressBar===void 0&&(n.controlBtn.progressBar=!0),n},A={gov:{prod:{config:"aHR0cHM6Ly9wYXBpLnZwZS5nb3YtbnRydXNzLmNvbS9wbGF5ZXIvY29uZmln",report:"aHR0cHM6Ly9sb2cudnBlLmdvdi1udHJ1c3MuY29tL3N0YXRz"},beta:{config:"aHR0cHM6Ly9wYXBpLmJldGEtdnBlLmdvdi1udHJ1c3MuY29tL3BsYXllci9jb25maWc=",report:"aHR0cHM6Ly9sb2cuYmV0YS12cGUuZ292LW50cnVzcy5jb20vc3RhdHM="}},pub:{prod:{config:"aHR0cHM6Ly9wYXBpLnZwZS5uYXZlcm5jcC5jb20vcGxheWVyL2NvbmZpZw==",report:"aHR0cHM6Ly9sb2cudnBlLm5hdmVybmNwLmNvbS9zdGF0cw=="},beta:{config:"aHR0cHM6Ly9wYXBpLmJldGEtdnBlLm5hdmVybmNwLmNvbS9wbGF5ZXIvY29uZmln",report:"aHR0cHM6Ly9sb2cuYmV0YS12cGUubmF2ZXJuY3AuY29tL3N0YXRz"}}},L=t=>{try{return atob(t)}catch(e){return console.error("Base64 decoding failed:",e),""}},E=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";class N{serverConfig={};playerInfo=null;accessKey;appId;platform;stage;isDev;translator;constructor({accessKey:e,appId:n,platform:a,stage:i,isDev:r=!1,language:o}){this.accessKey=e,this.appId=E()?location.origin:n,this.platform=a,this.stage=i,this.isDev=r,this.translator=u(o)}async initialize(){if(!this.accessKey||!this.appId)return console.warn("VPE Player: accessKey 또는 appId가 없어 키 인증을 건너뜁니다."),{error:this.setErrorRun("E0002")};try{const e=await this.performKeyCheck();return e.code!==200?{error:this.setErrorRun("E0001")}:(this.serverConfig=e,this.playerInfo=this.createPlayerInfo(e),await R(this.platform,this.stage,this.playerInfo,this.appId,this.accessKey),await T(this.accessKey),{options:this.serverConfig.result?.options,playerInfo:this.playerInfo})}catch(e){return console.error("VPE SDK Initialization failed:",e),{error:this.setErrorRun("E0003")}}}async performKeyCheck(){const e=this.isDev?"?preview=true":"",n=L(A[this.platform][this.stage].config)+e,a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({access_key:this.accessKey,domain:this.appId})});if(!a.ok)throw new Error(`API Error: ${a.status} ${a.statusText}`);return a.json()}getBrowserInfo(){const e=navigator.userAgent;return/Edg\/(\d+\.\d+)/.test(e)?{origin:"Edge",version:RegExp.$1}:/Chrome\/(\d+\.\d+)/.test(e)&&!e.includes("Edg")?{origin:"Chrome",version:RegExp.$1}:/Firefox\/(\d+\.\d+)/.test(e)?{origin:"Firefox",version:RegExp.$1}:/Version\/(\d+\.\d+)/.test(e)&&e.includes("Safari")?{origin:"Safari",version:RegExp.$1}:{origin:"Unknown",version:"Unknown"}}createPlayerInfo(e){const[n,a]=e.result.name.split("|"),i=navigator.connection||navigator.mozConnection||navigator.webkitConnection,r=this.getBrowserInfo(),o=navigator.userAgentData;return{cid:e.result.cid,player_name:n,player_version:a,pricing:e.result.pricing,maUse:e.result.options?.maUse==="Y"?"Y":"N",browser:{lang:navigator.language,ua:navigator.userAgent},screen:{width:window.screen.width,height:window.screen.height},connection:{network:i?.effectiveType??"unknown",downlink:i?.downlink??null,rtt:i?.rtt??null,save_data:i?.saveData??!1},device:{platform:o?.platform??"Unknown",mobile:o?.mobile??!1,memory:navigator.deviceMemory??null,processor:navigator.hardwareConcurrency??null},video:{url:""},extra:{vpeKey:this.accessKey,playerType:"VPE",playerVersion:a,device:o?.platform??"Unknown",os:o?.platform??"Unknown",osOrigin:o?.platform??"Unknown",osVersion:o?.platformVersion??"Unknown",vpePackageId:this.appId,actionDuration:0,actionType:"ready",browser:r.origin,browserOrigin:r.origin,browserVersion:r.version,protocol:location.protocol,quality:"Other",qualityOrigin:"Auto",host:`${this.appId}&${o?.platform??"Unknown"}&${o?.platformVersion??"Unknown"}`,location:`${this.appId}://appView/video/vpe`,title:""}}}setErrorRun(e){const n=e.slice(-2),a=this.translator.error[n]||this.translator.error["01"],i={errorCode:e,errorMessage:a};return console.log("VPE Error : ",i),i}isPaidTier(){return this.serverConfig.result?.pricing==="pay"}isInitialized(){return!!this.serverConfig.result}getValidatedOptions(e){const n=B(this.serverConfig.result?.options?.options),a={...n,...e??{}};return e?.controlBtn&&(a.controlBtn={...n.controlBtn,...e.controlBtn}),e?.watermarkConfig&&(a.watermarkConfig={...n.watermarkConfig,...e.watermarkConfig}),a.playlist&&!Array.isArray(a.playlist)&&(a.playlist=[{file:a.playlist}]),a}$t(e){const n=e.split(".");let a=this.translator;for(const i of n)if(a&&typeof a=="object"&&i in a)a=a[i];else return e;return typeof a=="string"?a:e}}module.exports=N;
@@ -166,7 +166,7 @@ const f = {
166
166
  nextPlay: "{timeTxt}초 후 다음 영상이 재생됩니다.",
167
167
  afterPlay: "예정"
168
168
  }
169
- }, m = {
169
+ }, g = {
170
170
  common: {
171
171
  cancel: "キャンセル",
172
172
  auto: "自動",
@@ -229,7 +229,7 @@ const f = {
229
229
  nextPlay: "{timeTxt}秒後に次の動画が再生されます。",
230
230
  afterPlay: "予定"
231
231
  }
232
- }, g = {
232
+ }, m = {
233
233
  common: {
234
234
  cancel: "取消",
235
235
  auto: "自动",
@@ -300,8 +300,8 @@ const f = {
300
300
  }, c = {
301
301
  en: f,
302
302
  ko: y,
303
- ja: m,
304
- zh: g
303
+ ja: g,
304
+ zh: m
305
305
  }, h = () => typeof navigator < "u" && typeof navigator.language < "u";
306
306
  function v(t) {
307
307
  const e = t.split("-")[0];
@@ -657,7 +657,7 @@ const T = async (t) => {
657
657
  }
658
658
  };
659
659
  async function R(t, e, n, a, i) {
660
- l.platform = t, l.stage = e, I(s, n), s.browser.lang = S[s.extra.nation] || "ko-KR";
660
+ l.platform = t, l.stage = e, I(s, n), s.extra.nation ? s.browser.lang = S[s.extra.nation] || "ko-KR" : s.browser.lang = "ko-KR";
661
661
  const { logDate: r, logDateUnix: o } = d();
662
662
  s.extra.logDate = r, s.extra.logDateUnix = o, s.extra.created_at = o;
663
663
  }
@@ -691,12 +691,12 @@ const B = (t = {}) => {
691
691
  playRateSetting: [0.5, 0.75, 1, 1.5, 2],
692
692
  autoPause: !1,
693
693
  repeat: !1,
694
- setStartTime: null,
694
+ setStartTime: void 0,
695
695
  playIndex: 0,
696
696
  lowLatencyMode: !0,
697
697
  touchGestures: !0,
698
698
  descriptionNotVisible: !1,
699
- devTestAppId: null,
699
+ devTestAppId: void 0,
700
700
  token: "",
701
701
  visibleWatermark: !1,
702
702
  watermarkText: "NAVER CLOUD PLATFORM",
@@ -724,7 +724,7 @@ const B = (t = {}) => {
724
724
  }), t.captionStyle && (n.captionStyle = {
725
725
  ...e.captionStyle,
726
726
  ...t.captionStyle
727
- }), n.objectFit == "fill" && (n.objectFit = "stretch"), n.controlBtn.progressBar == null && (n.controlBtn.progressBar = !0), n;
727
+ }), n.objectFit === "fill" && (n.objectFit = "stretch"), n.controlBtn?.progressBar === void 0 && (n.controlBtn.progressBar = !0), n;
728
728
  }, A = {
729
729
  gov: {
730
730
  prod: {
@@ -861,7 +861,7 @@ class N {
861
861
  return !!this.serverConfig.result;
862
862
  }
863
863
  getValidatedOptions(e) {
864
- const n = B(this.serverConfig.result?.options), a = { ...n, ...e ?? {} };
864
+ const n = B(this.serverConfig.result?.options?.options), a = { ...n, ...e ?? {} };
865
865
  return e?.controlBtn && (a.controlBtn = { ...n.controlBtn, ...e.controlBtn }), e?.watermarkConfig && (a.watermarkConfig = { ...n.watermarkConfig, ...e.watermarkConfig }), a.playlist && !Array.isArray(a.playlist) && (a.playlist = [{ file: a.playlist }]), a;
866
866
  }
867
867
  /**
@@ -880,6 +880,5 @@ class N {
880
880
  }
881
881
  }
882
882
  export {
883
- N as VpeCore,
884
883
  N as default
885
884
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sgrsoft/vpe-core-sdk",
3
3
  "private": false,
4
- "version": "0.5.0",
4
+ "version": "0.7.0",
5
5
  "type": "module",
6
6
  "main": "dist/vpe-core-sdk.cjs.js",
7
7
  "module": "dist/vpe-core-sdk.es.js",
@@ -13,10 +13,11 @@
13
13
  "dev": "vite",
14
14
  "build:types": "tsc --emitDeclarationOnly",
15
15
  "build": "vite build && npm run build:types",
16
- "release Private": "release-it --only-version --access=restricted",
17
- "release:beta Private": "release-it --preRelease=beta --access=restricted",
18
- "release": "release-it --only-version",
19
- "release:beta": "release-it --preRelease=beta"
16
+ "build local cp": "cp -R ./dist/* ../vpe-react-ui/node_modules/@sgrsoft/vpe-core-sdk/dist",
17
+ "release Private": "vite build && npm run build:types && release-it --only-version --access=restricted",
18
+ "release:beta Private": "vite build && npm run build:types && release-it --preRelease=beta --access=restricted",
19
+ "release": "vite build && npm run build:types && release-it --only-version",
20
+ "release:beta": "vite build && npm run build:types && release-it --preRelease=beta"
20
21
  },
21
22
  "exports": {
22
23
  ".": {
@@ -33,5 +34,6 @@
33
34
  "dependencies": {
34
35
  "path": "^0.12.7",
35
36
  "vite": "^7.2.7"
36
- }
37
+ },
38
+ "packageManager": "pnpm@10.23.0+sha256.a1cdd7b468386a9d78a081da05d6049d7e598db62a299db92df21a7062a4b183"
37
39
  }