libaribhtml5 0.1.7 → 0.1.9

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.
@@ -0,0 +1,6 @@
1
+ /** Convert the receiver's 48-bit identifier to the 20-digit A-CAS number. */
2
+ export declare function encodeAcasNumber(receiverIdentifier: string): string;
3
+ /** Recover the 48-bit receiver identifier and reject an invalid checksum. */
4
+ export declare function decodeAcasNumber(acasNumber: string): string;
5
+ export declare function verifyAcasNumber(acasNumber: string): boolean;
6
+ export declare function formatAcasNumber(acasNumber: string): string;
@@ -14,6 +14,12 @@ export type ReceiverMediaPlaneFallback = {
14
14
  screenWidth: number;
15
15
  screenHeight: number;
16
16
  };
17
+ export type ReceiverCanvasSize = {
18
+ width: number;
19
+ height: number;
20
+ };
21
+ /** Normalize the untrusted logical canvas dimensions reported by the runtime. */
22
+ export declare function normalizeReceiverCanvasSize(message: RuntimeMessage): ReceiverCanvasSize | null;
17
23
  export declare function normalizeStageBackgroundColor(value: unknown): string | null;
18
24
  export declare function normalizeCaptionSubscriptionTags(value: unknown): number[];
19
25
  export declare function normalizeApplicationReplaceRequest(message: RuntimeMessage): AribApplicationReplaceRequest | null;
@@ -20,6 +20,8 @@ export type AribApplicationInformation = RuntimeApplicationInformation;
20
20
  export type { AribApplicationReplaceRequest } from './protocol';
21
21
  export type AribApplicationReplaceHandler = (request: AribApplicationReplaceRequest) => void | Promise<void>;
22
22
  export type AribExitManagedStateHandler = (url: string) => void | Promise<void>;
23
+ /** Return an HTML application to the receiver-owned BML data-broadcasting browser. */
24
+ export type AribLaunchDataBroadcastingBrowserHandler = () => void | Promise<void>;
23
25
  export type AribBroadcastClock = {
24
26
  /** Absolute broadcast time at the anchor, as Unix epoch milliseconds. */
25
27
  epochMilliseconds: number;
@@ -80,12 +82,18 @@ export type AribReceiverHostOptions = {
80
82
  onReplaceApplication?: AribApplicationReplaceHandler;
81
83
  /** Transfer an application to an unmanaged general-application URL. */
82
84
  onExitManagedState?: AribExitManagedStateHandler;
85
+ /** Return the current Hybridcast HTML application to its paired BML browser. */
86
+ onLaunchDataBroadcastingBrowser?: AribLaunchDataBroadcastingBrowserHandler;
83
87
  /** Override the default browser alert when the receiver cannot open the EPG. */
84
88
  onProgramGuideUnavailable?: AribProgramGuideUnavailableHandler;
85
89
  /** Receiver identity/capabilities exposed to the broadcast application. */
86
90
  systemInformation?: ReceiverSystemInformationOverrides;
87
91
  /** Resolve receiver/CAS identifiers; defaults to the bundled Huggy demo identity. */
88
92
  getDeviceIdentifier?: ReceiverDeviceIdentifierProvider;
93
+ /** Initial BML general registers exposed through navigator.bmlCompat. */
94
+ bmlGreg?: string[];
95
+ /** Optional user-agent string exposed only within the managed HTML runtime. */
96
+ userAgent?: string;
89
97
  /** Receiver UI hook for a TR-B39 viewer-participation corner notification. */
90
98
  onViewerParticipation?: (event: AribViewerParticipationEvent) => void;
91
99
  };
@@ -5,7 +5,7 @@ import { type AribProgramGuideRequest } from './program-guide';
5
5
  import { type AribApplicationPresentationState, type AribViewerParticipationNotification } from './viewer-participation';
6
6
  import type { AribApplicationInformation, AribBroadcastClock, AribCaptionPacket, AribReceiverHostOptions } from './receiver/types';
7
7
  export type { AribMediaPlane, AribMediaPlaneAdapter, AribMediaPlaneLayer, AribMediaPlaneStackEntry, AribMediaPlaneUnmountReason, AribVideoPlane, } from './media-plane';
8
- export type { AribApplicationInformation, AribApplicationReplaceHandler, AribApplicationReplaceRequest, AribBroadcastClock, AribCaptionPacket, AribCaptionSubscription, AribExitManagedStateHandler, AribReceiverHostOptions, AribReceiverLifecycleEvent, } from './receiver/types';
8
+ export type { AribApplicationInformation, AribApplicationReplaceHandler, AribApplicationReplaceRequest, AribBroadcastClock, AribCaptionPacket, AribCaptionSubscription, AribExitManagedStateHandler, AribLaunchDataBroadcastingBrowserHandler, AribReceiverHostOptions, AribReceiverLifecycleEvent, } from './receiver/types';
9
9
  export declare class AribReceiverHost {
10
10
  readonly iframe: HTMLIFrameElement;
11
11
  readonly viewport: HTMLElement;
@@ -27,9 +27,12 @@ export declare class AribReceiverHost {
27
27
  private readonly onCaptionSubscription?;
28
28
  private readonly onReplaceApplication?;
29
29
  private readonly onExitManagedState?;
30
+ private readonly onLaunchDataBroadcastingBrowser?;
30
31
  private readonly onProgramGuideUnavailable?;
31
32
  private readonly systemInformation?;
32
33
  private readonly getDeviceIdentifier?;
34
+ private readonly bmlGreg;
35
+ private readonly userAgent?;
33
36
  private readonly onViewerParticipation?;
34
37
  private readonly viewerParticipation;
35
38
  private readonly canvas;
@@ -44,6 +47,8 @@ export declare class AribReceiverHost {
44
47
  private destroyed;
45
48
  constructor(options: AribReceiverHostOptions);
46
49
  installRuntime(target: RuntimeWindow): void;
50
+ /** Replace BML general registers while retaining the active runtime reference. */
51
+ setBmlGreg(values: readonly string[]): void;
47
52
  /** Set the MH-AIT identity exposed by applicationManager.getOwnerApplication(). */
48
53
  setApplicationInformation(application: AribApplicationInformation | null): void;
49
54
  /**
@@ -26,5 +26,9 @@ export type RuntimeOptions = {
26
26
  getDeviceIdentifier?: ReceiverDeviceIdentifierProvider;
27
27
  /** MH-AIT metadata for the application which owns this document. */
28
28
  application?: RuntimeApplicationInformation;
29
+ /** Receiver-owned BML general registers shared with a paired BML engine. */
30
+ bmlGreg?: string[];
31
+ /** Optional receiver identity token exposed to HTML application feature detection. */
32
+ userAgent?: string;
29
33
  };
30
34
  export declare function installRuntime(target: RuntimeWindow, options?: RuntimeOptions): void;
@@ -22,6 +22,7 @@ export declare class RuntimeMediaPlaneController {
22
22
  private nextMediaObjectId;
23
23
  private activeMediaObject;
24
24
  private lastMediaPlane;
25
+ private lastScreenSize;
25
26
  private lastStageBackgroundColor;
26
27
  private observedMediaObject;
27
28
  private mediaPlaneFrame;
@@ -46,6 +47,7 @@ export declare class RuntimeMediaPlaneController {
46
47
  private activeMediaAnimation;
47
48
  private observeMediaObject;
48
49
  private logicalViewport;
50
+ private reportScreenSize;
49
51
  private slotIdFor;
50
52
  private callMediaPlaneAdapter;
51
53
  private unmountMediaPlane;
@@ -0,0 +1,8 @@
1
+ type TvReceiverIframe = Pick<HTMLIFrameElement, 'contentWindow' | 'inert' | 'style' | 'tabIndex'>;
2
+ /** Keep pointer input on the native TV shell without making the child document inert. */
3
+ export declare function configureTvReceiverIframe(iframe: TvReceiverIframe): void;
4
+ /** Dispatch a receiver key in the child browsing context that owns the application DOM. */
5
+ export declare function dispatchReceiverKey(iframe: TvReceiverIframe, code: number): boolean;
6
+ /** @deprecated Use dispatchReceiverKey(). */
7
+ export declare const dispatchTvReceiverKey: typeof dispatchReceiverKey;
8
+ export {};
@@ -35,6 +35,23 @@
35
35
  別 application へ切り替える必要がある場合、実行中のページが
36
36
  `navigator.applicationManager.getOwnerApplication().replaceApplication(...)` を呼びます。
37
37
 
38
+ ## BML から Hybridcast への状態移行
39
+
40
+ BML engine が AIT 制御 HTML application へ制御を渡す場合、general register は receiver host が
41
+ 所有します。BML 側から受け取った register snapshot を、HTML document を読み込む前に
42
+ `host.setBmlGreg()` で渡してください。runtime は同じ receiver-owned array を
43
+ `navigator.bmlCompat.browserPseudo.Greg` として公開します。
44
+
45
+ ```ts
46
+ host.setBmlGreg(bmlTransition.greg)
47
+ host.setApplicationInformation(aitApplication)
48
+ host.loadApplication(htmlEntryPoint)
49
+ ```
50
+
51
+ `setBmlGreg()` は active runtime が参照する array identity を維持するため、document を残したまま
52
+ 更新しても state が分断されません。受信機識別子や operator policy は別の receiver API が所有し、
53
+ general register を識別子として扱ってはいけません。
54
+
38
55
  ## replaceApplication
39
56
 
40
57
  ARIB STD-B62 第二編 3.3.7–3.3.8 は `ApplicationManager` と `Application` を定義します。
@@ -65,6 +82,15 @@ const host = new AribReceiverHost({
65
82
  許可境界と外部 network policy を receiver 側で検証し、対応する場合だけ
66
83
  `onExitManagedState` で処理します。
67
84
 
85
+ ## BML ブラウザへの復帰
86
+
87
+ Hybridcast HTML application は
88
+ `navigator.applicationManager.launchDataBroadcastingBrowser()` で、起動元の
89
+ BML data-broadcasting browser への復帰を receiver に要求できます。runtime はこの要求を
90
+ `AribReceiverHostOptions.onLaunchDataBroadcastingBrowser` に渡します。host は BML session を
91
+ 保持したまま HTML application plane を閉じ、BML browser を再表示してください。callback がない
92
+ 場合は要求を成功扱いにせず、runtime は現在の application を維持します。
93
+
68
94
  ## アプリケーション境界と権限
69
95
 
70
96
  MH-AIT の `MH-Application Boundary and Permission Descriptor` (`descriptor_tag=0x802C`)
Binary file
@@ -58,6 +58,26 @@ read-only through the legacy `receiverinfo` Ureg used by broadcaster apps. The
58
58
  host owns persistence and passes a snapshot; writes inside the app do not flow
59
59
  back into the host's settings.
60
60
 
61
+ ## HTML application canvas
62
+
63
+ The runtime reads `width` and `height` from the document's
64
+ `meta[name="viewport"]` and sends the declared logical canvas to the receiver
65
+ host. A document declaring `width=1920,height=1080` is rendered as a 1920×1080
66
+ application plane and fitted inside `viewport`; this also applies when the
67
+ document has no ARIB broadcast-media object. The default remains 3840×2160 when
68
+ the declaration is absent or invalid.
69
+
70
+ This is an application-document contract, not a broadcaster or transport
71
+ profile. Hosts must not override it with station-specific CSS sizing rules.
72
+
73
+ ## HTML user agent
74
+
75
+ An integrating receiver may provide `userAgent` when it needs to expose an
76
+ honest Hybridcast capability token to managed HTML documents. The value is
77
+ installed before document scripts execute and restored when that runtime is
78
+ unloaded. The SDK does not add a broadcaster, smart-card, or device-vendor
79
+ identity on its own.
80
+
61
81
  ## Device identifiers
62
82
 
63
83
  The default package combination remains `huggy`, `Huggy ARIB HTML5 Receiver`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libaribhtml5",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Browser runtime and receiver host for ARIB HTML5 data broadcasting",
5
5
  "keywords": [
6
6
  "arib",