@adelin-io/cli 0.1.0 → 0.1.2
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/authoring-release.json +13 -13
- package/package.json +1 -1
- package/runtime-integrity.json +2 -2
- package/scripts/adelin.mjs +54 -10
- package/scripts/runtime.mjs +276 -80
- package/skill/SKILL.md +1 -1
- package/skill/authoring/auth.md +3 -1
- package/skill/authoring/content-binding.md +1 -1
- package/skill/authoring/local-workflow.md +22 -6
- package/skill/authoring/player/index.md +1 -1
- package/skill/authoring/player/live-dvr.md +63 -22
- package/skill/authoring/player/playback.md +3 -2
- package/skill/design/design-guide.md +3 -1
- package/skill/reference/packages.md +1 -1
- package/types/adelin-content.d.ts +9 -1
- package/types/adelin-ui.d.ts +1 -1
package/skill/SKILL.md
CHANGED
|
@@ -87,7 +87,7 @@ These rules describe authored app code. Hosted HTML/CSS design artifacts follow
|
|
|
87
87
|
| Adding sign-in, sign-up, the sign-in gate or an account screen | [authoring/auth.md](authoring/auth.md) |
|
|
88
88
|
| Measurement, consent banners or the account screen's privacy choices | [authoring/analytics.md](authoring/analytics.md) |
|
|
89
89
|
| Adding profiles, Who's watching, saved titles, Continue Watching or Resume | [authoring/profiles.md](authoring/profiles.md) |
|
|
90
|
-
| Adding playback, controls, casting or downloads | [authoring/player/index.md](authoring/player/index.md) |
|
|
90
|
+
| Adding playback, live viewer counts, controls, casting or downloads | [authoring/player/index.md](authoring/player/index.md) |
|
|
91
91
|
| Adding explicit offline startup, local navigation or history replay | [authoring/offline/index.md](authoring/offline/index.md) |
|
|
92
92
|
| Adding a search screen | [authoring/search.md](authoring/search.md) |
|
|
93
93
|
| Showing the app in several languages | [authoring/i18n.md](authoring/i18n.md) |
|
package/skill/authoring/auth.md
CHANGED
|
@@ -30,8 +30,10 @@ can show; anything meant only for signed-in viewers belongs in content, never in
|
|
|
30
30
|
content. Keep sign-in reachable from the account screen for that case. Never ask the builder
|
|
31
31
|
about the setting and never write a second version of the app for it.
|
|
32
32
|
- Content loads again by itself after sign-in; do not refetch it yourself.
|
|
33
|
-
- In the preview the builder is already signed in as their own test viewer, so the app opens
|
|
33
|
+
- In the builder preview the builder is already signed in as their own test viewer, so the app opens
|
|
34
34
|
past the gate. They can sign out to try the real sign-in and sign-up pages.
|
|
35
|
+
- Public and shared preview links use the same app accounts as the live app. Visitors can
|
|
36
|
+
register or sign in through the app's forms; they are not automatically signed in as a test viewer.
|
|
35
37
|
|
|
36
38
|
Add a profile picker as a third early return when the app needs one ([profiles.md](profiles.md)).
|
|
37
39
|
|
|
@@ -23,4 +23,4 @@ For playback, controls, output selection and local video sources, read the
|
|
|
23
23
|
|
|
24
24
|
Playback consumes finite authority only after selection. Catalogue loading, scrolling and metadata refresh must not request a playback grant. Use the supplied admitted source and refresh it through its issuer when required; never reconstruct provider URLs or extend an expired grant locally. Stop the player when current authority is refused.
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
For live title selection and runtime-owned admission, read [Live streams and DVR](player/live-dvr.md).
|
|
@@ -20,19 +20,33 @@ The CLI stores sign-in per user in `adelin/auth.json` under the user config dire
|
|
|
20
20
|
|
|
21
21
|
The CLI and background upload workers on the same host serialize every sign-in save, logout and token refresh through an exclusive loopback listener keyed by the canonical credential path. The listener exchanges no credential data, and the operating system releases it when its process exits or crashes. A second process reuses the rotated credential; logout waits for an active refresh, then removes only that server's sign-in so the refresh cannot recreate it. Another credential operation or an unrelated service occupying the same local port causes a wait with a 30-second deadline before a retry refusal. A loopback permission failure also refuses the operation without changing stored credentials.
|
|
22
22
|
|
|
23
|
-
Local byte transfers and live-key access require a native loopback connection requesting `local-transfer` and `live-credentials`. The sign-in page names the unverified requester and offers separate unchecked approvals for private file transfers and saving live keys locally. A client name never authenticates its publisher. Live-key approval requires local-transfer approval and
|
|
23
|
+
Local byte transfers and live-key access require a native loopback connection requesting `local-transfer` and `live-credentials`. The sign-in page names the unverified requester and offers separate unchecked approvals for private file transfers and saving live keys locally. A client name never authenticates its publisher. Live-key approval requires local-transfer approval and `live.manage` in at least one app the connection covers. These approvals belong to the current account, client and grant; removing or expiring consent denies subsequent sensitive actions.
|
|
24
24
|
|
|
25
25
|
`adelin logout` revokes the current connection and removes its local sign-in. `adelin logout --local-only` removes only the local sign-in; it does not revoke the app grant. Revoking the connection in account settings ends its app grants. Follow [private local output](#private-local-output) for deliberately written credential files, their handling and rotation.
|
|
26
26
|
|
|
27
27
|
## Choose and open an app
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
At sign-in the builder chooses **All apps, including new ones** (the default) or **Only selected apps**. Apps you create are always usable by that connection. **Settings → Connected code agents → Manage apps** adds or removes apps and switches mode without signing in again. With all apps, the connection can do what the builder's current role allows in each app, checked on every call, so a role change narrows or widens it at once. With selected apps, each app keeps the capabilities approved for it, and the builder's current role can only narrow them. Live stream keys need a separate opt-in at sign-in. `connection_status` reports `scope` (`all_apps` or `selected`) and project setup state. When signed out, tools answer `SIGN_IN_REQUIRED`: tell the builder to run `adelin login`; the Adelin tools appear shortly after login without restarting the agent.
|
|
30
30
|
|
|
31
|
-
Call `list_editable_apps` (`limit` 1–25, default 10, and `nextCursor` as `cursor`) or `select_app(app_id)` to choose an allowed app. `select_app` returns `app` or `APP_NOT_EDITABLE`. Arguments outside a tool's input schema, on any tool, return `{ok:false,error:{code:"INVALID_ARGUMENT",message}}` with `isError: true` and change nothing. The message names the first wrong field and what was expected, for example `mode is not accepted for entry.patch` or `payload.patch.title: expected string`, and never repeats the value sent; correct that field and call again. The `library_mutate` description lists each action's payload and which actions accept `mode`.
|
|
31
|
+
Call `list_editable_apps` (`limit` 1–25, default 10, and `nextCursor` as `cursor`) or `select_app(app_id)` to choose an allowed app. `select_app` returns `app` or `APP_NOT_EDITABLE`. Arguments outside a tool's input schema, on any tool, return `{ok:false,error:{code:"INVALID_ARGUMENT",message}}` with `isError: true` and change nothing. The message names the first wrong field and what was expected, for example `mode is not accepted for entry.patch` or `payload.patch.title: expected string`, and never repeats the value sent; correct that field and call again. The `library_mutate` description lists each action's payload and which actions accept `mode`. To make a new app, follow [create an app](#create-an-app).
|
|
32
|
+
|
|
33
|
+
### Create an app {#create-an-app}
|
|
34
|
+
|
|
35
|
+
Ask one thing at a time, in this order:
|
|
36
|
+
|
|
37
|
+
1. The app name.
|
|
38
|
+
2. A template or from scratch. Call `list_app_templates` (`id`, `name`, `description`, `digest`, `sampleContent`, `devices`, `previewUrl`, `tvPreviewUrl`) and offer each with its name, a one-line description and its preview link.
|
|
39
|
+
3. For scratch only: the languages (first is primary, 1–20) and the sample content (`Movies`, `Series`, `Courses`, `Travel`) or none.
|
|
40
|
+
4. The devices (`mobile`, `web`, `tv`).
|
|
41
|
+
5. The organization, only when `list_app_organizations` returns more than one (it shows `appCount` and `appLimit` for each).
|
|
42
|
+
|
|
43
|
+
Then call `create_app {organization_id, name, devices, start}`, where `start` is `{template_id, template_digest}` or `{scratch: {languages, sample_content}}`. A result of `ready` carries the app: call `open_app`. `create_app` waits up to about 45 seconds. A result of `waiting` carries `app_id` and `creation_id`: call `resume_app_creation` with both until it is ready. A `failed` result after the app exists carries the same ids and the `idempotency_key`: follow its message, and when it says to retry later, call `resume_app_creation` rather than creating another app. A scratch app opens as an empty workspace; the first successful build makes it renderable.
|
|
44
|
+
|
|
45
|
+
On an error, give the builder its message. `APP_PLAN_LIMIT`: give them the `upgradeUrl`. `TEMPLATE_CHANGED`: call `list_app_templates` again and confirm the template. `ORG_NOT_MANAGEABLE`: choose another organization. When the error includes `idempotency_key`, pass it as `idempotency_key` when retrying so the app is not created twice.
|
|
32
46
|
|
|
33
47
|
Call `open_app(app_id, workspace)` with an absolute or project-relative folder for local source. For a new workspace, the CLI transfers an authenticated checkout directly, verifies its chunks and app identity, and installs the files into an empty destination. For an existing workspace, it validates the app identity and reuses the files, base versions and pending journal. Reopening does not refresh or overwrite local edits. It opens the one edit session for that app and returns bounded outcomes without source bytes or lease credentials. If the builder has the app open in App Creator with an idle chat, opening it hands the app to you, and App Creator shows your work while you have it. An occupied app returns `conflict` with a retry time and a message naming who holds it (a chat reply in progress, another person, another agent); do not open a second editor to bypass it.
|
|
34
48
|
|
|
35
|
-
For content inspection without editing, use the bounded library reads below. A library-only account can approve `library.view` without `ai.manage`, open_app, a checkout or an edit lease. Do not use `list_editable_apps` as a library eligibility test. Supply
|
|
49
|
+
For content inspection without editing, use the bounded library reads below. A library-only account can approve `library.view` without `ai.manage`, open_app, a checkout or an edit lease. Do not use `list_editable_apps` as a library eligibility test. Supply an allowed app ID on each call; editing selection does not supply it implicitly.
|
|
36
50
|
|
|
37
51
|
For opening, resuming, recording progress and correcting working context, follow the
|
|
38
52
|
[shared app-memory guide](app-memory.md). `open_app` returns fresh accepted requirements
|
|
@@ -107,7 +121,7 @@ File versions are allocated by the server. Failed attempts can leave gaps, so ve
|
|
|
107
121
|
|
|
108
122
|
## Bounded library reads
|
|
109
123
|
|
|
110
|
-
|
|
124
|
+
Reads need a connection that covers the app (all apps, or the app selected with `library.view`). Current `library.view` permission is checked on every page. Manage permission never implies view permission, and a token or cursor never replaces current authority. Every CLI command requires `--app UUID`; every local MCP call requires `app_id: UUID`. Commands carry no server URL: the released CLI always talks to Adelin's server, and a development build of the CLI targets a local server and also accepts `--url`. Do not supply an actor, grant or credential in read arguments.
|
|
111
125
|
|
|
112
126
|
| CLI syntax | Local MCP operation | Result |
|
|
113
127
|
|---|---|---|
|
|
@@ -133,12 +147,14 @@ How file fields read on a published entry is described under Entry files.
|
|
|
133
147
|
|
|
134
148
|
A page stops adding rows once its JSON envelope would pass 32768 UTF-8 bytes (32 KiB), so a page fits a coding client's tool-output limit; about 45 tree rows fit. `returned` is then below `limit` while `nextCursor` is set: keep paging. Publish candidates page by `limit` alone. A page always carries at least one row, the complete envelope is limited to 262144 bytes (256 KiB), and each indivisible row or entry core to 65536 bytes (64 KiB). Each collection permits at most 5000 rows, and projected snapshots at most 8388608 bytes (8 MiB). Oversized items fail with `READ_ITEM_TOO_LARGE`; tree or snapshot overflow uses `LIBRARY_TREE_TOO_LARGE` or `READ_SNAPSHOT_TOO_LARGE`, never silent truncation. Transport responses are capped at 4194304 bytes with a 30-second deadline and at most one authentication refresh.
|
|
135
149
|
|
|
136
|
-
The CLI writes exactly one JSON envelope and newline to stdout: `{ok:true,operation,appId,data}` with exit 0, or `{ok:false,error:{code,message}}` with exit 1. Help is text with exit 0. MCP returns the same JSON in one text block and `isError: !ok`. Errors do not include raw remote text, credentials or internal diagnostics. `AUTH_REQUIRED` requires login; `ACCESS_DENIED` requires reviewing
|
|
150
|
+
The CLI writes exactly one JSON envelope and newline to stdout: `{ok:true,operation,appId,data}` with exit 0, or `{ok:false,error:{code,message}}` with exit 1. Help is text with exit 0. MCP returns the same JSON in one text block and `isError: !ok`. Errors do not include raw remote text, credentials or internal diagnostics. `AUTH_REQUIRED` requires login; `ACCESS_DENIED` requires reviewing the connection's app access in Settings → Connected code agents. `APP_SELECTION_CHANGED` means app access changed while the request ran: retry once, then run `adelin login` if it repeats. `TOOL_UNAVAILABLE` means this connection was not granted the tool; run `adelin login` and approve the access it needs. `INTERACTION_COMPLETED` means an old approval cannot be replayed. `NOT_FOUND` does not distinguish missing from foreign objects. Correct `INVALID_ARGUMENT` input; do not blindly retry size, stale-state or permission errors.
|
|
137
151
|
|
|
138
152
|
## Sample content import
|
|
139
153
|
|
|
140
154
|
Sample content is imported only when an app is created and is never re-imported. These commands inspect or resume that creation-time import; they never start an import, reset it or change categories. An app without an import returns `none:true` and explains that sample content is added only when the app is created. Viewing requires `library.view`; advancing requires `library.manage` and its current explicit consent.
|
|
141
155
|
|
|
156
|
+
Prepared sample entries publish automatically when their category finishes importing. While media or artwork is still being prepared, entries stay draft. A completed import does not republish entries the builder later returns to draft or restore deleted content; owner-controlled pending changes, schedules and skipped resources remain untouched.
|
|
157
|
+
|
|
142
158
|
Status lists each import's `importId`, categories, completed categories and state (`saving`, `awaiting_resources` or `complete`), plus saved/total/missing entries, ready/total/failed artwork and media, and admitted/total playback. `skipped:{artwork,media,playback}` counts owner-controlled work preserved during advance; these resources are never counted as ready or admitted. `stalled:true` means incomplete with no live resource lease. `busyUntil` means another advancer holds a lease; `next` is `advance`, `wait` or `none`. Failure details contain at most 20 safe `{stage,code,at}` records ordered by actual failure time, newest first. Status is read-only. Advance preserves edited, published or removed owner content, records conflicting attachments as skipped and continues healthy work without resetting or reimporting.
|
|
143
159
|
|
|
144
160
|
```sh
|
|
@@ -26,7 +26,7 @@ export default function Watch(props: Props) {
|
|
|
26
26
|
| Sources, lifecycle, transport and errors | [Playback](playback.md) |
|
|
27
27
|
| Remote keys, auto-hide, scrubbing, speed, fit and controls | [Controls](controls.md) |
|
|
28
28
|
| Audio, sidecar subtitles and subtitle styling | [Tracks and subtitles](tracks-subtitles.md) |
|
|
29
|
-
| Live streams and DVR limitations | [Live and DVR](live-dvr.md) |
|
|
29
|
+
| Live streams, optional viewer counts and DVR limitations | [Live and DVR](live-dvr.md) |
|
|
30
30
|
| Protected media and license ownership | [DRM](drm.md) |
|
|
31
31
|
| Sender state, receivers and output selection | [Casting](casting.md) |
|
|
32
32
|
| Task lifecycle and local playback | [Downloads](downloads.md) |
|
|
@@ -1,33 +1,74 @@
|
|
|
1
1
|
# Live streams and DVR
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
Select the current library row by ID. For a `mediaType: "live"` item, use
|
|
4
|
+
`useVideoPlayer(undefined, { entryId })` and mount its `VideoView` only when the
|
|
5
|
+
viewer chooses to watch. Live rows do not need a catalogue `playbackSource`.
|
|
6
|
+
The runtime obtains and renews finite playback authority for the current app,
|
|
7
|
+
entry and broadcast. It handles free guest viewing and private preview access;
|
|
8
|
+
authored code does not call admission endpoints, persist operation IDs, construct
|
|
9
|
+
HLS URLs or schedule renewal requests.
|
|
10
|
+
|
|
11
|
+
Use `live.state` for Live now, Upcoming and Offline labels. An upcoming
|
|
12
|
+
announcement can supply `startsAtText`, formatted in its time zone and the
|
|
13
|
+
viewer's language. Offer Watch live only for an on-air row with open access;
|
|
14
|
+
preserve the normal sign-in or unlock flow for restricted content. Catalogue
|
|
15
|
+
refreshes preserve selection and must not trigger playback. The runtime refreshes
|
|
16
|
+
live metadata while the app is active and on resume, so library reducers should
|
|
17
|
+
retain ready data during refresh.
|
|
18
|
+
|
|
19
|
+
An offline title cannot start a new session. An already admitted broadcast may
|
|
20
|
+
continue under its existing completion policy while authority remains valid.
|
|
21
|
+
Current access refusal, expiry, deletion or broadcast replacement stops playback.
|
|
22
|
+
Never bypass a refused grant or substitute another title. Source replacement
|
|
23
|
+
during renewal does not guarantee seamless buffer preservation.
|
|
24
|
+
|
|
25
|
+
Live playback does not save VOD progress, resume a saved position, mark completion,
|
|
26
|
+
auto-advance or download. A saved recording is ordinary VOD. Hide timelines,
|
|
27
|
+
scrub previews and seek controls for live playback. The player exposes no live
|
|
28
|
+
edge, seekable DVR range or dedicated go-live command; do not infer these from a
|
|
29
|
+
finite duration or encoder settings. Follow [controls](controls.md) for supported
|
|
30
|
+
input and [playback](playback.md) for recovery.
|
|
22
31
|
|
|
23
32
|
```tsx
|
|
24
33
|
import { Screen, VideoView, Text, Pressable, useVideoPlayer } from "@adelin/ui";
|
|
25
|
-
|
|
26
|
-
interface Props { source?: VideoSource }
|
|
34
|
+
interface Props { entryId: string }
|
|
27
35
|
export default function Live(props: Props) {
|
|
28
|
-
const player = useVideoPlayer(props.
|
|
36
|
+
const player = useVideoPlayer(undefined, { entryId: props.entryId });
|
|
29
37
|
return <Screen><VideoView player={player} style={{ flex: 1 }} />
|
|
30
38
|
<Pressable onPress={() => player.togglePlay()}><Text>{player.playing ? "Pause" : "Play"}</Text></Pressable>
|
|
31
39
|
</Screen>;
|
|
32
40
|
}
|
|
33
41
|
```
|
|
42
|
+
|
|
43
|
+
## Optional viewer counts
|
|
44
|
+
|
|
45
|
+
Use `useLiveViewers(entryId, { enabled })` from `@adelin/content` when the builder
|
|
46
|
+
wants a watching annotation on a live title or player. Call it unconditionally;
|
|
47
|
+
use `enabled` to limit it to the title being shown. The runtime shares polling
|
|
48
|
+
between components, pauses it when the screen or app is inactive, and handles
|
|
49
|
+
guest, signed-in and private-preview authority. Do not write polling timers or
|
|
50
|
+
call count endpoints from authored code. Reading a count does not start playback.
|
|
51
|
+
|
|
52
|
+
The result has `state`, `count` and `observedAt`. Show a current annotation only
|
|
53
|
+
for `fresh`; zero is a valid count. `stale` is an older observation and may be
|
|
54
|
+
shown only with wording such as “Recently … watching”. Hide the annotation for
|
|
55
|
+
`idle`, `loading`, `hidden` and `unavailable`; their count is `null`, not zero.
|
|
56
|
+
The creator's visibility setting is authoritative. Do not substitute a creator
|
|
57
|
+
tool's count when the app returns `hidden`.
|
|
58
|
+
|
|
59
|
+
Counts are concurrent viewers reported by the streaming provider. They are not
|
|
60
|
+
an exact count of people using this app. The runtime ages observations without
|
|
61
|
+
depending on the device's wall clock and removes expired or refused data.
|
|
62
|
+
This binding is available on the web and native app runtimes; Roku is not covered.
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
import { Text } from "@adelin/ui";
|
|
66
|
+
import { useLiveViewers } from "@adelin/content";
|
|
67
|
+
interface Props { entryId: string; visible: boolean }
|
|
68
|
+
export default function Watching(props: Props) {
|
|
69
|
+
const viewers = useLiveViewers(props.entryId, { enabled: props.visible });
|
|
70
|
+
return viewers.state === "fresh" && viewers.count !== null
|
|
71
|
+
? <Text>{viewers.count} watching</Text>
|
|
72
|
+
: null;
|
|
73
|
+
}
|
|
74
|
+
```
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Pass a library item's `playbackSource` to `useVideoPlayer`. Do not reconstruct its
|
|
4
4
|
URL, remove query parameters or add request headers. An undefined source waits
|
|
5
|
-
for content
|
|
5
|
+
for content unless `entryId` selects a current live title as described in
|
|
6
|
+
[Live streams and DVR](live-dvr.md); never substitute sample media. The runtime keeps
|
|
6
7
|
credential renewals on the same media identity and disposes an outgoing engine
|
|
7
8
|
when that identity changes or its view unmounts.
|
|
8
9
|
|
|
@@ -12,7 +13,7 @@ are handler commands. `stop()` stops playback; it is not a casting disconnect.
|
|
|
12
13
|
Do not keep a parallel playback clock. Read the formatted time and scrub fields
|
|
13
14
|
described in [controls](controls.md).
|
|
14
15
|
|
|
15
|
-
Pass `entryId` for a library title.
|
|
16
|
+
Pass `entryId` for a library title. For VOD with a signed-in viewer, the runtime selects
|
|
16
17
|
the chosen profile or its default, resumes the saved place and saves progress on
|
|
17
18
|
pause, end, close, background and every five minutes of playback. Leave `entryId`
|
|
18
19
|
off for trailers and previews. The app reads saved history through
|
|
@@ -202,7 +202,9 @@ platforms the builder requested. Keep device frames when chosen. Label every fra
|
|
|
202
202
|
screen and alternative, for example “TV · Home · B” or “Phone · Sign-in · A”, so feedback identifies
|
|
203
203
|
an exact design. A TV group must contain TV-oriented layouts and sign-in, never a phone form
|
|
204
204
|
relabelled as TV. Use platform-specific frame styles; resizing the surrounding board must not turn
|
|
205
|
-
a TV frame into a phone layout. The
|
|
205
|
+
a TV frame into a phone layout. The viewer supplies Fit all, zoom and pan for the complete board;
|
|
206
|
+
keep device frames at their intended logical sizes and let the builder zoom in to inspect them.
|
|
207
|
+
Do not add your own navigation script or shrink every screen to fit the builder's browser window.
|
|
206
208
|
Show the alternatives together, without separate simulated device viewports or a static viewport
|
|
207
209
|
picker. Keep every frame readable rather than shrinking the entire board to one device's size.
|
|
208
210
|
|
|
@@ -12,7 +12,7 @@ component.
|
|
|
12
12
|
- `@adelin/store`: useSelector, useDispatch, createSlice, createAsyncThunk, appDispatch
|
|
13
13
|
- `@adelin/auth`: useAuth, signIn, signUp, signOut, requestPasswordRecovery, completePasswordRecovery, addPasswordLoginMethod, addProviderLoginMethod, deleteAccount, setMarketingConsent, signInWithProvider
|
|
14
14
|
- `@adelin/access`: useAccess, subscribe, startTrial, buy, rent, restorePurchases, manageSubscription
|
|
15
|
-
- `@adelin/content`: content, useSearch
|
|
15
|
+
- `@adelin/content`: content, useSearch, useLiveViewers
|
|
16
16
|
- `@adelin/utils`: formatDate, uniqueBy
|
|
17
17
|
- `@adelin/storage`: storage
|
|
18
18
|
- `@adelin/device`: useConnectivity, useAppMode, appMode, useTVEventHandler, useBackHandler, Keys, exitApp, BackHandler, TVEventControl, DeviceInfo, Platform, capabilities
|
|
@@ -48,7 +48,7 @@ declare module "@adelin/content" {
|
|
|
48
48
|
entryId: string;
|
|
49
49
|
state: "live" | "offline";
|
|
50
50
|
broadcastId: string | null;
|
|
51
|
-
announcement: { startsAt: string; timeZone: string } | null;
|
|
51
|
+
announcement: { startsAt: string; timeZone: string; startsAtText?: string } | null;
|
|
52
52
|
}
|
|
53
53
|
/** One title's access, decided by the server; `@adelin/access` re-exports it. */
|
|
54
54
|
export interface ContentItemAccess {
|
|
@@ -93,6 +93,14 @@ declare module "@adelin/content" {
|
|
|
93
93
|
artwork: { poster?: string; backdrop?: string };
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
export interface LiveViewersState {
|
|
97
|
+
state: 'idle' | 'loading' | 'fresh' | 'stale' | 'unavailable' | 'hidden';
|
|
98
|
+
count: number | null;
|
|
99
|
+
observedAt: string | null;
|
|
100
|
+
}
|
|
101
|
+
/** Optional provider concurrent viewer observation while the screen is active; native and web only. */
|
|
102
|
+
export function useLiveViewers(entryId: string | null | undefined, options?: { enabled?: boolean }): LiveViewersState;
|
|
103
|
+
|
|
96
104
|
export const content: {
|
|
97
105
|
/** Loads the app's content rows. */
|
|
98
106
|
list(): Promise<ContentItem[]>;
|
package/types/adelin-ui.d.ts
CHANGED
|
@@ -1510,7 +1510,7 @@ declare module "@adelin/ui" {
|
|
|
1510
1510
|
export const ScrollTarget: (props: { y: number; children: CatalogChildren }) => ReactNode;
|
|
1511
1511
|
export const Portal: (props: { open: boolean; onClose?: () => void; children?: CatalogChildren }) => ReactNode;
|
|
1512
1512
|
// --- Video ---
|
|
1513
|
-
/** A player to show with <VideoView player={player} />; undefined source
|
|
1513
|
+
/** A player to show with <VideoView player={player} />; undefined source with entryId selects a current live title; otherwise it idles; the app maps remote keys with useTVEventHandler and calls player.scrubForward()/scrubBackward(); autoHideControls: true hides controlsVisible after 4 s of playback without input; scrub tunes the tap step, hold tiers, repeat and commit timing, and pause/resume (resume: false keeps it paused after the seek); entryId resumes and saves the active profile's VOD watch progress; live playback has no saved progress. */
|
|
1514
1514
|
export function useVideoPlayer(
|
|
1515
1515
|
source: VideoSource | undefined,
|
|
1516
1516
|
options?: { autoPlay?: boolean; loop?: boolean; muted?: boolean; autoHideControls?: boolean; scrub?: { step?: number; hold?: { after: number; step: number }[]; repeatMs?: number; commitMs?: number; pause?: boolean; resume?: number | false }; entryId?: string },
|