@video-lab/vue-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 +3 -3
- package/dist/VideoPlayerFrame.vue.d.ts +33 -33
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/types.d.ts +4 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ function onError(err: PlayerError) {
|
|
|
51
51
|
## Props
|
|
52
52
|
|
|
53
53
|
`source` 必填,其余可选:`autoplay` `muted` `loop` `controls` `interactive`
|
|
54
|
-
`playsinline` `poster` `preset` `locale` `debug`,以及 iframe 部署配置 `origin` / `
|
|
54
|
+
`playsinline` `poster` `preset` `locale` `debug`,以及 iframe 部署配置 `origin` / `iframeVersion`。省略 `iframeVersion` 时加载部署根目录。
|
|
55
55
|
实际部署地址由内部配置提供,本包不声明公共播放器地址。
|
|
56
56
|
|
|
57
57
|
**布尔 prop 不传就是 undefined**(不是 false),这样 `preset` 才能生效——比如
|
|
@@ -93,7 +93,7 @@ rejection 不保证产生 `error`,播放期 `error` 也不保证对应某个
|
|
|
93
93
|
|
|
94
94
|
### iframe 基础路径
|
|
95
95
|
|
|
96
|
-
`origin` 是宿主提供的完整部署基础 URL,可包含 `/custom/player` 等目录。SDK
|
|
96
|
+
`origin` 是宿主提供的完整部署基础 URL,可包含 `/custom/player` 等目录。SDK 直接访问该根目录,不追加版本段或 `/embed`;旧部署的 `/embed` 可显式保留在 `origin` 中。
|
|
97
97
|
|
|
98
98
|
## 错误 UI 接管
|
|
99
99
|
|
|
@@ -105,7 +105,7 @@ rejection 不保证产生 `error`,播放期 `error` 也不保证对应某个
|
|
|
105
105
|
八个可选键为 `play`、`progress`、`time`、`volume`、`playbackRate`、`fullscreen`、`cssFullscreen`、`pip`。
|
|
106
106
|
false 隐藏入口,true/省略保留平台默认;`controls=false` 整体关闭优先。隐藏不禁用既有命令,
|
|
107
107
|
运行时修改须由宿主显式重建,不增加 PiP RPC。
|
|
108
|
-
iframe
|
|
108
|
+
iframe 须与宿主代码同批部署并支持该功能;旧应用可能忽略新配置。
|
|
109
109
|
|
|
110
110
|
## 宿主网页全屏
|
|
111
111
|
|
|
@@ -82,9 +82,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
82
82
|
bitrate?: number | undefined;
|
|
83
83
|
}[];
|
|
84
84
|
subtitles?: {
|
|
85
|
-
locale: string;
|
|
86
85
|
label: string;
|
|
87
86
|
id: number;
|
|
87
|
+
locale: string;
|
|
88
88
|
}[] | undefined;
|
|
89
89
|
};
|
|
90
90
|
} | {
|
|
@@ -127,8 +127,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
127
127
|
} | {
|
|
128
128
|
event: "qualitychange";
|
|
129
129
|
payload: {
|
|
130
|
-
auto: boolean;
|
|
131
130
|
level: number;
|
|
131
|
+
auto: boolean;
|
|
132
132
|
};
|
|
133
133
|
} | {
|
|
134
134
|
event: "subtitlechange";
|
|
@@ -141,7 +141,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
141
141
|
code: "E_MEDIA_NOT_SUPPORTED" | "E_MANIFEST_PARSE" | "E_MEDIA_DECODE" | "E_MEDIA_ABORTED" | "E_SUBTITLE_LOAD_FAILED" | "E_AUTOPLAY_BLOCKED" | "E_NETWORK" | "E_NETWORK_TIMEOUT" | "E_AUTH_EXPIRED" | "E_ENV_CSP_BLOCKED" | "E_METHOD_NOT_SUPPORTED" | "E_DANMAKU_SEND_FAILED" | "E_INTERNAL" | "E_UNKNOWN" | "E_PLAYER_DESTROYED" | "E_HANDSHAKE_TIMEOUT" | "E_HANDSHAKE_VERSION_MISMATCH" | "E_LOAD_FAILED" | "E_FRAME_CRASHED";
|
|
142
142
|
message: string;
|
|
143
143
|
retryable: boolean;
|
|
144
|
-
category: "
|
|
144
|
+
category: "manifest" | "media" | "network" | "auth" | "env" | "autoplay";
|
|
145
145
|
cause?: import('zod').objectOutputType<{
|
|
146
146
|
name: import('zod').ZodString;
|
|
147
147
|
message: import('zod').ZodString;
|
|
@@ -244,7 +244,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
244
244
|
phase: "start" | "end";
|
|
245
245
|
position: number;
|
|
246
246
|
durationMs?: number | undefined;
|
|
247
|
-
kind?: "
|
|
247
|
+
kind?: "playback" | "firstframe" | "seek" | undefined;
|
|
248
248
|
};
|
|
249
249
|
} | {
|
|
250
250
|
event: "playablechange";
|
|
@@ -252,7 +252,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
252
252
|
reason: "error" | "stalled" | "ok" | "initializing" | "buffering" | "reconnecting" | "autoplay_blocked" | "frame_disconnected" | "degraded";
|
|
253
253
|
playable: boolean;
|
|
254
254
|
recoverable: boolean;
|
|
255
|
-
action?: "play" | "
|
|
255
|
+
action?: "play" | "retry" | "replace-source" | "recreate-frame" | "none" | undefined;
|
|
256
256
|
};
|
|
257
257
|
} | {
|
|
258
258
|
event: "kernelhealth";
|
|
@@ -308,8 +308,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
308
308
|
} | {
|
|
309
309
|
event: "useraction";
|
|
310
310
|
payload: {
|
|
311
|
-
source: string;
|
|
312
311
|
action: "seek" | "switch_play_pause" | "switch_fullscreen" | "switch_cssfullscreen" | "switch_css_fullscreen" | "change_definition" | "change_rate" | "change_volume" | "change_muted" | "change_pip" | "rotate" | "shot" | "download" | "switch_danmu" | "error_retry";
|
|
312
|
+
source: string;
|
|
313
313
|
from: string | number | boolean | null;
|
|
314
314
|
to: string | number | boolean | null;
|
|
315
315
|
};
|
|
@@ -361,9 +361,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
361
361
|
bitrate?: number | undefined;
|
|
362
362
|
}[];
|
|
363
363
|
subtitles?: {
|
|
364
|
-
locale: string;
|
|
365
364
|
label: string;
|
|
366
365
|
id: number;
|
|
366
|
+
locale: string;
|
|
367
367
|
}[] | undefined;
|
|
368
368
|
};
|
|
369
369
|
} | {
|
|
@@ -406,8 +406,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
406
406
|
} | {
|
|
407
407
|
event: "qualitychange";
|
|
408
408
|
payload: {
|
|
409
|
-
auto: boolean;
|
|
410
409
|
level: number;
|
|
410
|
+
auto: boolean;
|
|
411
411
|
};
|
|
412
412
|
} | {
|
|
413
413
|
event: "subtitlechange";
|
|
@@ -420,7 +420,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
420
420
|
code: "E_MEDIA_NOT_SUPPORTED" | "E_MANIFEST_PARSE" | "E_MEDIA_DECODE" | "E_MEDIA_ABORTED" | "E_SUBTITLE_LOAD_FAILED" | "E_AUTOPLAY_BLOCKED" | "E_NETWORK" | "E_NETWORK_TIMEOUT" | "E_AUTH_EXPIRED" | "E_ENV_CSP_BLOCKED" | "E_METHOD_NOT_SUPPORTED" | "E_DANMAKU_SEND_FAILED" | "E_INTERNAL" | "E_UNKNOWN" | "E_PLAYER_DESTROYED" | "E_HANDSHAKE_TIMEOUT" | "E_HANDSHAKE_VERSION_MISMATCH" | "E_LOAD_FAILED" | "E_FRAME_CRASHED";
|
|
421
421
|
message: string;
|
|
422
422
|
retryable: boolean;
|
|
423
|
-
category: "
|
|
423
|
+
category: "manifest" | "media" | "network" | "auth" | "env" | "autoplay";
|
|
424
424
|
cause?: import('zod').objectOutputType<{
|
|
425
425
|
name: import('zod').ZodString;
|
|
426
426
|
message: import('zod').ZodString;
|
|
@@ -523,7 +523,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
523
523
|
phase: "start" | "end";
|
|
524
524
|
position: number;
|
|
525
525
|
durationMs?: number | undefined;
|
|
526
|
-
kind?: "
|
|
526
|
+
kind?: "playback" | "firstframe" | "seek" | undefined;
|
|
527
527
|
};
|
|
528
528
|
} | {
|
|
529
529
|
event: "playablechange";
|
|
@@ -531,7 +531,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
531
531
|
reason: "error" | "stalled" | "ok" | "initializing" | "buffering" | "reconnecting" | "autoplay_blocked" | "frame_disconnected" | "degraded";
|
|
532
532
|
playable: boolean;
|
|
533
533
|
recoverable: boolean;
|
|
534
|
-
action?: "play" | "
|
|
534
|
+
action?: "play" | "retry" | "replace-source" | "recreate-frame" | "none" | undefined;
|
|
535
535
|
};
|
|
536
536
|
} | {
|
|
537
537
|
event: "kernelhealth";
|
|
@@ -587,16 +587,16 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
587
587
|
} | {
|
|
588
588
|
event: "useraction";
|
|
589
589
|
payload: {
|
|
590
|
-
source: string;
|
|
591
590
|
action: "seek" | "switch_play_pause" | "switch_fullscreen" | "switch_cssfullscreen" | "switch_css_fullscreen" | "change_definition" | "change_rate" | "change_volume" | "change_muted" | "change_pip" | "rotate" | "shot" | "download" | "switch_danmu" | "error_retry";
|
|
591
|
+
source: string;
|
|
592
592
|
from: string | number | boolean | null;
|
|
593
593
|
to: string | number | boolean | null;
|
|
594
594
|
};
|
|
595
595
|
};
|
|
596
596
|
producerSessionId: string;
|
|
597
|
-
sequence: number;
|
|
598
597
|
deliveryId: string;
|
|
599
598
|
occurredAtMs: number;
|
|
599
|
+
sequence: number;
|
|
600
600
|
}) => void;
|
|
601
601
|
ready: (payload: {
|
|
602
602
|
duration: number;
|
|
@@ -633,7 +633,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
633
633
|
code: "E_MEDIA_NOT_SUPPORTED" | "E_MANIFEST_PARSE" | "E_MEDIA_DECODE" | "E_MEDIA_ABORTED" | "E_SUBTITLE_LOAD_FAILED" | "E_AUTOPLAY_BLOCKED" | "E_NETWORK" | "E_NETWORK_TIMEOUT" | "E_AUTH_EXPIRED" | "E_ENV_CSP_BLOCKED" | "E_METHOD_NOT_SUPPORTED" | "E_DANMAKU_SEND_FAILED" | "E_INTERNAL" | "E_UNKNOWN" | "E_PLAYER_DESTROYED" | "E_HANDSHAKE_TIMEOUT" | "E_HANDSHAKE_VERSION_MISMATCH" | "E_LOAD_FAILED" | "E_FRAME_CRASHED";
|
|
634
634
|
message: string;
|
|
635
635
|
retryable: boolean;
|
|
636
|
-
category: "
|
|
636
|
+
category: "manifest" | "media" | "network" | "auth" | "env" | "autoplay";
|
|
637
637
|
cause?: import('zod').objectOutputType<{
|
|
638
638
|
name: import('zod').ZodString;
|
|
639
639
|
message: import('zod').ZodString;
|
|
@@ -656,7 +656,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
656
656
|
reason: "error" | "stalled" | "ok" | "initializing" | "buffering" | "reconnecting" | "autoplay_blocked" | "frame_disconnected" | "degraded";
|
|
657
657
|
playable: boolean;
|
|
658
658
|
recoverable: boolean;
|
|
659
|
-
action?: "play" | "
|
|
659
|
+
action?: "play" | "retry" | "replace-source" | "recreate-frame" | "none" | undefined;
|
|
660
660
|
}) => void;
|
|
661
661
|
kernelHealth: (payload: {
|
|
662
662
|
reason: "media" | "network" | "other";
|
|
@@ -729,8 +729,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
729
729
|
active: boolean;
|
|
730
730
|
}) => void;
|
|
731
731
|
userAction: (payload: {
|
|
732
|
-
source: string;
|
|
733
732
|
action: "seek" | "switch_play_pause" | "switch_fullscreen" | "switch_cssfullscreen" | "switch_css_fullscreen" | "change_definition" | "change_rate" | "change_volume" | "change_muted" | "change_pip" | "rotate" | "shot" | "download" | "switch_danmu" | "error_retry";
|
|
733
|
+
source: string;
|
|
734
734
|
from: string | number | boolean | null;
|
|
735
735
|
to: string | number | boolean | null;
|
|
736
736
|
}) => void;
|
|
@@ -791,9 +791,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
791
791
|
bitrate?: number | undefined;
|
|
792
792
|
}[];
|
|
793
793
|
subtitles?: {
|
|
794
|
-
locale: string;
|
|
795
794
|
label: string;
|
|
796
795
|
id: number;
|
|
796
|
+
locale: string;
|
|
797
797
|
}[] | undefined;
|
|
798
798
|
};
|
|
799
799
|
} | {
|
|
@@ -836,8 +836,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
836
836
|
} | {
|
|
837
837
|
event: "qualitychange";
|
|
838
838
|
payload: {
|
|
839
|
-
auto: boolean;
|
|
840
839
|
level: number;
|
|
840
|
+
auto: boolean;
|
|
841
841
|
};
|
|
842
842
|
} | {
|
|
843
843
|
event: "subtitlechange";
|
|
@@ -850,7 +850,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
850
850
|
code: "E_MEDIA_NOT_SUPPORTED" | "E_MANIFEST_PARSE" | "E_MEDIA_DECODE" | "E_MEDIA_ABORTED" | "E_SUBTITLE_LOAD_FAILED" | "E_AUTOPLAY_BLOCKED" | "E_NETWORK" | "E_NETWORK_TIMEOUT" | "E_AUTH_EXPIRED" | "E_ENV_CSP_BLOCKED" | "E_METHOD_NOT_SUPPORTED" | "E_DANMAKU_SEND_FAILED" | "E_INTERNAL" | "E_UNKNOWN" | "E_PLAYER_DESTROYED" | "E_HANDSHAKE_TIMEOUT" | "E_HANDSHAKE_VERSION_MISMATCH" | "E_LOAD_FAILED" | "E_FRAME_CRASHED";
|
|
851
851
|
message: string;
|
|
852
852
|
retryable: boolean;
|
|
853
|
-
category: "
|
|
853
|
+
category: "manifest" | "media" | "network" | "auth" | "env" | "autoplay";
|
|
854
854
|
cause?: import('zod').objectOutputType<{
|
|
855
855
|
name: import('zod').ZodString;
|
|
856
856
|
message: import('zod').ZodString;
|
|
@@ -953,7 +953,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
953
953
|
phase: "start" | "end";
|
|
954
954
|
position: number;
|
|
955
955
|
durationMs?: number | undefined;
|
|
956
|
-
kind?: "
|
|
956
|
+
kind?: "playback" | "firstframe" | "seek" | undefined;
|
|
957
957
|
};
|
|
958
958
|
} | {
|
|
959
959
|
event: "playablechange";
|
|
@@ -961,7 +961,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
961
961
|
reason: "error" | "stalled" | "ok" | "initializing" | "buffering" | "reconnecting" | "autoplay_blocked" | "frame_disconnected" | "degraded";
|
|
962
962
|
playable: boolean;
|
|
963
963
|
recoverable: boolean;
|
|
964
|
-
action?: "play" | "
|
|
964
|
+
action?: "play" | "retry" | "replace-source" | "recreate-frame" | "none" | undefined;
|
|
965
965
|
};
|
|
966
966
|
} | {
|
|
967
967
|
event: "kernelhealth";
|
|
@@ -1017,8 +1017,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1017
1017
|
} | {
|
|
1018
1018
|
event: "useraction";
|
|
1019
1019
|
payload: {
|
|
1020
|
-
source: string;
|
|
1021
1020
|
action: "seek" | "switch_play_pause" | "switch_fullscreen" | "switch_cssfullscreen" | "switch_css_fullscreen" | "change_definition" | "change_rate" | "change_volume" | "change_muted" | "change_pip" | "rotate" | "shot" | "download" | "switch_danmu" | "error_retry";
|
|
1021
|
+
source: string;
|
|
1022
1022
|
from: string | number | boolean | null;
|
|
1023
1023
|
to: string | number | boolean | null;
|
|
1024
1024
|
};
|
|
@@ -1070,9 +1070,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1070
1070
|
bitrate?: number | undefined;
|
|
1071
1071
|
}[];
|
|
1072
1072
|
subtitles?: {
|
|
1073
|
-
locale: string;
|
|
1074
1073
|
label: string;
|
|
1075
1074
|
id: number;
|
|
1075
|
+
locale: string;
|
|
1076
1076
|
}[] | undefined;
|
|
1077
1077
|
};
|
|
1078
1078
|
} | {
|
|
@@ -1115,8 +1115,8 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1115
1115
|
} | {
|
|
1116
1116
|
event: "qualitychange";
|
|
1117
1117
|
payload: {
|
|
1118
|
-
auto: boolean;
|
|
1119
1118
|
level: number;
|
|
1119
|
+
auto: boolean;
|
|
1120
1120
|
};
|
|
1121
1121
|
} | {
|
|
1122
1122
|
event: "subtitlechange";
|
|
@@ -1129,7 +1129,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1129
1129
|
code: "E_MEDIA_NOT_SUPPORTED" | "E_MANIFEST_PARSE" | "E_MEDIA_DECODE" | "E_MEDIA_ABORTED" | "E_SUBTITLE_LOAD_FAILED" | "E_AUTOPLAY_BLOCKED" | "E_NETWORK" | "E_NETWORK_TIMEOUT" | "E_AUTH_EXPIRED" | "E_ENV_CSP_BLOCKED" | "E_METHOD_NOT_SUPPORTED" | "E_DANMAKU_SEND_FAILED" | "E_INTERNAL" | "E_UNKNOWN" | "E_PLAYER_DESTROYED" | "E_HANDSHAKE_TIMEOUT" | "E_HANDSHAKE_VERSION_MISMATCH" | "E_LOAD_FAILED" | "E_FRAME_CRASHED";
|
|
1130
1130
|
message: string;
|
|
1131
1131
|
retryable: boolean;
|
|
1132
|
-
category: "
|
|
1132
|
+
category: "manifest" | "media" | "network" | "auth" | "env" | "autoplay";
|
|
1133
1133
|
cause?: import('zod').objectOutputType<{
|
|
1134
1134
|
name: import('zod').ZodString;
|
|
1135
1135
|
message: import('zod').ZodString;
|
|
@@ -1232,7 +1232,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1232
1232
|
phase: "start" | "end";
|
|
1233
1233
|
position: number;
|
|
1234
1234
|
durationMs?: number | undefined;
|
|
1235
|
-
kind?: "
|
|
1235
|
+
kind?: "playback" | "firstframe" | "seek" | undefined;
|
|
1236
1236
|
};
|
|
1237
1237
|
} | {
|
|
1238
1238
|
event: "playablechange";
|
|
@@ -1240,7 +1240,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1240
1240
|
reason: "error" | "stalled" | "ok" | "initializing" | "buffering" | "reconnecting" | "autoplay_blocked" | "frame_disconnected" | "degraded";
|
|
1241
1241
|
playable: boolean;
|
|
1242
1242
|
recoverable: boolean;
|
|
1243
|
-
action?: "play" | "
|
|
1243
|
+
action?: "play" | "retry" | "replace-source" | "recreate-frame" | "none" | undefined;
|
|
1244
1244
|
};
|
|
1245
1245
|
} | {
|
|
1246
1246
|
event: "kernelhealth";
|
|
@@ -1296,16 +1296,16 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1296
1296
|
} | {
|
|
1297
1297
|
event: "useraction";
|
|
1298
1298
|
payload: {
|
|
1299
|
-
source: string;
|
|
1300
1299
|
action: "seek" | "switch_play_pause" | "switch_fullscreen" | "switch_cssfullscreen" | "switch_css_fullscreen" | "change_definition" | "change_rate" | "change_volume" | "change_muted" | "change_pip" | "rotate" | "shot" | "download" | "switch_danmu" | "error_retry";
|
|
1300
|
+
source: string;
|
|
1301
1301
|
from: string | number | boolean | null;
|
|
1302
1302
|
to: string | number | boolean | null;
|
|
1303
1303
|
};
|
|
1304
1304
|
};
|
|
1305
1305
|
producerSessionId: string;
|
|
1306
|
-
sequence: number;
|
|
1307
1306
|
deliveryId: string;
|
|
1308
1307
|
occurredAtMs: number;
|
|
1308
|
+
sequence: number;
|
|
1309
1309
|
}) => any) | undefined;
|
|
1310
1310
|
onReady?: ((payload: {
|
|
1311
1311
|
duration: number;
|
|
@@ -1342,7 +1342,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1342
1342
|
code: "E_MEDIA_NOT_SUPPORTED" | "E_MANIFEST_PARSE" | "E_MEDIA_DECODE" | "E_MEDIA_ABORTED" | "E_SUBTITLE_LOAD_FAILED" | "E_AUTOPLAY_BLOCKED" | "E_NETWORK" | "E_NETWORK_TIMEOUT" | "E_AUTH_EXPIRED" | "E_ENV_CSP_BLOCKED" | "E_METHOD_NOT_SUPPORTED" | "E_DANMAKU_SEND_FAILED" | "E_INTERNAL" | "E_UNKNOWN" | "E_PLAYER_DESTROYED" | "E_HANDSHAKE_TIMEOUT" | "E_HANDSHAKE_VERSION_MISMATCH" | "E_LOAD_FAILED" | "E_FRAME_CRASHED";
|
|
1343
1343
|
message: string;
|
|
1344
1344
|
retryable: boolean;
|
|
1345
|
-
category: "
|
|
1345
|
+
category: "manifest" | "media" | "network" | "auth" | "env" | "autoplay";
|
|
1346
1346
|
cause?: import('zod').objectOutputType<{
|
|
1347
1347
|
name: import('zod').ZodString;
|
|
1348
1348
|
message: import('zod').ZodString;
|
|
@@ -1365,7 +1365,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1365
1365
|
reason: "error" | "stalled" | "ok" | "initializing" | "buffering" | "reconnecting" | "autoplay_blocked" | "frame_disconnected" | "degraded";
|
|
1366
1366
|
playable: boolean;
|
|
1367
1367
|
recoverable: boolean;
|
|
1368
|
-
action?: "play" | "
|
|
1368
|
+
action?: "play" | "retry" | "replace-source" | "recreate-frame" | "none" | undefined;
|
|
1369
1369
|
}) => any) | undefined;
|
|
1370
1370
|
onKernelHealth?: ((payload: {
|
|
1371
1371
|
reason: "media" | "network" | "other";
|
|
@@ -1438,14 +1438,14 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_WithDefaults<
|
|
|
1438
1438
|
active: boolean;
|
|
1439
1439
|
}) => any) | undefined;
|
|
1440
1440
|
onUserAction?: ((payload: {
|
|
1441
|
-
source: string;
|
|
1442
1441
|
action: "seek" | "switch_play_pause" | "switch_fullscreen" | "switch_cssfullscreen" | "switch_css_fullscreen" | "change_definition" | "change_rate" | "change_volume" | "change_muted" | "change_pip" | "rotate" | "shot" | "download" | "switch_danmu" | "error_retry";
|
|
1442
|
+
source: string;
|
|
1443
1443
|
from: string | number | boolean | null;
|
|
1444
1444
|
to: string | number | boolean | null;
|
|
1445
1445
|
}) => any) | undefined;
|
|
1446
1446
|
}, {
|
|
1447
|
-
autoplay: boolean;
|
|
1448
1447
|
muted: boolean;
|
|
1448
|
+
autoplay: boolean;
|
|
1449
1449
|
loop: boolean;
|
|
1450
1450
|
playsinline: boolean;
|
|
1451
1451
|
controls: boolean;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("vue"),t=require("@video-lab/frame-core");function n(n,r,i){let a=(0,e.shallowRef)(null),o=(0,e.ref)(!1),s=(0,e.ref)(!0);function c(){let e={};return r.preset!==void 0&&(e.preset=r.preset),r.autoplay!==void 0&&(e.autoplay=r.autoplay),r.muted!==void 0&&(e.muted=r.muted),r.loop!==void 0&&(e.loop=r.loop),r.playsinline!==void 0&&(e.playsinline=r.playsinline),r.playbackRate!==void 0&&(e.playbackRate=r.playbackRate),r.volume!==void 0&&(e.volume=r.volume),r.startTime!==void 0&&(e.startTime=r.startTime),r.preload!==void 0&&(e.preload=r.preload),r.controls!==void 0&&(e.controls=r.controls),r.showErrorOverlay!==void 0&&(e.showErrorOverlay=r.showErrorOverlay),r.showLoadingOverlay!==void 0&&(e.showLoadingOverlay=r.showLoadingOverlay),r.controlVisibility!==void 0&&(e.controlVisibility=r.controlVisibility),r.interactive!==void 0&&(e.interactive=r.interactive),r.poster!==void 0&&(e.poster=r.poster),r.pauseImage!==void 0&&(e.pauseImage=r.pauseImage),r.locale!==void 0&&(e.locale=r.locale),r.danmaku!==void 0&&(e.danmaku=r.danmaku),r.debug!==void 0&&(e.debug=r.debug),e}function l(e){(e.event===`play`||e.event===`error`)&&(s.value=!1);try{i(`playerEvent`,e)}catch{}switch(e.event){case`ready`:i(`ready`,e.payload);break;case`play`:i(`play`);break;case`pause`:i(`pause`);break;case`ended`:i(`ended`);break;case`timeupdate`:i(`timeUpdate`,e.payload);break;case`volumechange`:i(`volumeChange`,e.payload);break;case`seeking`:i(`seeking`,e.payload);break;case`seeked`:i(`seeked`,e.payload);break;case`waiting`:i(`waiting`);break;case`playing`:i(`playing`);break;case`qualitychange`:i(`qualityChange`,e.payload);break;case`subtitlechange`:i(`subtitleChange`,e.payload);break;case`error`:i(`error`,e.payload);break;case`autoplayblocked`:i(`autoplayBlocked`);break;case`compatwarning`:i(`compatWarning`,e.payload);break;case`stalled`:i(`stalled`,e.payload);break;case`playablechange`:i(`playableChange`,e.payload);break;case`bufferhealth`:i(`bufferHealth`,e.payload);break;case`contextchange`:i(`contextChange`,e.payload);break;case`sourceroute`:i(`sourceRoute`,e.payload);break;case`firstframe`:i(`firstFrame`,e.payload);break;case`framefreeze`:i(`frameFreeze`,e.payload);break;case`pagefullscreenchange`:i(`pageFullscreenChange`,e.payload);break;case`useraction`:i(`userAction`,e.payload);break;case`kernelhealth`:i(`kernelHealth`,e.payload);break;case`audiohealth`:i(`audioHealth`,e.payload);break;case`recovery`:break;default:break}}let u=!1;return(0,e.onMounted)(async()=>{o.value=!0;let e=n.value;if(!e)return;let s=await(0,t.createPlayerFrame)({container:e,source:r.source,config:c(),pageFullscreen:r.pageFullscreen,...r.origin===void 0?{}:{origin:r.origin},...r.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("vue"),t=require("@video-lab/frame-core");function n(n,r,i){let a=(0,e.shallowRef)(null),o=(0,e.ref)(!1),s=(0,e.ref)(!0);function c(){let e={};return r.preset!==void 0&&(e.preset=r.preset),r.autoplay!==void 0&&(e.autoplay=r.autoplay),r.muted!==void 0&&(e.muted=r.muted),r.loop!==void 0&&(e.loop=r.loop),r.playsinline!==void 0&&(e.playsinline=r.playsinline),r.playbackRate!==void 0&&(e.playbackRate=r.playbackRate),r.volume!==void 0&&(e.volume=r.volume),r.startTime!==void 0&&(e.startTime=r.startTime),r.preload!==void 0&&(e.preload=r.preload),r.controls!==void 0&&(e.controls=r.controls),r.showErrorOverlay!==void 0&&(e.showErrorOverlay=r.showErrorOverlay),r.showLoadingOverlay!==void 0&&(e.showLoadingOverlay=r.showLoadingOverlay),r.controlVisibility!==void 0&&(e.controlVisibility=r.controlVisibility),r.interactive!==void 0&&(e.interactive=r.interactive),r.poster!==void 0&&(e.poster=r.poster),r.pauseImage!==void 0&&(e.pauseImage=r.pauseImage),r.locale!==void 0&&(e.locale=r.locale),r.danmaku!==void 0&&(e.danmaku=r.danmaku),r.debug!==void 0&&(e.debug=r.debug),e}function l(e){(e.event===`play`||e.event===`error`)&&(s.value=!1);try{i(`playerEvent`,e)}catch{}switch(e.event){case`ready`:i(`ready`,e.payload);break;case`play`:i(`play`);break;case`pause`:i(`pause`);break;case`ended`:i(`ended`);break;case`timeupdate`:i(`timeUpdate`,e.payload);break;case`volumechange`:i(`volumeChange`,e.payload);break;case`seeking`:i(`seeking`,e.payload);break;case`seeked`:i(`seeked`,e.payload);break;case`waiting`:i(`waiting`);break;case`playing`:i(`playing`);break;case`qualitychange`:i(`qualityChange`,e.payload);break;case`subtitlechange`:i(`subtitleChange`,e.payload);break;case`error`:i(`error`,e.payload);break;case`autoplayblocked`:i(`autoplayBlocked`);break;case`compatwarning`:i(`compatWarning`,e.payload);break;case`stalled`:i(`stalled`,e.payload);break;case`playablechange`:i(`playableChange`,e.payload);break;case`bufferhealth`:i(`bufferHealth`,e.payload);break;case`contextchange`:i(`contextChange`,e.payload);break;case`sourceroute`:i(`sourceRoute`,e.payload);break;case`firstframe`:i(`firstFrame`,e.payload);break;case`framefreeze`:i(`frameFreeze`,e.payload);break;case`pagefullscreenchange`:i(`pageFullscreenChange`,e.payload);break;case`useraction`:i(`userAction`,e.payload);break;case`kernelhealth`:i(`kernelHealth`,e.payload);break;case`audiohealth`:i(`audioHealth`,e.payload);break;case`recovery`:break;default:break}}let u=!1;return(0,e.onMounted)(async()=>{o.value=!0;let e=n.value;if(!e)return;let s=await(0,t.createPlayerFrame)({container:e,source:r.source,config:c(),pageFullscreen:r.pageFullscreen,...r.origin===void 0?{}:{origin:r.origin},...r.iframeVersion===void 0?{}:{iframeVersion:r.iframeVersion},onEvent:l,onDeliveredEvent:e=>{try{i(`deliveredPlayerEvent`,e)}catch{}},debug:r.debug??!1});if(u){s.destroy();return}a.value=s}),(0,e.watch)(()=>JSON.stringify(r.source),async()=>{s.value=!0;try{await a.value?.load(r.source)}catch(e){l({event:`error`,payload:(0,t.toPlayerError)(e)})}}),(0,e.watch)(()=>r.muted,async e=>{if(e!==void 0)try{await a.value?.setMuted(e)}catch(e){l({event:`error`,payload:(0,t.toPlayerError)(e)})}}),(0,e.watch)(()=>r.locale,async e=>{if(e!==void 0)try{await a.value?.setLocale(e)}catch(e){l({event:`error`,payload:(0,t.toPlayerError)(e)})}},{deep:!0}),(0,e.onBeforeUnmount)(async()=>{u=!0,await a.value?.destroy(),a.value=null}),{handle:a,isMounted:o,hostPosterVisible:s}}var r=(0,e.createElementVNode)(`div`,{class:`sentinel-video-frame__placeholder`,style:{width:`100%`,height:`100%`,background:`#000`}},null,-1),i=[`src`,`loading`],a=(0,e.defineComponent)({__name:`VideoPlayerFrame`,props:{pageFullscreen:{},source:{},autoplay:{type:Boolean,default:void 0},muted:{type:Boolean,default:void 0},loop:{type:Boolean,default:void 0},controls:{type:Boolean,default:void 0},showErrorOverlay:{type:Boolean,default:void 0},showLoadingOverlay:{type:Boolean,default:void 0},controlVisibility:{},interactive:{type:Boolean,default:void 0},playsinline:{type:Boolean,default:void 0},playbackRate:{},volume:{},startTime:{},preload:{},poster:{},pauseImage:{},preset:{},origin:{},iframeVersion:{},locale:{},danmaku:{},debug:{type:Boolean,default:void 0}},emits:`playerEvent.deliveredPlayerEvent.ready.play.pause.ended.timeUpdate.volumeChange.seeking.seeked.waiting.playing.qualityChange.subtitleChange.error.autoplayBlocked.compatWarning.stalled.playableChange.kernelHealth.audioHealth.bufferHealth.contextChange.sourceRoute.firstFrame.frameFreeze.pageFullscreenChange.userAction`.split(`.`),setup(t,{expose:a,emit:o}){let s=t,c=o,l=(0,e.shallowRef)(null),{handle:u,isMounted:d,hostPosterVisible:f}=n(l,s,c),p=(0,e.computed)(()=>typeof s.poster==`string`?s.poster:s.poster?.url??``),m=(0,e.computed)(()=>typeof s.poster==`string`?`cover`:s.poster?.fit??`cover`),h=(0,e.computed)(()=>typeof s.poster!=`string`&&s.poster?.loading===`eager`?`eager`:`lazy`);return a({play:()=>u.value?.play()??Promise.resolve(),pause:()=>u.value?.pause()??Promise.resolve(),seek:e=>u.value?.seek(e)??Promise.resolve(),setMuted:e=>u.value?.setMuted(e)??Promise.resolve(),setVolume:e=>u.value?.setVolume(e)??Promise.resolve(),setPlaybackRate:e=>u.value?.setPlaybackRate(e)??Promise.resolve(),setPageFullscreen:e=>u.value?.setPageFullscreen(e)??Promise.reject(Error(`播放器未就绪`)),enterFullscreen:()=>u.value?.enterFullscreen()??Promise.resolve(),exitFullscreen:()=>u.value?.exitFullscreen()??Promise.resolve(),setQuality:e=>u.value?.setQuality(e)??Promise.resolve(),setSubtitle:e=>u.value?.setSubtitle(e)??Promise.resolve(),setLocale:e=>u.value?.setLocale(e)??Promise.resolve(),pushDanmaku:e=>u.value?.pushDanmaku(e)??Promise.resolve(),setDanmakuEnabled:e=>u.value?.setDanmakuEnabled(e)??Promise.resolve(),clearDanmaku:()=>u.value?.clearDanmaku()??Promise.resolve(),retry:()=>u.value?.retry()??Promise.resolve(),destroy:()=>u.value?.destroy()??Promise.resolve(),getCurrentTime:()=>u.value?.getCurrentTime()??0,getPlaybackContext:()=>u.value?.getPlaybackContext()??null,getDuration:()=>u.value?.getDuration()??0,getPlayerHandle:()=>u.value}),(t,n)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{ref_key:`containerRef`,ref:l,class:`sentinel-video-frame`,style:(0,e.normalizeStyle)({position:`relative`,width:`100%`,height:`100%`,pointerEvents:s.interactive===!1?`none`:void 0})},[(0,e.unref)(d)?(0,e.createCommentVNode)(``,!0):(0,e.renderSlot)(t.$slots,`ssr-placeholder`,{key:0},()=>[r]),(0,e.unref)(f)&&p.value?((0,e.openBlock)(),(0,e.createElementBlock)(`img`,{key:1,class:`sentinel-video-frame__poster`,src:p.value,alt:``,loading:h.value,style:(0,e.normalizeStyle)({position:`absolute`,inset:0,width:`100%`,height:`100%`,display:`block`,objectFit:m.value,zIndex:10})},null,12,i)):(0,e.createCommentVNode)(``,!0)],4))}});exports.VideoPlayerFrame=a;
|
package/dist/index.js
CHANGED
|
@@ -106,7 +106,7 @@ function g(e, t, n) {
|
|
|
106
106
|
config: c(),
|
|
107
107
|
pageFullscreen: t.pageFullscreen,
|
|
108
108
|
...t.origin === void 0 ? {} : { origin: t.origin },
|
|
109
|
-
...t.
|
|
109
|
+
...t.iframeVersion === void 0 ? {} : { iframeVersion: t.iframeVersion },
|
|
110
110
|
onEvent: u,
|
|
111
111
|
onDeliveredEvent: (e) => {
|
|
112
112
|
try {
|
|
@@ -211,7 +211,7 @@ var _ = /*#__PURE__*/ r("div", {
|
|
|
211
211
|
pauseImage: {},
|
|
212
212
|
preset: {},
|
|
213
213
|
origin: {},
|
|
214
|
-
|
|
214
|
+
iframeVersion: {},
|
|
215
215
|
locale: {},
|
|
216
216
|
danmaku: {},
|
|
217
217
|
debug: {
|
package/dist/types.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type { DanmakuConfig, DanmakuItem, MediaSource, PlayerError, QualityLevel
|
|
|
12
12
|
* `<VideoPlayerFrame />` 的 props。
|
|
13
13
|
*
|
|
14
14
|
* 对齐 vue-frame/CLAUDE.md § API。播放相关的字段最终拼进 frame-core 的
|
|
15
|
-
* `config` 下发给 iframe;origin
|
|
15
|
+
* `config` 下发给 iframe;origin 走 ADR-101 的 URL 覆盖。
|
|
16
16
|
*/
|
|
17
17
|
export interface VideoPlayerFrameProps {
|
|
18
18
|
/** 挂载期间保持稳定的宿主网页全屏布局适配器。 */
|
|
@@ -62,10 +62,10 @@ export interface VideoPlayerFrameProps {
|
|
|
62
62
|
*/
|
|
63
63
|
pauseImage?: string | PauseImageConfig;
|
|
64
64
|
preset?: PresetName;
|
|
65
|
-
/** iframe 部署基础 URL
|
|
65
|
+
/** iframe 部署基础 URL,可包含自定义目录。 */
|
|
66
66
|
origin?: string;
|
|
67
|
-
/** iframe
|
|
68
|
-
|
|
67
|
+
/** iframe 应用的精确版本目录;缺省时访问部署根目录。 */
|
|
68
|
+
iframeVersion?: string;
|
|
69
69
|
/** 传给 iframe 内 xgplayer 的 i18n 配置 */
|
|
70
70
|
locale?: LocaleConfig;
|
|
71
71
|
/** 弹幕配置(ADR-028)。enabled 时 iframe 内注册渲染引擎;数据经 pushDanmaku 推入 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@video-lab/vue-frame",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"vue": "^3.4.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@video-lab/protocol": "3.
|
|
32
|
-
"@video-lab/frame-core": "3.
|
|
31
|
+
"@video-lab/protocol": "3.1.0",
|
|
32
|
+
"@video-lab/frame-core": "3.1.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@vitejs/plugin-vue": "^6.0.8",
|