Add WebGL FPS cap and texture word reveal

This commit is contained in:
2026-06-06 15:37:44 +02:00
parent bc736513d4
commit 431e305df9
5 changed files with 219 additions and 18 deletions
+15
View File
@@ -241,6 +241,15 @@ 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
@@ -350,6 +359,12 @@ class PlaybackCoordinatorModule extends BaseModule {
console.log('PlaybackCoordinator: Fast forwarding');
this.accelerateActiveWordAnimations(this.currentSentence);
document.dispatchEvent(new CustomEvent('book-texture:fast-forward', {
detail: {
id: this.currentSentence?.id,
blockId: this.currentSentence?.blockId ?? this.currentSentence?.metadata?.blockId ?? null
}
}));
const animQueue = this.getModule('animation-queue');
if (animQueue) {