libaribhtml5 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/libaribhtml5.js +10 -10
- package/dist/sdk/libaribhtml5.mjs +1484 -1187
- package/dist/types/receiver/canvas-controller.d.ts +30 -0
- package/dist/types/receiver/protocol.d.ts +21 -0
- package/dist/types/receiver/runtime-session-controller.d.ts +40 -0
- package/dist/types/receiver/types.d.ts +91 -0
- package/dist/types/receiver-host.d.ts +9 -108
- package/dist/types/runtime/application-controller.d.ts +48 -0
- package/dist/types/runtime/caption-controller.d.ts +27 -0
- package/dist/types/runtime/external-media-hole.d.ts +28 -0
- package/dist/types/runtime/external-network.d.ts +7 -0
- package/dist/types/runtime/install.d.ts +2 -10
- package/dist/types/runtime/media-plane-runtime.d.ts +54 -0
- package/dist/types/service-worker-vfs.d.ts +3 -84
- package/dist/types/vfs/service-worker-backend.d.ts +27 -0
- package/dist/types/vfs/session.d.ts +36 -0
- package/dist/types/vfs/types.d.ts +23 -0
- package/package.json +3 -2
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type ReceiverCanvasSize = {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
};
|
|
5
|
+
type CanvasResizeObserver = Pick<ResizeObserver, 'observe' | 'disconnect'>;
|
|
6
|
+
type ReceiverCanvasControllerOptions = {
|
|
7
|
+
iframe: HTMLIFrameElement;
|
|
8
|
+
viewport: HTMLElement;
|
|
9
|
+
createResizeObserver?: (callback: ResizeObserverCallback) => CanvasResizeObserver;
|
|
10
|
+
};
|
|
11
|
+
/** Owns receiver-canvas geometry and background selection for the host facade. */
|
|
12
|
+
export declare class ReceiverCanvasController {
|
|
13
|
+
private readonly iframe;
|
|
14
|
+
private readonly viewport;
|
|
15
|
+
private readonly resizeObserver;
|
|
16
|
+
private logicalWidth;
|
|
17
|
+
private logicalHeight;
|
|
18
|
+
private lctBackgroundColor;
|
|
19
|
+
private stageBackgroundColor;
|
|
20
|
+
constructor(options: ReceiverCanvasControllerOptions);
|
|
21
|
+
get logicalSize(): ReceiverCanvasSize;
|
|
22
|
+
setLctBackgroundColor(backgroundColorRgb: number | null): void;
|
|
23
|
+
setStageBackgroundColor(backgroundColor: string | null): void;
|
|
24
|
+
resetStageBackground(): void;
|
|
25
|
+
applyScreenSize(width: number, height: number): void;
|
|
26
|
+
fit(): void;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
private applyBackgroundColor;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AribMediaPlane, AribMediaPlaneLayer } from '../media-plane';
|
|
2
|
+
/** Untrusted runtime-to-host wire message before session and event filtering. */
|
|
3
|
+
export type RuntimeMessage = Record<string, unknown> & {
|
|
4
|
+
type?: string;
|
|
5
|
+
runtimeId?: string;
|
|
6
|
+
event?: string;
|
|
7
|
+
};
|
|
8
|
+
export type AribApplicationReplaceRequest = {
|
|
9
|
+
organizationId: number;
|
|
10
|
+
applicationId: number;
|
|
11
|
+
aitUrl: string | null;
|
|
12
|
+
};
|
|
13
|
+
export type ReceiverMediaPlaneFallback = {
|
|
14
|
+
screenWidth: number;
|
|
15
|
+
screenHeight: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function normalizeStageBackgroundColor(value: unknown): string | null;
|
|
18
|
+
export declare function normalizeCaptionSubscriptionTags(value: unknown): number[];
|
|
19
|
+
export declare function normalizeApplicationReplaceRequest(message: RuntimeMessage): AribApplicationReplaceRequest | null;
|
|
20
|
+
export declare function normalizeMediaLayer(value: unknown): AribMediaPlaneLayer;
|
|
21
|
+
export declare function normalizeMediaPlane(message: RuntimeMessage, fallback: ReceiverMediaPlaneFallback): AribMediaPlane;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ProgramInfo } from '../program-info';
|
|
2
|
+
import type { RuntimeApplicationInformation } from '../runtime/application-controller';
|
|
3
|
+
import type { RuntimeEvent } from '../runtime/stream-event';
|
|
4
|
+
export type RuntimeInstalledSnapshot = {
|
|
5
|
+
captionComponentTags: readonly number[];
|
|
6
|
+
applicationInformation: RuntimeApplicationInformation;
|
|
7
|
+
inputActive: boolean;
|
|
8
|
+
programInfo: ProgramInfo | null;
|
|
9
|
+
};
|
|
10
|
+
type RuntimeSessionControllerOptions = {
|
|
11
|
+
ownerWindow: Window;
|
|
12
|
+
iframe: HTMLIFrameElement;
|
|
13
|
+
origin: string;
|
|
14
|
+
applicationLoadTimeoutMs: number;
|
|
15
|
+
onApplicationLoadTimeout: (url: string) => void;
|
|
16
|
+
};
|
|
17
|
+
/** Owns receiver-to-runtime transport and the runtime installation session. */
|
|
18
|
+
export declare class RuntimeSessionController {
|
|
19
|
+
private readonly ownerWindow;
|
|
20
|
+
private readonly iframe;
|
|
21
|
+
private readonly origin;
|
|
22
|
+
private readonly applicationLoadTimeoutMs;
|
|
23
|
+
private readonly onApplicationLoadTimeout;
|
|
24
|
+
private readonly pendingStreamEvents;
|
|
25
|
+
private activeRuntimeId;
|
|
26
|
+
private applicationLoadTimer;
|
|
27
|
+
private disposed;
|
|
28
|
+
constructor(options: RuntimeSessionControllerOptions);
|
|
29
|
+
get hasActiveRuntime(): boolean;
|
|
30
|
+
matches(runtimeId: unknown): boolean;
|
|
31
|
+
acceptInstalled(runtimeId: string, snapshot: RuntimeInstalledSnapshot, beforeReplay?: () => void): void;
|
|
32
|
+
postToRuntime(event: string, detail?: Record<string, unknown>): void;
|
|
33
|
+
emitStreamEvent(value: RuntimeEvent): void;
|
|
34
|
+
clearPendingStreamEvents(): void;
|
|
35
|
+
invalidate(): void;
|
|
36
|
+
armWatchdog(url: string): void;
|
|
37
|
+
clearWatchdog(): void;
|
|
38
|
+
dispose(): void;
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { ReceiverDeviceIdentifierProvider } from '../device-identifier';
|
|
2
|
+
import type { AribMediaPlane, AribMediaPlaneAdapter } from '../media-plane';
|
|
3
|
+
import type { AribProgramGuideHandler, AribProgramGuideUnavailableHandler } from '../program-guide';
|
|
4
|
+
import type { RuntimeApplicationInformation } from '../runtime/install';
|
|
5
|
+
import type { BroadcastResourceStore } from '../runtime/resources';
|
|
6
|
+
import type { ReceiverSystemInformationOverrides } from '../runtime/system-information';
|
|
7
|
+
import type { AribViewerParticipationEvent } from '../viewer-participation';
|
|
8
|
+
import type { AribApplicationReplaceRequest } from './protocol';
|
|
9
|
+
export type AribCaptionPacket = {
|
|
10
|
+
componentTag: number;
|
|
11
|
+
payload?: string;
|
|
12
|
+
dataType?: string;
|
|
13
|
+
tmd?: string;
|
|
14
|
+
data?: string;
|
|
15
|
+
};
|
|
16
|
+
export type AribCaptionSubscription = {
|
|
17
|
+
componentTags: number[];
|
|
18
|
+
};
|
|
19
|
+
export type AribApplicationInformation = RuntimeApplicationInformation;
|
|
20
|
+
export type { AribApplicationReplaceRequest } from './protocol';
|
|
21
|
+
export type AribApplicationReplaceHandler = (request: AribApplicationReplaceRequest) => void | Promise<void>;
|
|
22
|
+
export type AribExitManagedStateHandler = (url: string) => void | Promise<void>;
|
|
23
|
+
export type AribBroadcastClock = {
|
|
24
|
+
/** Absolute broadcast time at the anchor, as Unix epoch milliseconds. */
|
|
25
|
+
epochMilliseconds: number;
|
|
26
|
+
/** Media timeline value which corresponds to epochMilliseconds. */
|
|
27
|
+
mediaTimeSeconds?: number;
|
|
28
|
+
/** Current playback position; enables pause, rate, and seek aware projection. */
|
|
29
|
+
currentMediaTimeSeconds?: () => number;
|
|
30
|
+
};
|
|
31
|
+
export type AribReceiverLifecycleEvent = {
|
|
32
|
+
type: 'loading';
|
|
33
|
+
url: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'installed';
|
|
36
|
+
url: string;
|
|
37
|
+
runtimeId: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'navigating';
|
|
40
|
+
url: string;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'exited';
|
|
43
|
+
} | {
|
|
44
|
+
type: 'navigation-blocked';
|
|
45
|
+
url: string;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'frame-blocked';
|
|
48
|
+
url: string;
|
|
49
|
+
} | {
|
|
50
|
+
type: 'error';
|
|
51
|
+
message: string;
|
|
52
|
+
};
|
|
53
|
+
export type AribReceiverHostOptions = {
|
|
54
|
+
iframe: HTMLIFrameElement;
|
|
55
|
+
viewport: HTMLElement;
|
|
56
|
+
/** Surface used only by the behind-iframe compatibility adapter. */
|
|
57
|
+
videoSurface?: HTMLElement;
|
|
58
|
+
mediaPlaneAdapter?: AribMediaPlaneAdapter;
|
|
59
|
+
onStatus?: (status: string) => void;
|
|
60
|
+
/** Machine-readable application/runtime lifecycle; never branch on onStatus text. */
|
|
61
|
+
onLifecycle?: (event: AribReceiverLifecycleEvent) => void;
|
|
62
|
+
/** Time to wait for a loaded document to install the receiver runtime. 0 disables the fallback. */
|
|
63
|
+
applicationLoadTimeoutMs?: number;
|
|
64
|
+
onUrlChange?: (url: string) => void;
|
|
65
|
+
onMediaPlane?: (plane: AribMediaPlane) => void;
|
|
66
|
+
/** @deprecated Use onMediaPlane. */
|
|
67
|
+
onVideoPlane?: (plane: AribMediaPlane) => void;
|
|
68
|
+
keepVideoVisible?: boolean;
|
|
69
|
+
/** Allow broadcaster applications to use HTTP origins outside this host. */
|
|
70
|
+
allowExternalNetwork?: boolean;
|
|
71
|
+
/** Same-origin namespace where a Worker or HTTP server exposes carousel data. */
|
|
72
|
+
broadcastBaseUrl?: string | URL;
|
|
73
|
+
/** Optional bridge to a Service Worker, Cache Storage, or carousel VFS. */
|
|
74
|
+
resourceStore?: BroadcastResourceStore;
|
|
75
|
+
/** Receiver/WebView bridge which opens the native EPG or a program detail page. */
|
|
76
|
+
onOpenProgramGuide?: AribProgramGuideHandler;
|
|
77
|
+
/** Active caption components requested by the current broadcast document. */
|
|
78
|
+
onCaptionSubscription?: (subscription: AribCaptionSubscription) => void;
|
|
79
|
+
/** Resolve Application.replaceApplication() through the receiver's current MH-AIT. */
|
|
80
|
+
onReplaceApplication?: AribApplicationReplaceHandler;
|
|
81
|
+
/** Transfer an application to an unmanaged general-application URL. */
|
|
82
|
+
onExitManagedState?: AribExitManagedStateHandler;
|
|
83
|
+
/** Override the default browser alert when the receiver cannot open the EPG. */
|
|
84
|
+
onProgramGuideUnavailable?: AribProgramGuideUnavailableHandler;
|
|
85
|
+
/** Receiver identity/capabilities exposed to the broadcast application. */
|
|
86
|
+
systemInformation?: ReceiverSystemInformationOverrides;
|
|
87
|
+
/** Resolve receiver/CAS identifiers; defaults to the bundled Huggy demo identity. */
|
|
88
|
+
getDeviceIdentifier?: ReceiverDeviceIdentifierProvider;
|
|
89
|
+
/** Receiver UI hook for a TR-B39 viewer-participation corner notification. */
|
|
90
|
+
onViewerParticipation?: (event: AribViewerParticipationEvent) => void;
|
|
91
|
+
};
|
|
@@ -1,99 +1,11 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type RuntimeEvent, type RuntimeWindow } from './runtime/install';
|
|
2
2
|
import { type ProgramInfo } from './program-info';
|
|
3
|
-
import type {
|
|
4
|
-
import type
|
|
5
|
-
import { type
|
|
6
|
-
import type {
|
|
7
|
-
import { type AribProgramGuideHandler, type AribProgramGuideRequest, type AribProgramGuideUnavailableHandler } from './program-guide';
|
|
8
|
-
import { type AribApplicationPresentationState, type AribViewerParticipationEvent, type AribViewerParticipationNotification } from './viewer-participation';
|
|
3
|
+
import type { BroadcastResourceChange } from './runtime/resources';
|
|
4
|
+
import { type AribProgramGuideRequest } from './program-guide';
|
|
5
|
+
import { type AribApplicationPresentationState, type AribViewerParticipationNotification } from './viewer-participation';
|
|
6
|
+
import type { AribApplicationInformation, AribBroadcastClock, AribCaptionPacket, AribReceiverHostOptions } from './receiver/types';
|
|
9
7
|
export type { AribMediaPlane, AribMediaPlaneAdapter, AribMediaPlaneLayer, AribMediaPlaneStackEntry, AribMediaPlaneUnmountReason, AribVideoPlane, } from './media-plane';
|
|
10
|
-
export type AribCaptionPacket
|
|
11
|
-
componentTag: number;
|
|
12
|
-
payload?: string;
|
|
13
|
-
dataType?: string;
|
|
14
|
-
tmd?: string;
|
|
15
|
-
data?: string;
|
|
16
|
-
};
|
|
17
|
-
export type AribCaptionSubscription = {
|
|
18
|
-
componentTags: number[];
|
|
19
|
-
};
|
|
20
|
-
export type AribApplicationInformation = RuntimeApplicationInformation;
|
|
21
|
-
export type AribApplicationReplaceRequest = {
|
|
22
|
-
organizationId: number;
|
|
23
|
-
applicationId: number;
|
|
24
|
-
aitUrl: string | null;
|
|
25
|
-
};
|
|
26
|
-
export type AribApplicationReplaceHandler = (request: AribApplicationReplaceRequest) => void | Promise<void>;
|
|
27
|
-
export type AribExitManagedStateHandler = (url: string) => void | Promise<void>;
|
|
28
|
-
export type AribBroadcastClock = {
|
|
29
|
-
/** Absolute broadcast time at the anchor, as Unix epoch milliseconds. */
|
|
30
|
-
epochMilliseconds: number;
|
|
31
|
-
/** Media timeline value which corresponds to epochMilliseconds. */
|
|
32
|
-
mediaTimeSeconds?: number;
|
|
33
|
-
/** Current playback position; enables pause, rate, and seek aware projection. */
|
|
34
|
-
currentMediaTimeSeconds?: () => number;
|
|
35
|
-
};
|
|
36
|
-
export type AribReceiverLifecycleEvent = {
|
|
37
|
-
type: 'loading';
|
|
38
|
-
url: string;
|
|
39
|
-
} | {
|
|
40
|
-
type: 'installed';
|
|
41
|
-
url: string;
|
|
42
|
-
runtimeId: string;
|
|
43
|
-
} | {
|
|
44
|
-
type: 'navigating';
|
|
45
|
-
url: string;
|
|
46
|
-
} | {
|
|
47
|
-
type: 'exited';
|
|
48
|
-
} | {
|
|
49
|
-
type: 'navigation-blocked';
|
|
50
|
-
url: string;
|
|
51
|
-
} | {
|
|
52
|
-
type: 'frame-blocked';
|
|
53
|
-
url: string;
|
|
54
|
-
} | {
|
|
55
|
-
type: 'error';
|
|
56
|
-
message: string;
|
|
57
|
-
};
|
|
58
|
-
export type AribReceiverHostOptions = {
|
|
59
|
-
iframe: HTMLIFrameElement;
|
|
60
|
-
viewport: HTMLElement;
|
|
61
|
-
/** Surface used only by the behind-iframe compatibility adapter. */
|
|
62
|
-
videoSurface?: HTMLElement;
|
|
63
|
-
mediaPlaneAdapter?: AribMediaPlaneAdapter;
|
|
64
|
-
onStatus?: (status: string) => void;
|
|
65
|
-
/** Machine-readable application/runtime lifecycle; never branch on onStatus text. */
|
|
66
|
-
onLifecycle?: (event: AribReceiverLifecycleEvent) => void;
|
|
67
|
-
/** Time to wait for a loaded document to install the receiver runtime. 0 disables the fallback. */
|
|
68
|
-
applicationLoadTimeoutMs?: number;
|
|
69
|
-
onUrlChange?: (url: string) => void;
|
|
70
|
-
onMediaPlane?: (plane: AribMediaPlane) => void;
|
|
71
|
-
/** @deprecated Use onMediaPlane. */
|
|
72
|
-
onVideoPlane?: (plane: AribMediaPlane) => void;
|
|
73
|
-
keepVideoVisible?: boolean;
|
|
74
|
-
/** Allow broadcaster applications to use HTTP origins outside this host. */
|
|
75
|
-
allowExternalNetwork?: boolean;
|
|
76
|
-
/** Same-origin namespace where a Worker or HTTP server exposes carousel data. */
|
|
77
|
-
broadcastBaseUrl?: string | URL;
|
|
78
|
-
/** Optional bridge to a Service Worker, Cache Storage, or carousel VFS. */
|
|
79
|
-
resourceStore?: BroadcastResourceStore;
|
|
80
|
-
/** Receiver/WebView bridge which opens the native EPG or a program detail page. */
|
|
81
|
-
onOpenProgramGuide?: AribProgramGuideHandler;
|
|
82
|
-
/** Active caption components requested by the current broadcast document. */
|
|
83
|
-
onCaptionSubscription?: (subscription: AribCaptionSubscription) => void;
|
|
84
|
-
/** Resolve Application.replaceApplication() through the receiver's current MH-AIT. */
|
|
85
|
-
onReplaceApplication?: AribApplicationReplaceHandler;
|
|
86
|
-
/** Transfer an application to an unmanaged general-application URL. */
|
|
87
|
-
onExitManagedState?: AribExitManagedStateHandler;
|
|
88
|
-
/** Override the default browser alert when the receiver cannot open the EPG. */
|
|
89
|
-
onProgramGuideUnavailable?: AribProgramGuideUnavailableHandler;
|
|
90
|
-
/** Receiver identity/capabilities exposed to the broadcast application. */
|
|
91
|
-
systemInformation?: ReceiverSystemInformationOverrides;
|
|
92
|
-
/** Resolve receiver/CAS identifiers; defaults to the bundled Huggy demo identity. */
|
|
93
|
-
getDeviceIdentifier?: ReceiverDeviceIdentifierProvider;
|
|
94
|
-
/** Receiver UI hook for a TR-B39 viewer-participation corner notification. */
|
|
95
|
-
onViewerParticipation?: (event: AribViewerParticipationEvent) => void;
|
|
96
|
-
};
|
|
8
|
+
export type { AribApplicationInformation, AribApplicationReplaceHandler, AribApplicationReplaceRequest, AribBroadcastClock, AribCaptionPacket, AribCaptionSubscription, AribExitManagedStateHandler, AribReceiverHostOptions, AribReceiverLifecycleEvent, } from './receiver/types';
|
|
97
9
|
export declare class AribReceiverHost {
|
|
98
10
|
readonly iframe: HTMLIFrameElement;
|
|
99
11
|
readonly viewport: HTMLElement;
|
|
@@ -120,21 +32,15 @@ export declare class AribReceiverHost {
|
|
|
120
32
|
private readonly getDeviceIdentifier?;
|
|
121
33
|
private readonly onViewerParticipation?;
|
|
122
34
|
private readonly viewerParticipation;
|
|
123
|
-
private readonly
|
|
124
|
-
private
|
|
125
|
-
private logicalWidth;
|
|
126
|
-
private logicalHeight;
|
|
35
|
+
private readonly canvas;
|
|
36
|
+
private readonly runtimeSession;
|
|
127
37
|
private captionComponentTags;
|
|
128
38
|
private applicationInformation;
|
|
129
39
|
private programInfo;
|
|
130
|
-
private readonly pendingStreamEvents;
|
|
131
40
|
private broadcastClock;
|
|
132
|
-
private lctBackgroundColor;
|
|
133
|
-
private stageBackgroundColor;
|
|
134
41
|
private video;
|
|
135
42
|
private mediaPlaneEnabled;
|
|
136
43
|
private applicationExited;
|
|
137
|
-
private applicationLoadTimer;
|
|
138
44
|
private destroyed;
|
|
139
45
|
constructor(options: AribReceiverHostOptions);
|
|
140
46
|
installRuntime(target: RuntimeWindow): void;
|
|
@@ -184,13 +90,8 @@ export declare class AribReceiverHost {
|
|
|
184
90
|
private readonly reportProgramGuideUnavailable;
|
|
185
91
|
private readonly handleRuntimeMessage;
|
|
186
92
|
private applyMediaPlane;
|
|
187
|
-
private readMediaLayer;
|
|
188
|
-
private postToRuntime;
|
|
189
|
-
private armApplicationLoadTimer;
|
|
190
93
|
private failApplicationLoad;
|
|
191
|
-
private clearApplicationLoadTimer;
|
|
192
94
|
private invalidateRuntime;
|
|
193
|
-
private
|
|
95
|
+
private disableRuntime;
|
|
194
96
|
private assertAlive;
|
|
195
|
-
private applyReceiverBackgroundColor;
|
|
196
97
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type AribPermissionBit, type RuntimePermissionManagedArea } from './application-boundary';
|
|
2
|
+
type RuntimeWindow = Window & typeof globalThis & Record<string, unknown>;
|
|
3
|
+
export type RuntimeApplicationInformation = {
|
|
4
|
+
type?: string;
|
|
5
|
+
organizationId?: number;
|
|
6
|
+
applicationId?: number;
|
|
7
|
+
controlCode?: string;
|
|
8
|
+
autostartPriority?: number;
|
|
9
|
+
/** Decoded loops from MH-AIT descriptor 0x802C. Omit when absent. */
|
|
10
|
+
permissionManagedAreas?: readonly RuntimePermissionManagedArea[];
|
|
11
|
+
};
|
|
12
|
+
type RuntimeApplicationControllerOptions = {
|
|
13
|
+
target: RuntimeWindow;
|
|
14
|
+
broadcastBaseUrl: string | URL;
|
|
15
|
+
resolveRuntimeUrl: (value: unknown) => URL;
|
|
16
|
+
allowExternalNetwork: boolean;
|
|
17
|
+
application?: RuntimeApplicationInformation;
|
|
18
|
+
postRuntime: (event: string, detail?: Record<string, unknown>) => void;
|
|
19
|
+
};
|
|
20
|
+
/** Owns the application-manager, permission-boundary, and navigation state. */
|
|
21
|
+
export declare class RuntimeApplicationController {
|
|
22
|
+
private readonly target;
|
|
23
|
+
private readonly resolveRuntimeUrl;
|
|
24
|
+
private readonly allowExternalNetwork;
|
|
25
|
+
private readonly postRuntime;
|
|
26
|
+
private readonly boundary;
|
|
27
|
+
private applicationInformation;
|
|
28
|
+
private applicationVisible;
|
|
29
|
+
private applicationInputActive;
|
|
30
|
+
private navigationCaptureInstalled;
|
|
31
|
+
private readonly keySet;
|
|
32
|
+
private readonly boundaryDescriptor;
|
|
33
|
+
private readonly ownerApplication;
|
|
34
|
+
constructor(options: RuntimeApplicationControllerOptions);
|
|
35
|
+
requirePermission(bit: AribPermissionBit): void;
|
|
36
|
+
permits(bit: AribPermissionBit): boolean;
|
|
37
|
+
updateApplicationInformation(value: RuntimeApplicationInformation): boolean;
|
|
38
|
+
setHostInputActive(active: boolean): void;
|
|
39
|
+
startDocument(): void;
|
|
40
|
+
startNavigationCapture(): void;
|
|
41
|
+
dispose(): void;
|
|
42
|
+
private applyApplicationVisibility;
|
|
43
|
+
private reportApplicationPresentation;
|
|
44
|
+
private reportBlockedNavigation;
|
|
45
|
+
private allowedNavigationUrl;
|
|
46
|
+
private readonly handleDocumentClick;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type RuntimeCaptionControllerOptions = {
|
|
2
|
+
requirePermission: () => void;
|
|
3
|
+
postRuntime: (event: string, detail?: Record<string, unknown>) => void;
|
|
4
|
+
};
|
|
5
|
+
type RuntimeCaptionMessage = {
|
|
6
|
+
event?: unknown;
|
|
7
|
+
componentTags?: Iterable<unknown> | null;
|
|
8
|
+
componentTag?: unknown;
|
|
9
|
+
payload?: unknown;
|
|
10
|
+
dataType?: unknown;
|
|
11
|
+
tmd?: unknown;
|
|
12
|
+
data?: unknown;
|
|
13
|
+
};
|
|
14
|
+
/** Owns the document-side caption tracks, subscriptions, and broadcast object API. */
|
|
15
|
+
export declare class RuntimeCaptionController {
|
|
16
|
+
private readonly requirePermission;
|
|
17
|
+
private readonly postRuntime;
|
|
18
|
+
private readonly tracks;
|
|
19
|
+
private readonly listeners;
|
|
20
|
+
constructor(options: RuntimeCaptionControllerOptions);
|
|
21
|
+
readonly installBroadcastObjectApi: (element: HTMLElement) => void;
|
|
22
|
+
/** Handle a host caption event; return false when it belongs to another subsystem. */
|
|
23
|
+
handleHostMessage(message: RuntimeCaptionMessage): boolean;
|
|
24
|
+
private componentTag;
|
|
25
|
+
private reportSubscriptions;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AribMediaPlaneStackEntry } from '../media-plane';
|
|
2
|
+
type RuntimeWindow = Window & typeof globalThis;
|
|
3
|
+
/**
|
|
4
|
+
* Temporarily clears the DOM paint that covers an externally composed media
|
|
5
|
+
* plane and restores the exact inline values when the slot changes or exits.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExternalMediaHoleController {
|
|
8
|
+
private readonly target;
|
|
9
|
+
private readonly placeholderOpacities;
|
|
10
|
+
private readonly backgrounds;
|
|
11
|
+
constructor(target: RuntimeWindow);
|
|
12
|
+
set(object: HTMLElement, enabled: boolean): void;
|
|
13
|
+
restore(): void;
|
|
14
|
+
/** Read application styles while temporarily exposing backgrounds hidden for external video. */
|
|
15
|
+
withApplicationBackgrounds<T>(callback: () => T): T;
|
|
16
|
+
describeStackingPath(object: HTMLElement): AribMediaPlaneStackEntry[];
|
|
17
|
+
private hasTransparentBackground;
|
|
18
|
+
private placeholderElements;
|
|
19
|
+
private setPlaceholder;
|
|
20
|
+
private restorePlaceholder;
|
|
21
|
+
private restorePlaceholders;
|
|
22
|
+
private restoreBackground;
|
|
23
|
+
private applyBackground;
|
|
24
|
+
private captureApplicationBackgroundChanges;
|
|
25
|
+
private clearBackground;
|
|
26
|
+
private restoreBackgrounds;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type ExternalNetworkTarget = Window & typeof globalThis;
|
|
2
|
+
/**
|
|
3
|
+
* Make the receiver's optional external HTTP communication path fail fast while
|
|
4
|
+
* preserving same-origin access to receiver-managed broadcast resources.
|
|
5
|
+
*/
|
|
6
|
+
export declare function installExternalNetworkPolicy(target: ExternalNetworkTarget, allowExternalNetwork: boolean | undefined): void;
|
|
7
|
+
export {};
|
|
@@ -3,10 +3,11 @@ import type { AribMediaPlaneAdapter } from '../media-plane';
|
|
|
3
3
|
import { type BroadcastResourceStore } from './resources';
|
|
4
4
|
import { type ReceiverSystemInformationOverrides } from './system-information';
|
|
5
5
|
import { type ReceiverDeviceIdentifierProvider } from '../device-identifier';
|
|
6
|
-
import { type
|
|
6
|
+
import { type RuntimeApplicationInformation } from './application-controller';
|
|
7
7
|
export type { ProgramInfo } from '../program-info';
|
|
8
8
|
export type { RuntimeEvent, RuntimeEventSelector, RuntimeEventSource, } from './stream-event';
|
|
9
9
|
export type { AribPermissionManagedArea, RuntimePermissionManagedArea, } from './application-boundary';
|
|
10
|
+
export type { RuntimeApplicationInformation } from './application-controller';
|
|
10
11
|
export type RuntimeWindow = Window & typeof globalThis & Record<string, unknown>;
|
|
11
12
|
export type RuntimeOptions = {
|
|
12
13
|
/** Permit HTTP requests outside the receiver-managed application origin. */
|
|
@@ -26,13 +27,4 @@ export type RuntimeOptions = {
|
|
|
26
27
|
/** MH-AIT metadata for the application which owns this document. */
|
|
27
28
|
application?: RuntimeApplicationInformation;
|
|
28
29
|
};
|
|
29
|
-
export type RuntimeApplicationInformation = {
|
|
30
|
-
type?: string;
|
|
31
|
-
organizationId?: number;
|
|
32
|
-
applicationId?: number;
|
|
33
|
-
controlCode?: string;
|
|
34
|
-
autostartPriority?: number;
|
|
35
|
-
/** Decoded loops from MH-AIT descriptor 0x802C. Omit when absent. */
|
|
36
|
-
permissionManagedAreas?: readonly RuntimePermissionManagedArea[];
|
|
37
|
-
};
|
|
38
30
|
export declare function installRuntime(target: RuntimeWindow, options?: RuntimeOptions): void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AribMediaPlaneAdapter, AribMediaPlaneUnmountReason } from '../media-plane';
|
|
2
|
+
type RuntimeWindow = Window & typeof globalThis;
|
|
3
|
+
type RuntimeMediaPlaneControllerOptions = {
|
|
4
|
+
target: RuntimeWindow;
|
|
5
|
+
adapter?: AribMediaPlaneAdapter;
|
|
6
|
+
canUseBroadcastMedia: () => boolean;
|
|
7
|
+
installBroadcastObjectApi: (object: HTMLElement) => void;
|
|
8
|
+
postRuntime: (event: string, detail?: Record<string, unknown>) => void;
|
|
9
|
+
};
|
|
10
|
+
/** Owns the document-side media-plane observation and compositor lifecycle. */
|
|
11
|
+
export declare class RuntimeMediaPlaneController {
|
|
12
|
+
private readonly target;
|
|
13
|
+
private readonly adapter?;
|
|
14
|
+
private readonly canUseBroadcastMedia;
|
|
15
|
+
private readonly installBroadcastObjectApi;
|
|
16
|
+
private readonly postRuntime;
|
|
17
|
+
private readonly mediaObjectIds;
|
|
18
|
+
private readonly externalMediaHole;
|
|
19
|
+
private readonly resizeObserver;
|
|
20
|
+
private applicationCanvasStyle;
|
|
21
|
+
private mutationObserver;
|
|
22
|
+
private nextMediaObjectId;
|
|
23
|
+
private activeMediaObject;
|
|
24
|
+
private lastMediaPlane;
|
|
25
|
+
private lastStageBackgroundColor;
|
|
26
|
+
private observedMediaObject;
|
|
27
|
+
private mediaPlaneFrame;
|
|
28
|
+
private observing;
|
|
29
|
+
private disposed;
|
|
30
|
+
constructor(options: RuntimeMediaPlaneControllerOptions);
|
|
31
|
+
/** Install APIs needed by static objects, prepare the canvas, and queue a report. */
|
|
32
|
+
startDocument(): void;
|
|
33
|
+
/** Start document observers after the runtime's installed handshake was sent. */
|
|
34
|
+
startObserving(): void;
|
|
35
|
+
readonly schedule: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Stop observation, run document-owned cleanup, then restore and unmount the
|
|
38
|
+
* media plane. The cleanup hook preserves the original pagehide ordering.
|
|
39
|
+
*/
|
|
40
|
+
dispose(reason: Extract<AribMediaPlaneUnmountReason, 'document-unload'>, beforeUnmount?: () => void): void;
|
|
41
|
+
private findMediaObject;
|
|
42
|
+
private reportStageStyle;
|
|
43
|
+
private prepareExternalMediaPlaneCanvas;
|
|
44
|
+
private withApplicationCanvasBackgrounds;
|
|
45
|
+
private observeDocumentMutations;
|
|
46
|
+
private activeMediaAnimation;
|
|
47
|
+
private observeMediaObject;
|
|
48
|
+
private logicalViewport;
|
|
49
|
+
private slotIdFor;
|
|
50
|
+
private callMediaPlaneAdapter;
|
|
51
|
+
private unmountMediaPlane;
|
|
52
|
+
private reportMediaPlane;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
@@ -1,84 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
data: Uint8Array | ArrayBuffer;
|
|
5
|
-
};
|
|
6
|
-
export type ServiceWorkerBroadcastVfsOptions = {
|
|
7
|
-
workerUrl: string | URL;
|
|
8
|
-
/** Same-origin scope used to expose broadcast files. */
|
|
9
|
-
baseUrl?: string | URL;
|
|
10
|
-
/** Compatibility fallback for applications which omit a carousel directory. */
|
|
11
|
-
uniqueBasenameFallback?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export type BroadcastVfsBackend = {
|
|
14
|
-
begin(): Promise<void>;
|
|
15
|
-
put(resource: BroadcastVfsResource): Promise<void>;
|
|
16
|
-
canRead(path: string): Promise<boolean>;
|
|
17
|
-
};
|
|
18
|
-
export type BroadcastVfsSessionOptions = {
|
|
19
|
-
/** Report background write failures; ensure() still rejects to its caller. */
|
|
20
|
-
onError?: (error: unknown) => void;
|
|
21
|
-
/** Override background scheduling, primarily for embedded hosts and tests. */
|
|
22
|
-
schedule?: (task: () => void) => void;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Ordered, recoverable write session above a VFS backend. enqueue() copies
|
|
26
|
-
* callback-lifetime data synchronously and returns a revision barrier.
|
|
27
|
-
*/
|
|
28
|
-
export declare class BroadcastVfsSession {
|
|
29
|
-
private readonly backend;
|
|
30
|
-
private readonly onError?;
|
|
31
|
-
private readonly scheduleTask;
|
|
32
|
-
private readonly mirror;
|
|
33
|
-
private readonly queue;
|
|
34
|
-
private waiters;
|
|
35
|
-
private generation;
|
|
36
|
-
private nextRevision;
|
|
37
|
-
private completedRevision;
|
|
38
|
-
private drainScheduled;
|
|
39
|
-
private ioTail;
|
|
40
|
-
private sessionReady;
|
|
41
|
-
private disposed;
|
|
42
|
-
constructor(backend: BroadcastVfsBackend, options?: BroadcastVfsSessionOptions);
|
|
43
|
-
beginSession(): Promise<void>;
|
|
44
|
-
enqueue(resource: BroadcastVfsResource): number;
|
|
45
|
-
waitFor(revision: number): Promise<void>;
|
|
46
|
-
/** Ensure a staged path is readable, replaying the page-owned mirror if needed. */
|
|
47
|
-
ensure(path: string, revision?: number): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Stop accepting resources, discard queued writes, and wait for the one
|
|
50
|
-
* backend operation which may already be running. The backend itself remains
|
|
51
|
-
* owned by the caller and can be reset or disposed after this resolves.
|
|
52
|
-
*/
|
|
53
|
-
dispose(): Promise<void>;
|
|
54
|
-
private appendIo;
|
|
55
|
-
private scheduleDrain;
|
|
56
|
-
private drainOne;
|
|
57
|
-
private resolveWaiters;
|
|
58
|
-
}
|
|
59
|
-
export declare class ServiceWorkerBroadcastVfs {
|
|
60
|
-
private readonly workerUrl;
|
|
61
|
-
private readonly scopeUrl;
|
|
62
|
-
private readonly uniqueBasenameFallback;
|
|
63
|
-
private registration;
|
|
64
|
-
private ready;
|
|
65
|
-
private readonly inFlight;
|
|
66
|
-
private disposing;
|
|
67
|
-
private disposed;
|
|
68
|
-
constructor(options: ServiceWorkerBroadcastVfsOptions);
|
|
69
|
-
initialize(): Promise<ServiceWorkerRegistration>;
|
|
70
|
-
begin(): Promise<void>;
|
|
71
|
-
put(resource: BroadcastVfsResource): Promise<void>;
|
|
72
|
-
canRead(path: string): Promise<boolean>;
|
|
73
|
-
reset(): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Clear the receiver-owned VFS session after outstanding requests finish.
|
|
76
|
-
* The shared Service Worker registration is intentionally retained so other
|
|
77
|
-
* tabs and future receiver instances keep a stable scoped fetch handler.
|
|
78
|
-
*/
|
|
79
|
-
dispose(): Promise<void>;
|
|
80
|
-
private request;
|
|
81
|
-
private performRequest;
|
|
82
|
-
private performRequestWithRegistration;
|
|
83
|
-
private waitForActivation;
|
|
84
|
-
}
|
|
1
|
+
export { BroadcastVfsSession } from './vfs/session.js';
|
|
2
|
+
export { ServiceWorkerBroadcastVfs } from './vfs/service-worker-backend.js';
|
|
3
|
+
export type { BroadcastVfsBackend, BroadcastVfsResource, BroadcastVfsSessionOptions, ServiceWorkerBroadcastVfsOptions, } from './vfs/types.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BroadcastVfsResource, ServiceWorkerBroadcastVfsOptions } from './types.js';
|
|
2
|
+
export declare class ServiceWorkerBroadcastVfs {
|
|
3
|
+
private readonly workerUrl;
|
|
4
|
+
private readonly scopeUrl;
|
|
5
|
+
private readonly uniqueBasenameFallback;
|
|
6
|
+
private registration;
|
|
7
|
+
private ready;
|
|
8
|
+
private readonly inFlight;
|
|
9
|
+
private disposing;
|
|
10
|
+
private disposed;
|
|
11
|
+
constructor(options: ServiceWorkerBroadcastVfsOptions);
|
|
12
|
+
initialize(): Promise<ServiceWorkerRegistration>;
|
|
13
|
+
begin(): Promise<void>;
|
|
14
|
+
put(resource: BroadcastVfsResource): Promise<void>;
|
|
15
|
+
canRead(path: string): Promise<boolean>;
|
|
16
|
+
reset(): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Clear the receiver-owned VFS session after outstanding requests finish.
|
|
19
|
+
* The shared Service Worker registration is intentionally retained so other
|
|
20
|
+
* tabs and future receiver instances keep a stable scoped fetch handler.
|
|
21
|
+
*/
|
|
22
|
+
dispose(): Promise<void>;
|
|
23
|
+
private request;
|
|
24
|
+
private performRequest;
|
|
25
|
+
private performRequestWithRegistration;
|
|
26
|
+
private waitForActivation;
|
|
27
|
+
}
|