fix(training-video): 修复苹果企业微信无法播放培训视频

This commit is contained in:
runny committed 2026-07-21 14:11:01 +08:00
1 parent e457a66465
commit 9838b77441
13 files changed
+182 -21

No files matched your search

@@ -86,6 +86,13 @@ const handleVideoEnded = () => {
workspace.markVideoCompleted();
};
const reportVideoDebugEvent = (event: Event) => {
const video = event.target as HTMLVideoElement;
// #region debug-point A-E:ios-video-runtime
fetch('http://192.168.65.184:7777/event', { method: 'POST', body: JSON.stringify({ sessionId: 'ios-training-video', runId: 'pre-fix', hypothesisId: 'A-E', location: 'TrainingWorkspacePanel.vue:video', msg: '[DEBUG] iOS training video runtime event', data: { event: event.type, src: video.currentSrc || workspace.videoUrl, userAgent: navigator.userAgent, networkState: video.networkState, readyState: video.readyState, mediaErrorCode: video.error?.code ?? null, mediaErrorMessage: video.error?.message ?? null, duration: Number.isFinite(video.duration) ? video.duration : null, currentTime: video.currentTime }, ts: Date.now() }) }).catch(() => {});
// #endregion
};
const setWorkspaceExpanded = (expanded: boolean, manual = false) => {
workspaceExpanded.value = expanded;
emit('update:expanded', expanded);
@@ -841,8 +848,17 @@ const handleStageCardClick = (stageKey: string) => {
<div class="aspect-video bg-black">
<video
controls
autoplay
playsinline
webkit-playsinline="true"
preload="metadata"
class="h-full w-full"
@loadstart="reportVideoDebugEvent"
@loadedmetadata="reportVideoDebugEvent"
@canplay="reportVideoDebugEvent"
@play="reportVideoDebugEvent"
@error="reportVideoDebugEvent"
@stalled="reportVideoDebugEvent"
@abort="reportVideoDebugEvent"
@timeupdate="handleVideoTimeUpdate"
@seeking="handleVideoSeeking"
@ended="handleVideoEnded"