@video-lab/react 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 +6 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @video-lab/react
|
|
2
2
|
|
|
3
|
-
Video Lab Player 的
|
|
3
|
+
Video Lab Player 的 React inline 接入方式。它直连播放核心与覆盖层,不经过 iframe,首帧开销最低。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
对外提供一个组件 `<VideoPlayer />` 与一个命令句柄。
|
|
6
6
|
|
|
7
7
|
## 什么时候用它
|
|
8
8
|
|
|
@@ -36,7 +36,7 @@ function Player() {
|
|
|
36
36
|
return (
|
|
37
37
|
<VideoPlayer
|
|
38
38
|
ref={ref}
|
|
39
|
-
source="https://
|
|
39
|
+
source="https://media.example.com/live/master.m3u8"
|
|
40
40
|
autoplay
|
|
41
41
|
muted
|
|
42
42
|
onReady={({ duration, quality, subtitles }) => {
|
|
@@ -66,9 +66,9 @@ await ref.current?.enterFullscreen()
|
|
|
66
66
|
|
|
67
67
|
## 边界
|
|
68
68
|
|
|
69
|
-
-
|
|
70
|
-
- **props
|
|
71
|
-
- **认证只支持签名 URL
|
|
69
|
+
- **只提供技术能力**——播放、事件、命令与容错;品牌 UI(结束覆盖层、清晰度菜单、皮肤)由消费应用提供。
|
|
70
|
+
- **props 与 `@video-lab/react-frame` 尽量对齐**,但不包含 iframe 专属的 `origin` / `version`。
|
|
71
|
+
- **认证只支持签名 URL**,不接受自定义请求头。
|
|
72
72
|
- `getPlayerHandle()` 是逃生舱,返回底层 player-core 句柄,给需要绕过 React 直接下命令的高级场景
|
|
73
73
|
|
|
74
74
|
## 相关
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@video-lab/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"react-dom": ">=19.0.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@video-lab/protocol": "
|
|
38
|
-
"@video-lab/player-core": "
|
|
39
|
-
"@video-lab/player-ui": "
|
|
37
|
+
"@video-lab/protocol": "2.0.0",
|
|
38
|
+
"@video-lab/player-core": "2.0.0",
|
|
39
|
+
"@video-lab/player-ui": "2.0.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@testing-library/jest-dom": "^6.0.0",
|