mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 18:26:17 +00:00
fix(player): report and fail closed on runtime delivery errors (#3472)
* feat(player): report runtime data application * fix(player): fail closed on runtime data delivery * fix(player): close runtime delivery and sandbox gaps * fix(player): satisfy runtime contract and CodeQL * refactor(player): simplify runtime tag scanner * style(player): apply repository formatter * fix(player): type runtime tag boundaries * fix(core): mint guest-local runtime-data ids in a separate space from host ids
This commit is contained in:
@@ -40,6 +40,8 @@ export interface MessageHandlerCallbacks extends PlaybackStateCallbacks {
|
||||
* uses it to replay current bridge state (mute, volume, playback rate) so
|
||||
* control messages sent before the iframe's listener registered aren't lost. */
|
||||
onRuntimeReady: () => void;
|
||||
onRuntimeDataApplied?: (channel: unknown, requestId: unknown) => void;
|
||||
onRuntimeDataError?: (channel: unknown, requestId: unknown, message: unknown) => void;
|
||||
/** Invoked when the runtime posts a finite positive timeline duration. The
|
||||
* player uses this as the cross-origin readiness signal because the
|
||||
* same-origin composition probe cannot inspect CDN iframes. */
|
||||
@@ -93,11 +95,12 @@ export function handleRuntimeMessage(
|
||||
}
|
||||
|
||||
if (data["type"] === "runtime-data-error") {
|
||||
callbacks.dispatchEvent(
|
||||
new CustomEvent("runtimedataerror", {
|
||||
detail: { channel: data["channel"], message: data["message"] },
|
||||
}),
|
||||
);
|
||||
callbacks.onRuntimeDataError?.(data["channel"], data["requestId"], data["message"]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data["type"] === "runtime-data-applied") {
|
||||
callbacks.onRuntimeDataApplied?.(data["channel"], data["requestId"]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user