@video-lab/react-frame 3.0.0 → 3.1.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.
package/README.md CHANGED
@@ -57,7 +57,7 @@ await ref.current?.enterFullscreen()
57
57
 
58
58
  ### 配置 iframe 地址
59
59
 
60
- `origin` 与 `version` 应由内部部署配置提供;本包不声明公共播放器地址。以下值仅为占位符:
60
+ `origin` 应由内部部署配置提供;本包不声明公共播放器地址。以下值仅为占位符:
61
61
 
62
62
  <!-- doc-snippet-preamble
63
63
  import { VideoPlayerFrame } from '@video-lab/react-frame'
@@ -65,7 +65,7 @@ import { VideoPlayerFrame } from '@video-lab/react-frame'
65
65
  ```tsx
66
66
  <VideoPlayerFrame
67
67
  origin="https://player.example.com"
68
- version="v1"
68
+ iframeVersion="v2.0.1"
69
69
  source="https://media.example.com/master.m3u8"
70
70
  />
71
71
  ```
@@ -73,7 +73,7 @@ import { VideoPlayerFrame } from '@video-lab/react-frame'
73
73
  ## 边界
74
74
 
75
75
  - **薄壳**——本包不含播放逻辑,只负责创建 iframe、握手及转发命令与事件。
76
- - **props 与 `@video-lab/react` 对齐**,另有 iframe 专属的 `origin` / `version`。
76
+ - **props 与 `@video-lab/react` 对齐**,另有 iframe 专属的 `origin` / `iframeVersion`;省略 `iframeVersion` 时加载部署根目录。
77
77
  - **不内置品牌 UI;认证只支持签名 URL**,不接受自定义请求头。
78
78
  - 业务应用可直接使用本组件,也可在自己的业务组件中封装它。
79
79
 
@@ -98,7 +98,7 @@ rejection 不保证产生 `error`,播放期 `error` 也不保证对应某个
98
98
 
99
99
  ### iframe 基础路径
100
100
 
101
- `origin` 是宿主提供的完整部署基础 URL,可包含 `/custom/player` 等目录。SDK 只追加 `/v{iframe应用版本}/`,不会自动追加 `/embed`。旧部署仍在 `/embed/v…/` 时,请把 `/embed` 显式保留在 `origin` 中;版本目录不要写进 `origin`。
101
+ `origin` 是宿主提供的完整部署基础 URL,可包含 `/custom/player` 等目录。SDK 直接访问该根目录,不追加版本段或 `/embed`;旧部署的 `/embed` 可显式保留在 `origin` 中。
102
102
 
103
103
  ## 错误 UI 接管
104
104
 
@@ -110,7 +110,7 @@ rejection 不保证产生 `error`,播放期 `error` 也不保证对应某个
110
110
  八个可选键为 `play`、`progress`、`time`、`volume`、`playbackRate`、`fullscreen`、`cssFullscreen`、`pip`。
111
111
  false 隐藏入口,true/省略保留平台默认;`controls=false` 整体关闭优先。隐藏不禁用既有命令,
112
112
  运行时修改须由宿主显式重建,不增加 PiP RPC。
113
- iframe 须使用支持该功能、已部署的精确版本 `/v1.2.0/`;旧 iframe 可能忽略新配置。
113
+ iframe 须与宿主代码同批部署并支持该功能;旧应用可能忽略新配置。
114
114
 
115
115
  ## 宿主网页全屏
116
116
 
package/dist/index.cjs CHANGED
@@ -31,7 +31,7 @@ function useFrameConnection(props) {
31
31
  config: toConfig(p),
32
32
  pageFullscreen: p.pageFullscreen,
33
33
  ...p.origin !== void 0 ? { origin: p.origin } : {},
34
- ...p.version !== void 0 ? { version: p.version } : {},
34
+ ...p.iframeVersion !== void 0 ? { iframeVersion: p.iframeVersion } : {},
35
35
  onEvent: (event) => {
36
36
  if (event.event === "play" || event.event === "error") setHostPosterVisible(false);
37
37
  forward(event, propsRef.current);
package/dist/index.d.cts CHANGED
@@ -13,7 +13,7 @@ type PlayerHandle = PlayerFrameHandle;
13
13
  * `<VideoPlayerFrame />` 的 props。
14
14
  *
15
15
  * 对齐 react-frame/CLAUDE.md § 职责。播放相关的字段最终拼进 frame-core 的
16
- * `config` 下发给 iframe;origin / version 走 ADR-023 的 URL 覆盖。
16
+ * `config` 下发给 iframe;origin 走 ADR-101 的 URL 覆盖。
17
17
  * 事件用 React 惯例 `onCamelCase` 回调(对齐团队命名约定),payload 形状对齐
18
18
  * protocol 的 PlayerEvent —— 和 vue-frame 的 emits 一一对应(cross-mode-parity)。
19
19
  */
@@ -65,10 +65,10 @@ interface VideoPlayerFrameProps {
65
65
  */
66
66
  pauseImage?: string | PauseImageConfig;
67
67
  preset?: PresetName;
68
- /** iframe 部署基础 URL,可包含自定义目录;SDK 只追加版本目录,不追加 embed。 */
68
+ /** iframe 部署基础 URL,可包含自定义目录。 */
69
69
  origin?: string;
70
- /** iframe 版本目录;默认使用 DEFAULT_VERSION 指定的 iframe 应用精确版本。 */
71
- version?: string;
70
+ /** iframe 应用的精确版本目录;缺省时访问部署根目录。 */
71
+ iframeVersion?: string;
72
72
  /** 传给 iframe 内 xgplayer 的 i18n 配置 */
73
73
  locale?: LocaleConfig;
74
74
  /** 弹幕配置(ADR-028)。enabled 时 iframe 内注册渲染引擎;数据经 pushDanmaku 推入 */
package/dist/index.d.mts CHANGED
@@ -13,7 +13,7 @@ type PlayerHandle = PlayerFrameHandle;
13
13
  * `<VideoPlayerFrame />` 的 props。
14
14
  *
15
15
  * 对齐 react-frame/CLAUDE.md § 职责。播放相关的字段最终拼进 frame-core 的
16
- * `config` 下发给 iframe;origin / version 走 ADR-023 的 URL 覆盖。
16
+ * `config` 下发给 iframe;origin 走 ADR-101 的 URL 覆盖。
17
17
  * 事件用 React 惯例 `onCamelCase` 回调(对齐团队命名约定),payload 形状对齐
18
18
  * protocol 的 PlayerEvent —— 和 vue-frame 的 emits 一一对应(cross-mode-parity)。
19
19
  */
@@ -65,10 +65,10 @@ interface VideoPlayerFrameProps {
65
65
  */
66
66
  pauseImage?: string | PauseImageConfig;
67
67
  preset?: PresetName;
68
- /** iframe 部署基础 URL,可包含自定义目录;SDK 只追加版本目录,不追加 embed。 */
68
+ /** iframe 部署基础 URL,可包含自定义目录。 */
69
69
  origin?: string;
70
- /** iframe 版本目录;默认使用 DEFAULT_VERSION 指定的 iframe 应用精确版本。 */
71
- version?: string;
70
+ /** iframe 应用的精确版本目录;缺省时访问部署根目录。 */
71
+ iframeVersion?: string;
72
72
  /** 传给 iframe 内 xgplayer 的 i18n 配置 */
73
73
  locale?: LocaleConfig;
74
74
  /** 弹幕配置(ADR-028)。enabled 时 iframe 内注册渲染引擎;数据经 pushDanmaku 推入 */
package/dist/index.mjs CHANGED
@@ -30,7 +30,7 @@ function useFrameConnection(props) {
30
30
  config: toConfig(p),
31
31
  pageFullscreen: p.pageFullscreen,
32
32
  ...p.origin !== void 0 ? { origin: p.origin } : {},
33
- ...p.version !== void 0 ? { version: p.version } : {},
33
+ ...p.iframeVersion !== void 0 ? { iframeVersion: p.iframeVersion } : {},
34
34
  onEvent: (event) => {
35
35
  if (event.event === "play" || event.event === "error") setHostPosterVisible(false);
36
36
  forward(event, propsRef.current);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@video-lab/react-frame",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -34,8 +34,8 @@
34
34
  "react-dom": ">=19.0.0"
35
35
  },
36
36
  "dependencies": {
37
- "@video-lab/protocol": "3.0.0",
38
- "@video-lab/frame-core": "3.0.0"
37
+ "@video-lab/protocol": "3.1.0",
38
+ "@video-lab/frame-core": "3.1.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@testing-library/jest-dom": "^6.0.0",