@video-lab/react-frame 1.0.1 → 2.0.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
@@ -1,6 +1,6 @@
1
1
  # @video-lab/react-frame
2
2
 
3
- Video Lab Player 的 **React iframe 消费面(L7)**。播放器跑在独立 iframe 里,通过 frame-core 收发契约消息。
3
+ Video Lab Player 的 React iframe 接入方式。播放器运行在独立 iframe 中,并通过通信契约收发命令与事件。
4
4
 
5
5
  对外只有一个组件 `<VideoPlayerFrame />` + 一个命令句柄。和 [`@video-lab/vue-frame`](https://www.npmjs.com/package/@video-lab/vue-frame) 行为对齐。
6
6
 
@@ -33,7 +33,7 @@ function Player() {
33
33
  return (
34
34
  <VideoPlayerFrame
35
35
  ref={ref}
36
- source="https://cdn.example.com/live/master.m3u8"
36
+ source="https://media.example.com/live/master.m3u8"
37
37
  autoplay
38
38
  muted
39
39
  onReady={({ duration, quality, subtitles }) => {}}
@@ -55,27 +55,27 @@ ref.current?.seek(30)
55
55
  await ref.current?.enterFullscreen()
56
56
  ```
57
57
 
58
- ### 私有化部署
58
+ ### 配置 iframe 地址
59
59
 
60
- iframe 默认指向官方 CDN。自建时用 `origin` 覆盖(ADR-023):
60
+ `origin` 与 `version` 应由内部部署配置提供;本包不声明公共播放器地址。以下值仅为占位符:
61
61
 
62
62
  <!-- doc-snippet-preamble
63
63
  import { VideoPlayerFrame } from '@video-lab/react-frame'
64
64
  -->
65
65
  ```tsx
66
66
  <VideoPlayerFrame
67
- origin="https://player.your-domain.com"
68
- version="v3"
69
- source="https://cdn.example.com/master.m3u8"
67
+ origin="https://player.example.com"
68
+ version="v1"
69
+ source="https://media.example.com/master.m3u8"
70
70
  />
71
71
  ```
72
72
 
73
73
  ## 边界
74
74
 
75
- - **薄壳**——本包不含播放逻辑,只负责建 iframe、握手、转发命令与事件。播放能力在 iframe 内的 embed-app
76
- - **props 面和 `@video-lab/react` 对齐**,多出 `origin` / `version` 两个 iframe 专属项(cross-mode-parity 测试保障)
77
- - **不做团队品牌 UI**(ADR-021);**认证只支持签名 URL**(ADR-022)
78
- - 业务代码通常不直接 import 本包,而是经团队封装层接入
75
+ - **薄壳**——本包不含播放逻辑,只负责创建 iframe、握手及转发命令与事件。
76
+ - **props 与 `@video-lab/react` 对齐**,另有 iframe 专属的 `origin` / `version`。
77
+ - **不内置品牌 UI;认证只支持签名 URL**,不接受自定义请求头。
78
+ - 业务应用可直接使用本组件,也可在自己的业务组件中封装它。
79
79
 
80
80
  ## 相关
81
81
 
@@ -83,3 +83,7 @@ import { VideoPlayerFrame } from '@video-lab/react-frame'
83
83
  - 契约定义:[`@video-lab/protocol`](https://www.npmjs.com/package/@video-lab/protocol)
84
84
 
85
85
  MIT
86
+
87
+ ### iframe 基础路径
88
+
89
+ `origin` 是宿主提供的完整部署基础 URL,可包含 `/custom/player` 等目录。SDK 只追加 `/v{iframe应用版本}/`,不会自动追加 `/embed`。旧部署仍在 `/embed/v…/` 时,请把 `/embed` 显式保留在 `origin` 中;版本目录不要写进 `origin`。
package/dist/index.d.cts CHANGED
@@ -57,9 +57,9 @@ interface VideoPlayerFrameProps {
57
57
  */
58
58
  pauseImage?: string | PauseImageConfig;
59
59
  preset?: PresetName;
60
- /** iframe URL origin 覆盖(私有化 / dev)。默认官方 CDN */
60
+ /** iframe 部署基础 URL,可包含自定义目录;SDK 只追加版本目录,不追加 embed。 */
61
61
  origin?: string;
62
- /** iframe URL 版本段覆盖。默认跟随契约 major(`DEFAULT_VERSION`,ADR-053) */
62
+ /** iframe 版本目录;默认使用 DEFAULT_VERSION 指定的 iframe 应用精确版本。 */
63
63
  version?: string;
64
64
  /** 传给 iframe 内 xgplayer 的 i18n 配置 */
65
65
  locale?: LocaleConfig;
package/dist/index.d.mts CHANGED
@@ -57,9 +57,9 @@ interface VideoPlayerFrameProps {
57
57
  */
58
58
  pauseImage?: string | PauseImageConfig;
59
59
  preset?: PresetName;
60
- /** iframe URL origin 覆盖(私有化 / dev)。默认官方 CDN */
60
+ /** iframe 部署基础 URL,可包含自定义目录;SDK 只追加版本目录,不追加 embed。 */
61
61
  origin?: string;
62
- /** iframe URL 版本段覆盖。默认跟随契约 major(`DEFAULT_VERSION`,ADR-053) */
62
+ /** iframe 版本目录;默认使用 DEFAULT_VERSION 指定的 iframe 应用精确版本。 */
63
63
  version?: string;
64
64
  /** 传给 iframe 内 xgplayer 的 i18n 配置 */
65
65
  locale?: LocaleConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@video-lab/react-frame",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -33,8 +33,8 @@
33
33
  "react-dom": ">=19.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@video-lab/protocol": "1.0.1",
37
- "@video-lab/frame-core": "1.0.1"
36
+ "@video-lab/frame-core": "2.0.0",
37
+ "@video-lab/protocol": "2.0.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@testing-library/jest-dom": "^6.0.0",