libaribhtml5 0.1.4 → 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/README.md +115 -57
- package/dist/sdk/arib-vfs-sw.js +4 -0
- package/dist/sdk/libaribhtml5.js +10 -10
- package/dist/sdk/libaribhtml5.mjs +1609 -984
- package/dist/types/device-identifier.d.ts +3 -0
- package/dist/types/iframe-input.d.ts +4 -0
- package/dist/types/index.d.ts +6 -2
- package/dist/types/layout.d.ts +7 -0
- 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 +25 -103
- package/dist/types/runtime/application-boundary.d.ts +45 -0
- 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 +3 -7
- package/dist/types/runtime/media-plane-runtime.d.ts +54 -0
- package/dist/types/runtime/platform.d.ts +4 -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/dist/types/viewer-participation.d.ts +29 -0
- package/docs/application-lifecycle.md +34 -0
- package/docs/browser-iframe-compositing.md +20 -0
- package/docs/images/bs8k-caption-dialog.webp +0 -0
- package/docs/images/bs8k-data-broadcast-home.webp +0 -0
- package/docs/images/bs8k-message-removal.webp +0 -0
- package/docs/images/bs8k-usage-survey.webp +0 -0
- package/docs/media-plane-integration.md +23 -0
- package/docs/receiver-compatibility-roadmap.md +300 -0
- package/package.json +3 -2
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/** Current demo receiver identifier (48-bit hexadecimal ACAS source value). */
|
|
2
2
|
export declare const DEFAULT_RECEIVER_DEVICE_IDENTIFIER = "4194c4ae4730";
|
|
3
|
+
/** Legacy BML browser.getIRDID() type used for the receiver/CAS identifier. */
|
|
4
|
+
export declare const RECEIVER_IRD_ID_TYPE = 5;
|
|
5
|
+
export declare function getDefaultReceiverIrdId(type: number): string | null;
|
|
3
6
|
export type ReceiverDeviceIdentifierProvider = (kind: number) => string | null | undefined | Promise<string | null | undefined>;
|
|
4
7
|
export declare function resolveReceiverDeviceIdentifier(kind: number, provider?: ReceiverDeviceIdentifierProvider): Promise<string>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
type PointerTransparentIframe = Pick<HTMLIFrameElement, 'inert' | 'style' | 'tabIndex'>;
|
|
2
|
+
/** Keep the application plane visible without making it an input or focus target. */
|
|
3
|
+
export declare function makeIframePointerTransparent(iframe: PointerTransparentIframe): void;
|
|
4
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { AribReceiverHost } from './receiver-host';
|
|
2
2
|
export type { AribApplicationInformation, AribApplicationReplaceHandler, AribApplicationReplaceRequest, AribCaptionPacket, AribBroadcastClock, AribExitManagedStateHandler, AribReceiverLifecycleEvent, AribReceiverHostOptions, } from './receiver-host';
|
|
3
|
+
export type { AribApplicationPresentationState, AribViewerParticipationEvent, AribViewerParticipationNotification, } from './viewer-participation';
|
|
3
4
|
export { BehindIframeMediaPlaneAdapter, DomObjectMediaPlaneAdapter, } from './media-plane';
|
|
4
5
|
export type { AribMediaPlane, AribMediaPlaneAdapter, AribMediaPlaneLayer, AribMediaPlaneStackEntry, AribMediaPlaneUnmountReason, AribVideoPlane, BehindIframeMediaPlaneAdapterOptions, DomObjectMediaPlaneAdapterOptions, } from './media-plane';
|
|
5
6
|
export { installRuntime } from './runtime/install';
|
|
@@ -9,9 +10,12 @@ export { cloneProgramInfo } from './program-info';
|
|
|
9
10
|
export type { ProgramInfo } from './program-info';
|
|
10
11
|
export { runtimeEventMatchesSelector } from './runtime/stream-event';
|
|
11
12
|
export type { RuntimeEvent, RuntimeEventSelector, RuntimeEventSource, } from './runtime/stream-event';
|
|
12
|
-
export type { RuntimeApplicationInformation, RuntimeOptions, RuntimeWindow, } from './runtime/install';
|
|
13
|
-
export {
|
|
13
|
+
export type { AribPermissionManagedArea, RuntimeApplicationInformation, RuntimePermissionManagedArea, RuntimeOptions, RuntimeWindow, } from './runtime/install';
|
|
14
|
+
export { ARIB_PERMISSION_BITS, AribApplicationBoundaryPolicy, } from './runtime/application-boundary';
|
|
15
|
+
export type { AribPermissionBit, AribPermissionEvaluation, } from './runtime/application-boundary';
|
|
16
|
+
export { DEFAULT_RECEIVER_DEVICE_IDENTIFIER, getDefaultReceiverIrdId, RECEIVER_IRD_ID_TYPE, resolveReceiverDeviceIdentifier, } from './device-identifier';
|
|
14
17
|
export type { ReceiverDeviceIdentifierProvider } from './device-identifier';
|
|
18
|
+
export { normalizeLctBackgroundColor } from './layout';
|
|
15
19
|
export type { BroadcastResourceCacheEvent, BroadcastResourceCacheListener, BroadcastResourceChange, BroadcastResourceStore, } from './runtime/resources';
|
|
16
20
|
export { installBroadcastClock } from './runtime/clock';
|
|
17
21
|
export type { BroadcastNowProvider } from './runtime/clock';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert the ARIB STD-B60 24-bit LCT background colour to a CSS colour.
|
|
3
|
+
* A null value removes the current LCT override and restores host fallback
|
|
4
|
+
* selection.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeLctBackgroundColor(value: number | null): string | null;
|
|
7
|
+
export declare function resolveReceiverBackgroundColor(lctColor: string | null, stageColor: string | null): string;
|
|
@@ -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,96 +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';
|
|
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';
|
|
8
7
|
export type { AribMediaPlane, AribMediaPlaneAdapter, AribMediaPlaneLayer, AribMediaPlaneStackEntry, AribMediaPlaneUnmountReason, AribVideoPlane, } from './media-plane';
|
|
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 = {
|
|
21
|
-
organizationId: number;
|
|
22
|
-
applicationId: number;
|
|
23
|
-
aitUrl: string | null;
|
|
24
|
-
};
|
|
25
|
-
export type AribApplicationReplaceHandler = (request: AribApplicationReplaceRequest) => void | Promise<void>;
|
|
26
|
-
export type AribExitManagedStateHandler = (url: string) => void | Promise<void>;
|
|
27
|
-
export type AribBroadcastClock = {
|
|
28
|
-
/** Absolute broadcast time at the anchor, as Unix epoch milliseconds. */
|
|
29
|
-
epochMilliseconds: number;
|
|
30
|
-
/** Media timeline value which corresponds to epochMilliseconds. */
|
|
31
|
-
mediaTimeSeconds?: number;
|
|
32
|
-
/** Current playback position; enables pause, rate, and seek aware projection. */
|
|
33
|
-
currentMediaTimeSeconds?: () => number;
|
|
34
|
-
};
|
|
35
|
-
export type AribReceiverLifecycleEvent = {
|
|
36
|
-
type: 'loading';
|
|
37
|
-
url: string;
|
|
38
|
-
} | {
|
|
39
|
-
type: 'installed';
|
|
40
|
-
url: string;
|
|
41
|
-
runtimeId: string;
|
|
42
|
-
} | {
|
|
43
|
-
type: 'navigating';
|
|
44
|
-
url: string;
|
|
45
|
-
} | {
|
|
46
|
-
type: 'exited';
|
|
47
|
-
} | {
|
|
48
|
-
type: 'navigation-blocked';
|
|
49
|
-
url: string;
|
|
50
|
-
} | {
|
|
51
|
-
type: 'frame-blocked';
|
|
52
|
-
url: string;
|
|
53
|
-
} | {
|
|
54
|
-
type: 'error';
|
|
55
|
-
message: string;
|
|
56
|
-
};
|
|
57
|
-
export type AribReceiverHostOptions = {
|
|
58
|
-
iframe: HTMLIFrameElement;
|
|
59
|
-
viewport: HTMLElement;
|
|
60
|
-
/** Surface used only by the behind-iframe compatibility adapter. */
|
|
61
|
-
videoSurface?: HTMLElement;
|
|
62
|
-
mediaPlaneAdapter?: AribMediaPlaneAdapter;
|
|
63
|
-
onStatus?: (status: string) => void;
|
|
64
|
-
/** Machine-readable application/runtime lifecycle; never branch on onStatus text. */
|
|
65
|
-
onLifecycle?: (event: AribReceiverLifecycleEvent) => void;
|
|
66
|
-
/** Time to wait for a loaded document to install the receiver runtime. 0 disables the fallback. */
|
|
67
|
-
applicationLoadTimeoutMs?: number;
|
|
68
|
-
onUrlChange?: (url: string) => void;
|
|
69
|
-
onMediaPlane?: (plane: AribMediaPlane) => void;
|
|
70
|
-
/** @deprecated Use onMediaPlane. */
|
|
71
|
-
onVideoPlane?: (plane: AribMediaPlane) => void;
|
|
72
|
-
keepVideoVisible?: boolean;
|
|
73
|
-
/** Allow broadcaster applications to use HTTP origins outside this host. */
|
|
74
|
-
allowExternalNetwork?: boolean;
|
|
75
|
-
/** Same-origin namespace where a Worker or HTTP server exposes carousel data. */
|
|
76
|
-
broadcastBaseUrl?: string | URL;
|
|
77
|
-
/** Optional bridge to a Service Worker, Cache Storage, or carousel VFS. */
|
|
78
|
-
resourceStore?: BroadcastResourceStore;
|
|
79
|
-
/** Receiver/WebView bridge which opens the native EPG or a program detail page. */
|
|
80
|
-
onOpenProgramGuide?: AribProgramGuideHandler;
|
|
81
|
-
/** Active caption components requested by the current broadcast document. */
|
|
82
|
-
onCaptionSubscription?: (subscription: AribCaptionSubscription) => void;
|
|
83
|
-
/** Resolve Application.replaceApplication() through the receiver's current MH-AIT. */
|
|
84
|
-
onReplaceApplication?: AribApplicationReplaceHandler;
|
|
85
|
-
/** Transfer an application to an unmanaged general-application URL. */
|
|
86
|
-
onExitManagedState?: AribExitManagedStateHandler;
|
|
87
|
-
/** Override the default browser alert when the receiver cannot open the EPG. */
|
|
88
|
-
onProgramGuideUnavailable?: AribProgramGuideUnavailableHandler;
|
|
89
|
-
/** Receiver identity/capabilities exposed to the broadcast application. */
|
|
90
|
-
systemInformation?: ReceiverSystemInformationOverrides;
|
|
91
|
-
/** Resolve receiver/CAS identifiers; defaults to the bundled Huggy demo identity. */
|
|
92
|
-
getDeviceIdentifier?: ReceiverDeviceIdentifierProvider;
|
|
93
|
-
};
|
|
8
|
+
export type { AribApplicationInformation, AribApplicationReplaceHandler, AribApplicationReplaceRequest, AribBroadcastClock, AribCaptionPacket, AribCaptionSubscription, AribExitManagedStateHandler, AribReceiverHostOptions, AribReceiverLifecycleEvent, } from './receiver/types';
|
|
94
9
|
export declare class AribReceiverHost {
|
|
95
10
|
readonly iframe: HTMLIFrameElement;
|
|
96
11
|
readonly viewport: HTMLElement;
|
|
@@ -115,30 +30,41 @@ export declare class AribReceiverHost {
|
|
|
115
30
|
private readonly onProgramGuideUnavailable?;
|
|
116
31
|
private readonly systemInformation?;
|
|
117
32
|
private readonly getDeviceIdentifier?;
|
|
118
|
-
private readonly
|
|
119
|
-
private
|
|
120
|
-
private
|
|
121
|
-
private
|
|
33
|
+
private readonly onViewerParticipation?;
|
|
34
|
+
private readonly viewerParticipation;
|
|
35
|
+
private readonly canvas;
|
|
36
|
+
private readonly runtimeSession;
|
|
122
37
|
private captionComponentTags;
|
|
123
38
|
private applicationInformation;
|
|
124
39
|
private programInfo;
|
|
125
|
-
private readonly pendingStreamEvents;
|
|
126
40
|
private broadcastClock;
|
|
127
41
|
private video;
|
|
128
42
|
private mediaPlaneEnabled;
|
|
129
43
|
private applicationExited;
|
|
130
|
-
private applicationLoadTimer;
|
|
131
44
|
private destroyed;
|
|
132
45
|
constructor(options: AribReceiverHostOptions);
|
|
133
46
|
installRuntime(target: RuntimeWindow): void;
|
|
134
47
|
/** Set the MH-AIT identity exposed by applicationManager.getOwnerApplication(). */
|
|
135
48
|
setApplicationInformation(application: AribApplicationInformation | null): void;
|
|
49
|
+
/**
|
|
50
|
+
* Set the receiver-owned background plane from the current LCT
|
|
51
|
+
* Background_Color_Descriptor. Pass null when changing service/session or
|
|
52
|
+
* when the active LCT no longer carries the descriptor.
|
|
53
|
+
*/
|
|
54
|
+
setLctBackgroundColor(backgroundColorRgb: number | null): void;
|
|
136
55
|
/** @deprecated Pass an AribMediaPlaneAdapter to the constructor. */
|
|
137
56
|
attachVideo(video: HTMLVideoElement): void;
|
|
138
57
|
loadApplication(url: string, status?: string): void;
|
|
139
58
|
/** Leave data-broadcast mode and restore media to the ordinary player. */
|
|
140
59
|
exitApplication(status?: string): void;
|
|
141
|
-
dispatchKey(code: number):
|
|
60
|
+
dispatchKey(code: number): boolean;
|
|
61
|
+
/** Transfer or release receiver-key ownership for the broadcast application. */
|
|
62
|
+
setApplicationInputActive(active: boolean): void;
|
|
63
|
+
getApplicationPresentationState(): AribApplicationPresentationState;
|
|
64
|
+
/** Handle the descriptor-less TR-B39 receiver notification outside the application. */
|
|
65
|
+
notifyViewerParticipationCorner(notification: AribViewerParticipationNotification): void;
|
|
66
|
+
/** Discard notification versions while changing service or playback session. */
|
|
67
|
+
resetViewerParticipationNotifications(): void;
|
|
142
68
|
setCaptionTracks(componentTags: number[]): void;
|
|
143
69
|
pushCaption(packet: AribCaptionPacket): void;
|
|
144
70
|
resetCaptions(): void;
|
|
@@ -164,12 +90,8 @@ export declare class AribReceiverHost {
|
|
|
164
90
|
private readonly reportProgramGuideUnavailable;
|
|
165
91
|
private readonly handleRuntimeMessage;
|
|
166
92
|
private applyMediaPlane;
|
|
167
|
-
private readMediaLayer;
|
|
168
|
-
private postToRuntime;
|
|
169
|
-
private armApplicationLoadTimer;
|
|
170
93
|
private failApplicationLoad;
|
|
171
|
-
private clearApplicationLoadTimer;
|
|
172
94
|
private invalidateRuntime;
|
|
173
|
-
private
|
|
95
|
+
private disableRuntime;
|
|
174
96
|
private assertAlive;
|
|
175
97
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const ARIB_PERMISSION_BITS: {
|
|
2
|
+
readonly broadcastMedia: 12;
|
|
3
|
+
readonly monomediaOverBroadcastVideo: 11;
|
|
4
|
+
readonly currentEventInformation: 10;
|
|
5
|
+
readonly persistentStorage: 9;
|
|
6
|
+
readonly boundaryExtension: 8;
|
|
7
|
+
readonly deviceIdentifier: 7;
|
|
8
|
+
readonly ipNetworkConfirmation: 6;
|
|
9
|
+
readonly broadcastResources: 5;
|
|
10
|
+
readonly scheduling: 4;
|
|
11
|
+
readonly cas: 3;
|
|
12
|
+
};
|
|
13
|
+
export type AribPermissionBit = typeof ARIB_PERMISSION_BITS[keyof typeof ARIB_PERMISSION_BITS];
|
|
14
|
+
/** One loop of the MH-application boundary and permission descriptor. */
|
|
15
|
+
export type RuntimePermissionManagedArea = {
|
|
16
|
+
/** Raw 16-bit permission_bitmap values, including the three-bit bitmap id. */
|
|
17
|
+
permissionBitmaps: readonly number[] | null;
|
|
18
|
+
/** managed_URL values. null or an empty array means all locations. */
|
|
19
|
+
managedUrls: readonly string[] | null;
|
|
20
|
+
};
|
|
21
|
+
/** Shape exposed by ApplicationBoundaryAndPermissionDescriptor in ARIB STD-B62. */
|
|
22
|
+
export type AribPermissionManagedArea = {
|
|
23
|
+
/** Raw 16-bit permission_bitmap values, or null for maximum permission. */
|
|
24
|
+
permission: number[] | null;
|
|
25
|
+
/** Managed URL strings, or null for all locations. */
|
|
26
|
+
urls: string[] | null;
|
|
27
|
+
};
|
|
28
|
+
export type AribPermissionEvaluation = {
|
|
29
|
+
withinBoundary: boolean;
|
|
30
|
+
permissionBits: number;
|
|
31
|
+
};
|
|
32
|
+
export declare class AribApplicationBoundaryPolicy {
|
|
33
|
+
private readonly broadcastBaseUrl;
|
|
34
|
+
private readonly documentUrl;
|
|
35
|
+
private baseAreas;
|
|
36
|
+
private readonly addedAreas;
|
|
37
|
+
constructor(broadcastBaseUrl: string | URL, documentUrl: string | URL, areas?: readonly RuntimePermissionManagedArea[]);
|
|
38
|
+
/** Apply a new MH-AIT descriptor without discarding areas added by the application. */
|
|
39
|
+
update(areas?: readonly RuntimePermissionManagedArea[]): void;
|
|
40
|
+
hasDescriptor(): boolean;
|
|
41
|
+
getCurrentBoundary(): AribPermissionManagedArea[];
|
|
42
|
+
addPermissionManagedArea(area: AribPermissionManagedArea): void;
|
|
43
|
+
evaluate(value: string | URL): AribPermissionEvaluation;
|
|
44
|
+
permits(value: string | URL, bit: AribPermissionBit): boolean;
|
|
45
|
+
}
|
|
@@ -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,8 +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 RuntimeApplicationInformation } from './application-controller';
|
|
6
7
|
export type { ProgramInfo } from '../program-info';
|
|
7
8
|
export type { RuntimeEvent, RuntimeEventSelector, RuntimeEventSource, } from './stream-event';
|
|
9
|
+
export type { AribPermissionManagedArea, RuntimePermissionManagedArea, } from './application-boundary';
|
|
10
|
+
export type { RuntimeApplicationInformation } from './application-controller';
|
|
8
11
|
export type RuntimeWindow = Window & typeof globalThis & Record<string, unknown>;
|
|
9
12
|
export type RuntimeOptions = {
|
|
10
13
|
/** Permit HTTP requests outside the receiver-managed application origin. */
|
|
@@ -24,11 +27,4 @@ export type RuntimeOptions = {
|
|
|
24
27
|
/** MH-AIT metadata for the application which owns this document. */
|
|
25
28
|
application?: RuntimeApplicationInformation;
|
|
26
29
|
};
|
|
27
|
-
export type RuntimeApplicationInformation = {
|
|
28
|
-
type?: string;
|
|
29
|
-
organizationId?: number;
|
|
30
|
-
applicationId?: number;
|
|
31
|
-
controlCode?: string;
|
|
32
|
-
autostartPriority?: number;
|
|
33
|
-
};
|
|
34
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 {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
type NavigatorPlatform = Pick<Navigator, 'maxTouchPoints' | 'platform' | 'userAgent'>;
|
|
2
|
+
/** iOS media elements can replace the receiver player's active media session. */
|
|
3
|
+
export declare function shouldSuppressRomSoundPlayback(navigator: NavigatorPlatform): boolean;
|
|
4
|
+
export {};
|