@sgrsoft/vpe-react-sdk 0.1.7 → 0.1.8

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
@@ -72,6 +72,41 @@ export function App() {
72
72
  `VpePlayer`는 `layout` props로 컨트롤바 구성을 유연하게 커스터마이즈할 수 있습니다.
73
73
  기본값은 내부 `defaultLayout`이며, 지정하지 않으면 기본 레이아웃을 사용합니다.
74
74
 
75
+ ### 실시간 레이아웃 변경 (메소드)
76
+ UMD/ES 인스턴스에서 `layout(nextLayout, merge?)`를 호출하면 즉시 반영됩니다.
77
+ 기본 동작은 **전달된 필드만 교체**하며, `merge=false`를 전달하면 전체 교체합니다.
78
+
79
+ #### ES (setup 인스턴스)
80
+ ```ts
81
+ import { setup } from "@sgrsoft/vpe-react-sdk";
82
+
83
+ const instance = setup("#video", "ACCESS_KEY", {
84
+ options: { playlist: [{ file: "..." }] },
85
+ });
86
+
87
+ instance.layout({
88
+ bottom: [{ key: "custom", items: ["SettingBtn"] }],
89
+ });
90
+
91
+ // 기존 bottom 삭제
92
+ // instance.layout({ bottom: [] });
93
+
94
+ // 전체 교체
95
+ // instance.layout({ bottom: [] }, false);
96
+ ```
97
+
98
+ #### UMD (ncplayer 인스턴스)
99
+ ```html
100
+ <script>
101
+ const player = new ncplayer("#video", "ACCESS_KEY", {});
102
+ player.layout({
103
+ bottom: [{ key: "custom", items: ["SettingBtn"] }],
104
+ });
105
+ // player.layout({ bottom: [] });
106
+ // player.layout({ bottom: [] }, false);
107
+ </script>
108
+ ```
109
+
75
110
  ### 1) 기본 레이아웃 정의
76
111
  레이아웃은 섹션 단위(`top`, `upper`, `center`, `lower`, `bottom`)로 구성됩니다.
77
112
  각 섹션은 그룹 배열이며, 그룹은 `items`로 버튼을 배치합니다.
@@ -138,7 +173,7 @@ const responsiveLayout = {
138
173
  ### 5) 사용 가능한 `items`
139
174
  ```
140
175
  PlayBtn, VolumeBtn, TimeBtn, SubtitleBtn, FullscreenBtn, SettingBtn, PipBtn,
141
- LevelSelectBtn, MetaDesc, BigPlayBtn, SeekBar, SettingModal, DurationBtn,
176
+ MetaDesc, BigPlayBtn, SeekBar, SettingModal, DurationBtn,
142
177
  SkipForwardBtn, SkipBackBtn, CurrentTimeBtn, MuteBtn, PrevBtn, NextBtn,
143
178
  NextPrevBtn, Blank
144
179
  ```