libaribhtml5 0.1.3 → 0.1.4

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.
@@ -11,6 +11,11 @@ export type AribMediaPlaneStackEntry = {
11
11
  export type AribMediaPlaneLayer = {
12
12
  documentOrder: number;
13
13
  stackingPath: AribMediaPlaneStackEntry[];
14
+ /**
15
+ * External compositor fallback for a media-only foreground wrapper.
16
+ * Omitted/behind-application keeps the host surface below the iframe.
17
+ */
18
+ externalPlacement?: 'behind-application' | 'above-application';
14
19
  };
15
20
  export type AribMediaPlane = {
16
21
  slotId: string;
@@ -62,15 +67,22 @@ export declare class DomObjectMediaPlaneAdapter implements AribMediaPlaneAdapter
62
67
  export type BehindIframeMediaPlaneAdapterOptions = {
63
68
  surface: HTMLElement;
64
69
  keepVisible?: boolean;
70
+ /** Stacking level used for the ordinary media plane behind the iframe. */
71
+ behindZIndex?: string | number;
72
+ /** Stacking level used for a foreground media-only wrapper. */
73
+ aboveZIndex?: string | number;
65
74
  };
66
75
  /**
67
- * Simplified compatibility fallback. It cannot interleave media with elements
68
- * inside the application iframe; the complete iframe is always above it.
76
+ * Simplified iframe compositor. It normally keeps media behind the complete
77
+ * application iframe, but can raise a foreground media-only slot as a whole.
78
+ * It still cannot interleave that surface with individual elements in iframe.
69
79
  */
70
80
  export declare class BehindIframeMediaPlaneAdapter implements AribMediaPlaneAdapter {
71
81
  readonly renderMode: "external";
72
82
  private readonly surface;
73
83
  private readonly keepVisible;
84
+ private readonly behindZIndex;
85
+ private readonly aboveZIndex;
74
86
  constructor(options: BehindIframeMediaPlaneAdapterOptions);
75
87
  mountMediaPlane(_object: HTMLElement, plane: AribMediaPlane): void;
76
88
  updateMediaPlane(_object: HTMLElement, plane: AribMediaPlane): void;
@@ -0,0 +1,13 @@
1
+ export type BroadcastMediaSlot = {
2
+ element: HTMLElement;
3
+ rect: DOMRect;
4
+ };
5
+ /**
6
+ * Resolve the receiver video slot represented by a broadcast object.
7
+ *
8
+ * Chromium gives an unsized `<object>` its replaced-element fallback size
9
+ * (normally 300 x 150). Broadcast applications also use an unsized object as
10
+ * the sole child of a positioned video-slot wrapper. In that case the wrapper,
11
+ * rather than the browser fallback box, is the receiver media plane.
12
+ */
13
+ export declare const resolveBroadcastMediaSlot: (object: HTMLElement) => BroadcastMediaSlot;
@@ -25,6 +25,19 @@ object だけを子に持つ media-only wrapper は wrapper 自身も隠しま
25
25
  独立した compositing layer を作る場合、背景だけを透明化しても Chromium が外部 video の上へその layer を
26
26
  残すためです。字幕、ダイアログ、操作 UI を含む祖先は media-only wrapper として扱いません。
27
27
 
28
+ 放送ページが object 自身に `width` / `height` を指定せず、positioned wrapper だけに映像枠の寸法を
29
+ 指定する場合があります。通常ブラウザはその object を 300 x 150 の既定 replaced-element として計測しますが、
30
+ receiver runtime は object が wrapper の唯一の子である場合に限り wrapper を media slot として採用します。
31
+ この wrapper は外部合成中だけ object と一緒に透明化されるため、放送ページが指定した高い `z-index` を
32
+ 削除したり、host の video を iframe より前へ出したりする必要はありません。
33
+
34
+ ただし、異なる寸法の media-only wrapper が正の `z-index` を持つ場合、その video slot はページ背景の
35
+ 前に置くことを意図した foreground media です。runtime は `layer.externalPlacement` を
36
+ `above-application` として報告します。external adapter はこの場合だけ media surface を application
37
+ iframe より前の layer に置きます。標準の `BehindIframeMediaPlaneAdapter` は通常 `z=0`、この場合だけ
38
+ `z=2` を使います(必要なら `behindZIndex` / `aboveZIndex` で host の stacking context に合わせます)。
39
+ 通常の全面映像や application background として使われる slot は `behind-application` のままです。
40
+
28
41
  `display: none`、`visibility: hidden`、`content-visibility: hidden` は矩形計測または可視判定を壊すため
29
42
  使用しません。runtime は隠す前の computed opacity を media-plane report に使い、host 側の video は
30
43
  object の CSS を複製せず、報告された `getBoundingClientRect()` を logical viewport に対する割合へ
@@ -242,6 +242,7 @@ type AribMediaPlane = {
242
242
  opacity: number
243
243
  transform: string
244
244
  }>
245
+ externalPlacement?: 'behind-application' | 'above-application'
245
246
  }
246
247
  }
247
248
  ```
@@ -254,6 +255,12 @@ type AribMediaPlane = {
254
255
  合成方針を決めます。ブラウザ用 `DomObjectMediaPlaneAdapter` では DOM 自身が合成するため、
255
256
  この変換は不要です。
256
257
 
258
+ `externalPlacement` は iframe 外の video を使うブラウザ統合向けの限定的なヒントです。
259
+ `above-application` は、既定寸法の object を包む media-only wrapper が正の `z-index` を持つ場合にだけ
260
+ 報告されます。この場合、host は media surface 全体を iframe より前の stacking level にできます。
261
+ ただし iframe 内部との完全な interleave はできないため、映像枠と重なる application UI がある実装では
262
+ `in-object` adapter を使用してください。
263
+
257
264
  ## なぜ iframe 背面方式では不足するか
258
265
 
259
266
  iframe と親 document の間で選べるのは次の順序だけです。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libaribhtml5",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Browser runtime and receiver host for ARIB HTML5 data broadcasting",
5
5
  "keywords": [
6
6
  "arib",