libaribhtml5 0.1.4 → 0.1.5
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 +1004 -676
- 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-host.d.ts +22 -1
- package/dist/types/runtime/application-boundary.d.ts +45 -0
- package/dist/types/runtime/install.d.ts +4 -0
- package/dist/types/runtime/platform.d.ts +4 -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 +1 -1
package/README.md
CHANGED
|
@@ -2,30 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
[日本語](#日本語) | [English](#english)
|
|
4
4
|
|
|
5
|
+
## Demo
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="docs/images/bs8k-data-broadcast-home.webp" alt="NHK BS8K data-broadcast home screen" width="100%">
|
|
9
|
+
</p>
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img src="docs/images/bs8k-usage-survey.webp" alt="NHK BS8K data-service usage survey" width="100%">
|
|
12
|
+
</p>
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="docs/images/bs8k-caption-dialog.webp" alt="NHK BS8K caption controls" width="100%">
|
|
15
|
+
</p>
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="docs/images/bs8k-message-removal.webp" alt="NHK BS8K message-removal guide" width="100%">
|
|
18
|
+
</p>
|
|
19
|
+
|
|
5
20
|
## 日本語
|
|
6
21
|
|
|
7
|
-
ブラウザ上で動作する ARIB HTML5
|
|
8
|
-
|
|
9
|
-
|
|
22
|
+
本プロジェクトは、Web ブラウザ上で動作する ARIB HTML5 受信機ランタイムの
|
|
23
|
+
プロトタイプです。デモでは、展開済みの BS4K アプリケーションを放送時と同じ
|
|
24
|
+
パス構成で配信し、実行前に受信機 API の互換レイヤーを組み込みます。
|
|
10
25
|
|
|
11
26
|
```sh
|
|
12
27
|
pnpm install
|
|
13
28
|
pnpm dev
|
|
14
29
|
```
|
|
15
30
|
|
|
16
|
-
Vite
|
|
17
|
-
|
|
31
|
+
起動後、Vite に表示された URL をブラウザで開いてください。放送時と同じ自動起動の
|
|
32
|
+
流れを試す場合は**透明起動ページ**、画面を直接開く場合は**表示ページ**を選択します。
|
|
33
|
+
|
|
34
|
+
### 動作確認済みブラウザ
|
|
35
|
+
|
|
36
|
+
- Microsoft Edge `150.0.4078.105`(Chromium ベース)
|
|
37
|
+
- Firefox `153.0`
|
|
38
|
+
|
|
39
|
+
Safari には未解決の互換性問題があるため、現時点では対応していません。
|
|
18
40
|
|
|
19
41
|
### 注意事項
|
|
20
42
|
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
- ACAS
|
|
43
|
+
- 放送アプリケーションの一部機能は、放送局のサーバー上にあるデータを参照します。
|
|
44
|
+
このデモでは安全のため、ブラウザから外部サーバーへの通信をすべて遮断しています。
|
|
45
|
+
そのため、オンライン連携を前提とする機能は動作しません。
|
|
46
|
+
- 受信機情報として返す ACAS 番号には、デモ用の固定値
|
|
47
|
+
`0721 0721 0721 0724 9674` を使用しています。
|
|
25
48
|
|
|
26
49
|
### SDK バンドル
|
|
27
50
|
|
|
28
|
-
npm
|
|
51
|
+
npm パッケージとして利用する場合は、以下のようにインストールし、
|
|
52
|
+
ESM エントリポイントから読み込みます。
|
|
29
53
|
|
|
30
54
|
```sh
|
|
31
55
|
npm install libaribhtml5
|
|
@@ -35,68 +59,81 @@ npm install libaribhtml5
|
|
|
35
59
|
import { AribReceiverHost, installRuntime } from 'libaribhtml5'
|
|
36
60
|
```
|
|
37
61
|
|
|
38
|
-
|
|
39
|
-
`libaribhtml5/arib-vfs-sw.js`
|
|
62
|
+
`<script>` タグから読み込む IIFE 版は `libaribhtml5/iife`、Service Worker は
|
|
63
|
+
`libaribhtml5/arib-vfs-sw.js` から利用できます。
|
|
40
64
|
|
|
41
65
|
```sh
|
|
42
66
|
pnpm build:sdk
|
|
43
67
|
```
|
|
44
68
|
|
|
45
|
-
|
|
46
|
-
`dist/sdk/arib-vfs-sw.js`
|
|
47
|
-
`ServiceWorkerBroadcastVfs`、`installRuntime`
|
|
48
|
-
`src/runtime/romsound/` 以下で個別の MP3 ファイルとして管理され、SDK のビルド時に
|
|
49
|
-
すべてデータ URL として単一の JavaScript バンドルへ埋め込まれます。
|
|
69
|
+
このコマンドを実行すると、`dist/sdk/libaribhtml5.js` とブラウザ VFS 用の
|
|
70
|
+
`dist/sdk/arib-vfs-sw.js` が生成されます。`window.ARIBHTML5` からは
|
|
71
|
+
`AribReceiverHost`、`ServiceWorkerBroadcastVfs`、`installRuntime` を利用できます。
|
|
50
72
|
|
|
51
|
-
|
|
73
|
+
受信機の内蔵音は `src/runtime/romsound/` 以下で個別の MP3 ファイルとして管理され、
|
|
74
|
+
SDK のビルド時にデータ URL として単一の JavaScript バンドルへ埋め込まれます。
|
|
75
|
+
iOS/iPadOS では、短い内蔵音の再生によって主映像の Media Session が切り替わるのを
|
|
76
|
+
防ぐため、`romsound://` の再生処理は音を出さずに成功を返します。
|
|
77
|
+
|
|
78
|
+
プレーヤーへ組み込む際のメディアスロット、アダプター、レイヤー構成、
|
|
79
|
+
ライフサイクル、字幕連携については、
|
|
52
80
|
[メディアプレーン共通統合ガイド](docs/media-plane-integration.md)を参照してください。
|
|
53
81
|
[ブラウザ iframe 合成の注意事項](docs/browser-iframe-compositing.md)には、Chromium の
|
|
54
82
|
`color-scheme` backdrop と external media hole の実装条件をまとめています。
|
|
55
|
-
|
|
83
|
+
データ放送を開始する際は `host.loadApplication()`、通常のプレーヤー画面へ戻る際は
|
|
56
84
|
`host.exitApplication()` を使用します。
|
|
57
|
-
MH-AIT の `AUTOSTART` / `PRESENT` / `KILL
|
|
58
|
-
`replaceApplication()` と EMT
|
|
85
|
+
MH-AIT の `AUTOSTART` / `PRESENT` / `KILL`、番組連動アプリケーション、
|
|
86
|
+
`replaceApplication()` と EMT の役割分担については、
|
|
59
87
|
[MH-AIT アプリケーションライフサイクル](docs/application-lifecycle.md)を参照してください。
|
|
60
88
|
|
|
61
|
-
|
|
62
|
-
`host.setBroadcastClock()`
|
|
89
|
+
録画再生時はシステム時刻ではなく、ストリームの NTP と再生位置を
|
|
90
|
+
`host.setBroadcastClock()` に渡します。時刻の変換例は
|
|
63
91
|
[録画再生時の放送時計](docs/broadcast-clock.md)を参照してください。
|
|
64
92
|
|
|
65
|
-
EIT
|
|
66
|
-
[
|
|
93
|
+
EIT 由来の番組情報や受信機固有情報をホストから受け渡すインターフェースについては、
|
|
94
|
+
[受信機ホスト契約](docs/receiver-host-contracts.md)を参照してください。
|
|
67
95
|
|
|
68
96
|
Service Worker の `/data-broadcast/` ルーティング、データ放送リソースの
|
|
69
|
-
|
|
97
|
+
保存・更新・解放の流れ、および ARIB 追加記号フォントについては、
|
|
70
98
|
[放送リソースとフォント](docs/broadcast-resources-and-fonts.md)を参照してください。
|
|
71
99
|
|
|
72
|
-
Android/WebView
|
|
73
|
-
[`onOpenProgramGuide`
|
|
100
|
+
Android/WebView で「放送予定」の検索結果から受信機側の番組表や番組詳細画面を
|
|
101
|
+
開く場合は、[`onOpenProgramGuide` とブラウザへのフォールバック](docs/android-program-guide.md)を
|
|
102
|
+
参照してください。
|
|
74
103
|
|
|
75
104
|
## English
|
|
76
105
|
|
|
77
|
-
|
|
78
|
-
extracted BS4K application
|
|
79
|
-
|
|
106
|
+
libaribhtml5 is a prototype ARIB HTML5 receiver runtime that runs in the browser.
|
|
107
|
+
The demo serves an extracted BS4K application using its original broadcast path
|
|
108
|
+
layout and installs a compatibility layer for the receiver APIs before the
|
|
109
|
+
application starts.
|
|
80
110
|
|
|
81
111
|
```sh
|
|
82
112
|
pnpm install
|
|
83
113
|
pnpm dev
|
|
84
114
|
```
|
|
85
115
|
|
|
86
|
-
|
|
87
|
-
|
|
116
|
+
After starting the development server, open the URL shown by Vite. Choose
|
|
117
|
+
**透明起動ページ** to exercise the broadcast autostart flow, or **表示ページ**
|
|
118
|
+
to open the visible application page directly.
|
|
119
|
+
|
|
120
|
+
### Tested browsers
|
|
121
|
+
|
|
122
|
+
- Microsoft Edge `150.0.4078.105` (Chromium-based)
|
|
123
|
+
- Firefox `153.0`
|
|
124
|
+
|
|
125
|
+
Safari is not currently supported because compatibility issues remain unresolved.
|
|
88
126
|
|
|
89
127
|
### Notes
|
|
90
128
|
|
|
91
|
-
- Some
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- The ACAS
|
|
95
|
-
`0721 0721 0721 0724 9674`.
|
|
129
|
+
- Some broadcast application features fetch data hosted on the broadcaster's
|
|
130
|
+
servers. For safety, this demo blocks all requests to external servers, so
|
|
131
|
+
features that depend on online services will not work.
|
|
132
|
+
- The receiver reports the demo ACAS number `0721 0721 0721 0724 9674`.
|
|
96
133
|
|
|
97
134
|
### SDK bundle
|
|
98
135
|
|
|
99
|
-
Install the package
|
|
136
|
+
Install the package and import its typed ESM entry point:
|
|
100
137
|
|
|
101
138
|
```sh
|
|
102
139
|
npm install libaribhtml5
|
|
@@ -106,26 +143,47 @@ npm install libaribhtml5
|
|
|
106
143
|
import { AribReceiverHost, installRuntime } from 'libaribhtml5'
|
|
107
144
|
```
|
|
108
145
|
|
|
109
|
-
|
|
110
|
-
Service Worker is
|
|
146
|
+
An IIFE build for `<script>` tags is available as `libaribhtml5/iife`. The
|
|
147
|
+
Service Worker is available as `libaribhtml5/arib-vfs-sw.js`.
|
|
111
148
|
|
|
112
149
|
```sh
|
|
113
150
|
pnpm build:sdk
|
|
114
151
|
```
|
|
115
152
|
|
|
116
|
-
This produces `dist/sdk/libaribhtml5.js`
|
|
117
|
-
|
|
118
|
-
`
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
153
|
+
This command produces `dist/sdk/libaribhtml5.js` and
|
|
154
|
+
`dist/sdk/arib-vfs-sw.js` for the browser VFS. The global
|
|
155
|
+
`window.ARIBHTML5` object exposes `AribReceiverHost`,
|
|
156
|
+
`ServiceWorkerBroadcastVfs`, and `installRuntime`.
|
|
157
|
+
|
|
158
|
+
Built-in receiver sounds are stored as individual MP3 files under
|
|
159
|
+
`src/runtime/romsound/`. The SDK build inlines them as data URLs in the
|
|
160
|
+
JavaScript bundle. On iOS and iPadOS, `romsound://` requests succeed without
|
|
161
|
+
playing audio, preventing a short receiver sound from taking over the main
|
|
162
|
+
video's Media Session.
|
|
163
|
+
|
|
164
|
+
The [common media-plane integration guide](docs/media-plane-integration.md)
|
|
165
|
+
covers media slots, adapters, layering, lifecycle management, and caption
|
|
166
|
+
integration. The [browser iframe compositing notes](docs/browser-iframe-compositing.md)
|
|
167
|
+
describe the Chromium `color-scheme` backdrop and the requirements for an
|
|
168
|
+
external media hole.
|
|
169
|
+
|
|
170
|
+
Call `host.loadApplication()` when entering data broadcasting and
|
|
171
|
+
`host.exitApplication()` when returning to the regular player. See
|
|
172
|
+
[MH-AIT application lifecycle](docs/application-lifecycle.md) for `AUTOSTART`,
|
|
173
|
+
`PRESENT`, `KILL`, linked applications, `replaceApplication()`, and the EMT
|
|
174
|
+
delivery boundary.
|
|
175
|
+
|
|
176
|
+
For recorded playback, pass stream-derived NTP time and the current playback
|
|
177
|
+
position to `host.setBroadcastClock()` instead of using the system clock. See
|
|
178
|
+
[broadcast clocks for recorded playback](docs/broadcast-clock.md) for a
|
|
179
|
+
conversion example.
|
|
180
|
+
|
|
181
|
+
See [receiver host contracts](docs/receiver-host-contracts.md) for passing EIT
|
|
182
|
+
program metadata and receiver-specific system information from the host. See
|
|
183
|
+
[broadcast resources, Worker routing, and fonts](docs/broadcast-resources-and-fonts.md)
|
|
184
|
+
for the `/data-broadcast/` namespace, resource lifecycle, and ARIB symbol fonts.
|
|
185
|
+
|
|
186
|
+
For Android/WebView integrations, see
|
|
187
|
+
[`onOpenProgramGuide` and browser fallback](docs/android-program-guide.md) for
|
|
188
|
+
opening the receiver's program guide or program details from a search result
|
|
189
|
+
for an upcoming program.
|
package/dist/sdk/arib-vfs-sw.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
(_match, _quote, quoted, bare) => ` data-arib-romsound="${quoted ?? bare}"`
|
|
7
7
|
);
|
|
8
8
|
}
|
|
9
|
+
const DEFAULT_RECEIVER_DEVICE_IDENTIFIER = "4194c4ae4730";
|
|
9
10
|
function createRuntimeBootstrap(scopePath = "/data-broadcast/") {
|
|
10
11
|
const basePath = normalizeBasePath(scopePath);
|
|
11
12
|
return `<script>
|
|
@@ -37,6 +38,9 @@
|
|
|
37
38
|
modelname: 'unknown',
|
|
38
39
|
baseurl: new URL(${JSON.stringify(basePath)}, location.origin).href
|
|
39
40
|
}
|
|
41
|
+
},
|
|
42
|
+
getDeviceIdentifier: function (kind, callback) {
|
|
43
|
+
queueMicrotask(function () { callback(${JSON.stringify(DEFAULT_RECEIVER_DEVICE_IDENTIFIER)}) })
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
})
|