feat: productionize learning engine and classroom
This commit is contained in:
17
OpenMAIC/lib/makelore-runtime/progress-events.ts
Normal file
17
OpenMAIC/lib/makelore-runtime/progress-events.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export const MAKELORE_PLAYBACK_PROGRESS_EVENT = 'makelore:playback-progress';
|
||||
|
||||
export type MakelorePlaybackProgress = {
|
||||
sceneId: string;
|
||||
sceneOrder: number;
|
||||
actionIndex: number | null;
|
||||
completed: boolean;
|
||||
};
|
||||
|
||||
/** Publish playback detail only inside the verified offline player surface. */
|
||||
export function emitMakelorePlaybackProgress(detail: MakelorePlaybackProgress): void {
|
||||
if (typeof window === 'undefined' || !window.__MAKELORE_OFFLINE_PLAYER__) return;
|
||||
window.dispatchEvent(new CustomEvent<MakelorePlaybackProgress>(
|
||||
MAKELORE_PLAYBACK_PROGRESS_EVENT,
|
||||
{ detail },
|
||||
));
|
||||
}
|
||||
Reference in New Issue
Block a user