Enforce explicit WebGL book playback timeline
This commit is contained in:
@@ -252,16 +252,6 @@ class PlaybackCoordinatorModule extends BaseModule {
|
||||
};
|
||||
});
|
||||
}
|
||||
document.dispatchEvent(new CustomEvent('book-texture:reveal-block', {
|
||||
detail: {
|
||||
id: sentence.id,
|
||||
blockId: sentence.blockId ?? sentence.metadata?.blockId ?? null,
|
||||
wordTimings,
|
||||
cueTimings,
|
||||
totalDuration: sentence.animation.totalDuration || 0
|
||||
}
|
||||
}));
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const totalDuration = wordTimings.length > 0
|
||||
? Math.max(...wordTimings.map(timing => timing.delay + timing.duration))
|
||||
@@ -332,15 +322,16 @@ class PlaybackCoordinatorModule extends BaseModule {
|
||||
cueTimings = [];
|
||||
}
|
||||
|
||||
document.dispatchEvent(new CustomEvent('book-texture:reveal-block', {
|
||||
detail: {
|
||||
id: sentence.id,
|
||||
blockId: sentence.blockId ?? sentence.metadata?.blockId ?? null,
|
||||
wordTimings,
|
||||
cueTimings,
|
||||
totalDuration: sentence.animation?.totalDuration || 0
|
||||
}
|
||||
}));
|
||||
if (typeof sentence.webglRevealController !== 'function') {
|
||||
throw new Error('PlaybackCoordinator: WebGL playback requires a prepared timeline reveal controller');
|
||||
}
|
||||
sentence.webglRevealController({
|
||||
id: sentence.id,
|
||||
blockId: sentence.blockId ?? sentence.metadata?.blockId ?? null,
|
||||
wordTimings,
|
||||
cueTimings,
|
||||
totalDuration: sentence.animation?.totalDuration || 0
|
||||
});
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const totalDuration = wordTimings.length > 0
|
||||
|
||||
Reference in New Issue
Block a user