@adelin-io/cli 0.0.0-stage → 0.1.1
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 +76 -2
- package/authoring-release.json +174 -0
- package/package.json +30 -4
- package/runtime-integrity.json +9 -0
- package/scripts/adelin.mjs +7768 -0
- package/scripts/assemble-checkout.mjs +93 -0
- package/scripts/local-save.mjs +513 -0
- package/scripts/materialize.mjs +319 -0
- package/scripts/runtime.mjs +8950 -0
- package/scripts/typecheck.mjs +72 -0
- package/scripts/workspace-state.mjs +183 -0
- package/skill/README.md +77 -0
- package/skill/SKILL.md +100 -0
- package/skill/authoring/access.md +193 -0
- package/skill/authoring/analytics.md +20 -0
- package/skill/authoring/app-memory.md +128 -0
- package/skill/authoring/app-requirements.md +99 -0
- package/skill/authoring/app-structure.md +265 -0
- package/skill/authoring/assets.md +117 -0
- package/skill/authoring/auth.md +263 -0
- package/skill/authoring/content-binding.md +26 -0
- package/skill/authoring/i18n.md +184 -0
- package/skill/authoring/language.md +503 -0
- package/skill/authoring/local-workflow.md +1667 -0
- package/skill/authoring/offline/connectivity.md +50 -0
- package/skill/authoring/offline/example.md +102 -0
- package/skill/authoring/offline/history-sync.md +39 -0
- package/skill/authoring/offline/index.md +29 -0
- package/skill/authoring/offline/package-storage.md +37 -0
- package/skill/authoring/offline/platforms.md +35 -0
- package/skill/authoring/offline/startup-navigation.md +53 -0
- package/skill/authoring/platform-files.md +616 -0
- package/skill/authoring/player/casting.md +47 -0
- package/skill/authoring/player/controls.md +95 -0
- package/skill/authoring/player/downloads.md +90 -0
- package/skill/authoring/player/drm.md +31 -0
- package/skill/authoring/player/index.md +39 -0
- package/skill/authoring/player/live-dvr.md +74 -0
- package/skill/authoring/player/platforms.md +47 -0
- package/skill/authoring/player/playback.md +43 -0
- package/skill/authoring/player/tracks-subtitles.md +32 -0
- package/skill/authoring/profiles.md +213 -0
- package/skill/authoring/remote-keys.md +139 -0
- package/skill/authoring/search.md +27 -0
- package/skill/authoring/store.md +85 -0
- package/skill/authoring/tv-text-entry.md +146 -0
- package/skill/design/approved/README.md +14 -0
- package/skill/design/approved/vesper-phone-home.jpg +0 -0
- package/skill/design/approved/vesper-tv-detail.jpg +0 -0
- package/skill/design/approved/vesper-tv-home.jpg +0 -0
- package/skill/design/design-guide.md +610 -0
- package/skill/design/edge-to-edge.md +66 -0
- package/skill/design/icons.md +50 -0
- package/skill/design/responsive-layout.md +175 -0
- package/skill/design/safe-area.md +221 -0
- package/skill/design/streaming-playbook.md +131 -0
- package/skill/design/visual-review.md +150 -0
- package/skill/examples/README.md +24 -0
- package/skill/examples/cinema/DESIGN.md +58 -0
- package/skill/examples/cinema/app.tsx +17 -0
- package/skill/examples/cinema/assets/logo.png +0 -0
- package/skill/examples/cinema/components/Action.tsx +40 -0
- package/skill/examples/cinema/components/Action.tv.tsx +44 -0
- package/skill/examples/cinema/components/CatalogGrid.tsx +31 -0
- package/skill/examples/cinema/components/ContinueRail.tsx +98 -0
- package/skill/examples/cinema/components/Feedback.tsx +28 -0
- package/skill/examples/cinema/components/Field.tsx +41 -0
- package/skill/examples/cinema/components/LibraryRail.tsx +46 -0
- package/skill/examples/cinema/components/PlayAction.tsx +29 -0
- package/skill/examples/cinema/components/Root.tsx +59 -0
- package/skill/examples/cinema/components/Shell.tsx +70 -0
- package/skill/examples/cinema/components/Tab.tsx +22 -0
- package/skill/examples/cinema/components/TitleCard.tsx +68 -0
- package/skill/examples/cinema/components/TitleMeta.tsx +36 -0
- package/skill/examples/cinema/locales/en.ts +211 -0
- package/skill/examples/cinema/locales/lt.ts +211 -0
- package/skill/examples/cinema/preview/phone-home.jpg +0 -0
- package/skill/examples/cinema/preview/tv-detail.jpg +0 -0
- package/skill/examples/cinema/preview/tv-home.jpg +0 -0
- package/skill/examples/cinema/screens/portrait/Account.tsx +110 -0
- package/skill/examples/cinema/screens/portrait/Browse.tsx +73 -0
- package/skill/examples/cinema/screens/portrait/Detail.tsx +159 -0
- package/skill/examples/cinema/screens/portrait/Home.tsx +196 -0
- package/skill/examples/cinema/screens/portrait/Player.tsx +299 -0
- package/skill/examples/cinema/screens/portrait/Search.tsx +46 -0
- package/skill/examples/cinema/screens/portrait/Search.tv.tsx +55 -0
- package/skill/examples/cinema/screens/portrait/SignIn.tsx +101 -0
- package/skill/examples/cinema/screens/portrait/SignUp.tsx +106 -0
- package/skill/examples/cinema/store.tsx +132 -0
- package/skill/examples/cinema/theme.ts +32 -0
- package/skill/examples/documentary/DESIGN.md +33 -0
- package/skill/examples/documentary/app.tsx +17 -0
- package/skill/examples/documentary/components/Action.tsx +43 -0
- package/skill/examples/documentary/components/CatalogGrid.tsx +47 -0
- package/skill/examples/documentary/components/Feedback.tsx +27 -0
- package/skill/examples/documentary/components/Field.tsx +33 -0
- package/skill/examples/documentary/components/LibraryRail.tsx +47 -0
- package/skill/examples/documentary/components/Root.tsx +62 -0
- package/skill/examples/documentary/components/Shell.tsx +93 -0
- package/skill/examples/documentary/components/StoryCard.tsx +53 -0
- package/skill/examples/documentary/components/StoryMeta.tsx +22 -0
- package/skill/examples/documentary/preview/phone-home.jpg +0 -0
- package/skill/examples/documentary/preview/tv-detail.jpg +0 -0
- package/skill/examples/documentary/preview/tv-home.jpg +0 -0
- package/skill/examples/documentary/screens/portrait/Account.tsx +97 -0
- package/skill/examples/documentary/screens/portrait/Browse.tsx +71 -0
- package/skill/examples/documentary/screens/portrait/Detail.tsx +133 -0
- package/skill/examples/documentary/screens/portrait/Home.tsx +89 -0
- package/skill/examples/documentary/screens/portrait/Player.tsx +116 -0
- package/skill/examples/documentary/screens/portrait/Search.tsx +48 -0
- package/skill/examples/documentary/screens/portrait/SignIn.tsx +96 -0
- package/skill/examples/documentary/screens/portrait/SignUp.tsx +101 -0
- package/skill/examples/documentary/store.tsx +115 -0
- package/skill/examples/documentary/theme.ts +20 -0
- package/skill/examples/series/DESIGN.md +55 -0
- package/skill/examples/series/app.tsx +17 -0
- package/skill/examples/series/components/Action.tsx +42 -0
- package/skill/examples/series/components/CatalogGrid.tsx +43 -0
- package/skill/examples/series/components/ContinueRail.tsx +78 -0
- package/skill/examples/series/components/Feedback.tsx +26 -0
- package/skill/examples/series/components/Field.tsx +34 -0
- package/skill/examples/series/components/LibraryRail.tsx +38 -0
- package/skill/examples/series/components/OutcomeNote.tsx +28 -0
- package/skill/examples/series/components/PlayAction.tsx +29 -0
- package/skill/examples/series/components/RestoreAction.tsx +33 -0
- package/skill/examples/series/components/Root.tsx +75 -0
- package/skill/examples/series/components/SaveTitle.tsx +34 -0
- package/skill/examples/series/components/Shell.tsx +75 -0
- package/skill/examples/series/components/TitleCard.tsx +62 -0
- package/skill/examples/series/components/UnlockAction.tsx +10 -0
- package/skill/examples/series/preview/phone-home.jpg +0 -0
- package/skill/examples/series/preview/tv-detail.jpg +0 -0
- package/skill/examples/series/preview/tv-home.jpg +0 -0
- package/skill/examples/series/screens/portrait/Account.tsx +125 -0
- package/skill/examples/series/screens/portrait/Browse.tsx +61 -0
- package/skill/examples/series/screens/portrait/Detail.tsx +231 -0
- package/skill/examples/series/screens/portrait/Home.tsx +109 -0
- package/skill/examples/series/screens/portrait/MyList.tsx +44 -0
- package/skill/examples/series/screens/portrait/Plans.tsx +131 -0
- package/skill/examples/series/screens/portrait/Player.tsx +138 -0
- package/skill/examples/series/screens/portrait/Profiles.tsx +103 -0
- package/skill/examples/series/screens/portrait/Search.tsx +50 -0
- package/skill/examples/series/screens/portrait/SignIn.tsx +94 -0
- package/skill/examples/series/screens/portrait/SignUp.tsx +100 -0
- package/skill/examples/series/store.tsx +192 -0
- package/skill/examples/series/theme.ts +32 -0
- package/skill/guides/final-pricing-capabilities.md +13 -0
- package/skill/reference/api.md +842 -0
- package/skill/reference/components.md +1782 -0
- package/skill/reference/packages.md +24 -0
- package/skill/scripts/assemble-checkout.mjs +93 -0
- package/skill/scripts/local-save.mjs +513 -0
- package/skill/scripts/materialize.mjs +319 -0
- package/skill/scripts/workspace-state.mjs +183 -0
- package/types/adelin-access.d.ts +70 -0
- package/types/adelin-analytics.d.ts +5 -0
- package/types/adelin-assets.d.ts +26 -0
- package/types/adelin-auth.d.ts +37 -0
- package/types/adelin-content.d.ts +120 -0
- package/types/adelin-device.d.ts +195 -0
- package/types/adelin-downloads.d.ts +47 -0
- package/types/adelin-env.d.ts +8 -0
- package/types/adelin-globals.d.ts +19 -0
- package/types/adelin-i18n.d.ts +31 -0
- package/types/adelin-native-stack.d.ts +178 -0
- package/types/adelin-navigation.d.ts +264 -0
- package/types/adelin-profiles.d.ts +51 -0
- package/types/adelin-react.d.ts +49 -0
- package/types/adelin-reanimated.d.ts +376 -0
- package/types/adelin-storage.d.ts +9 -0
- package/types/adelin-store.d.ts +74 -0
- package/types/adelin-ui.d.ts +1518 -0
- package/types/adelin-utils.d.ts +7 -0
- package/types/adelin-worklets.d.ts +15 -0
- package/workspace-tsconfig.json +53 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Connectivity and explicit mode selection
|
|
2
|
+
|
|
3
|
+
`useConnectivity()` from `@adelin/device` returns an immutable `{ state }`, where
|
|
4
|
+
`state` is `online`, `offline` or `unknown`. This observes the device connection;
|
|
5
|
+
it does not guarantee that every server is reachable. Subscribing adds no
|
|
6
|
+
behavior of its own.
|
|
7
|
+
|
|
8
|
+
`useAppMode()` returns `{ mode, offlineAvailable }`. `mode` is `online` or
|
|
9
|
+
`offline`; `offlineAvailable` reports whether the current runtime has prepared a
|
|
10
|
+
local offline definition. It does not promise that every video is downloaded or
|
|
11
|
+
that every downloaded license remains usable.
|
|
12
|
+
|
|
13
|
+
An explicit action `appMode.switchTo('offline')` opens the configured offline
|
|
14
|
+
entry, if its package is ready. `appMode.switchTo('online')` resolves the online
|
|
15
|
+
app. This deliberate graph change starts at that graph's entry; Back cannot cross
|
|
16
|
+
between the two graphs. An unavailable switch keeps the active graph. The
|
|
17
|
+
promise returns `{ outcome: 'switched' | 'unavailable' | 'failed' }`, which can be
|
|
18
|
+
awaited in a store thunk to present feedback chosen by the builder.
|
|
19
|
+
|
|
20
|
+
For a builder-requested Downloads mode button:
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { Screen, Text, Pressable } from '@adelin/ui';
|
|
24
|
+
import { useAppMode, appMode } from '@adelin/device';
|
|
25
|
+
|
|
26
|
+
export default function OfflineChoice() {
|
|
27
|
+
const state = useAppMode();
|
|
28
|
+
return <Screen>
|
|
29
|
+
{state.offlineAvailable && <Pressable onPress={() => appMode.switchTo('offline')}>
|
|
30
|
+
<Text>Open downloads</Text>
|
|
31
|
+
</Pressable>}
|
|
32
|
+
</Screen>;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Connection changes during a session
|
|
37
|
+
|
|
38
|
+
Connection loss or recovery alone never selects a graph. An already-open screen,
|
|
39
|
+
navigation stack and player remain in place; the runtime adds no banner, modal,
|
|
40
|
+
redirect or navigation change. Add connection-loss UI or reactions only when the
|
|
41
|
+
builder asks for them. Reconnection may refresh content and reconcile watch
|
|
42
|
+
history without restarting the screen. Streaming continues only while its
|
|
43
|
+
existing buffer permits; no automatic remote-to-local source handoff is implied.
|
|
44
|
+
Completed downloads use their opaque local playback source.
|
|
45
|
+
|
|
46
|
+
## Preview
|
|
47
|
+
|
|
48
|
+
In an admitted preview, the explicit `appMode.switchTo` action inspects the
|
|
49
|
+
separate offline graph in memory. It does not prepare a durable preview. See
|
|
50
|
+
[platform limits](platforms.md) for the capability boundary.
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# A complete offline route graph
|
|
2
|
+
|
|
3
|
+
Keep the existing online `components/App.tsx`. These five files add a separate
|
|
4
|
+
Downloads → local details → player flow. The example uses entry ids as minimal
|
|
5
|
+
labels; use the cached catalogue for the app's title labels and artwork. Refine
|
|
6
|
+
the visual design with the builder. This example adds no pricing or eligibility
|
|
7
|
+
rule.
|
|
8
|
+
|
|
9
|
+
### app.tsx
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import {defineApp} from '@adelin/navigation';
|
|
13
|
+
import App from './components/App';
|
|
14
|
+
import OfflineApp from './components/OfflineApp';
|
|
15
|
+
export default defineApp({name:'My app',version:'1',root:App,offline:{root:OfflineApp}});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### components/OfflineApp.tsx
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import {createNativeStackNavigator} from '@adelin/native-stack';
|
|
22
|
+
import OfflineDownloads from '../screens/OfflineDownloads';
|
|
23
|
+
import OfflineDetails from '../screens/OfflineDetails';
|
|
24
|
+
import OfflineWatch from '../screens/OfflineWatch';
|
|
25
|
+
const Stack=createNativeStackNavigator();
|
|
26
|
+
export default function OfflineApp(){
|
|
27
|
+
return <Stack.Navigator initialRouteName="OfflineDownloads">
|
|
28
|
+
<Stack.Screen name="OfflineDownloads" component={OfflineDownloads}/>
|
|
29
|
+
<Stack.Screen name="OfflineDetails" component={OfflineDetails}/>
|
|
30
|
+
<Stack.Screen name="OfflineWatch" component={OfflineWatch}/>
|
|
31
|
+
</Stack.Navigator>;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### screens/OfflineDownloads.tsx
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import {Screen,Text,Pressable} from '@adelin/ui';
|
|
39
|
+
import {useDownloads} from '@adelin/downloads';
|
|
40
|
+
import {appNavigation} from '@adelin/navigation';
|
|
41
|
+
export default function OfflineDownloads(){
|
|
42
|
+
const files=useDownloads();
|
|
43
|
+
return <Screen>
|
|
44
|
+
<Text>Downloads</Text>
|
|
45
|
+
{files.loading&&<Text>Loading downloads…</Text>}
|
|
46
|
+
{!files.loading&&!files.supported&&<Text>Downloads are unavailable on this device.</Text>}
|
|
47
|
+
{!files.loading&&files.supported&&files.tasks.length===0&&<Text>No downloads saved on this device.</Text>}
|
|
48
|
+
{files.tasks.map(task=><Pressable key={task.id}
|
|
49
|
+
onPress={()=>appNavigation.push('OfflineDetails',{taskId:task.id})}>
|
|
50
|
+
<Text>{task.entryId}</Text><Text>{task.status}</Text>
|
|
51
|
+
</Pressable>)}
|
|
52
|
+
</Screen>;
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### screens/OfflineDetails.tsx
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import {Screen,Text,Pressable} from '@adelin/ui';
|
|
60
|
+
import {useDownloads} from '@adelin/downloads';
|
|
61
|
+
import {appNavigation,useRoute} from '@adelin/navigation';
|
|
62
|
+
export default function OfflineDetails(){
|
|
63
|
+
const route=useRoute();
|
|
64
|
+
const files=useDownloads();
|
|
65
|
+
const task=files.tasks.find(item=>item.id===route.params.taskId);
|
|
66
|
+
return <Screen>
|
|
67
|
+
<Text>{task?.entryId??'Download unavailable'}</Text>
|
|
68
|
+
{task?.playable&&<Pressable
|
|
69
|
+
onPress={()=>appNavigation.push('OfflineWatch',{taskId:task.id})}>
|
|
70
|
+
<Text>Watch download</Text>
|
|
71
|
+
</Pressable>}
|
|
72
|
+
{!task?.playable&&<Text>This download cannot play right now.</Text>}
|
|
73
|
+
<Pressable onPress={()=>appNavigation.goBack()}><Text>Back</Text></Pressable>
|
|
74
|
+
</Screen>;
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### screens/OfflineWatch.tsx
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import {Screen,Text,Pressable,VideoView,useVideoPlayer,StyleSheet} from '@adelin/ui';
|
|
82
|
+
import {useDownloads} from '@adelin/downloads';
|
|
83
|
+
import {appNavigation,useRoute} from '@adelin/navigation';
|
|
84
|
+
export default function OfflineWatch(){
|
|
85
|
+
const route=useRoute();
|
|
86
|
+
const files=useDownloads();
|
|
87
|
+
const task=files.tasks.find(item=>item.id===route.params.taskId);
|
|
88
|
+
const player=useVideoPlayer(task?.playbackSource,{entryId:task?.entryId});
|
|
89
|
+
return <Screen>
|
|
90
|
+
{task?.playbackSource?<VideoView player={player} style={styles.video}/>:<Text>This download is not playable.</Text>}
|
|
91
|
+
<Pressable onPress={()=>player.togglePlay()}><Text>{player.playing?'Pause':'Play'}</Text></Pressable>
|
|
92
|
+
<Text>{player.elapsedText}</Text>
|
|
93
|
+
<Pressable onPress={()=>appNavigation.goBack()}><Text>Back</Text></Pressable>
|
|
94
|
+
</Screen>;
|
|
95
|
+
}
|
|
96
|
+
const styles=StyleSheet.create({video:{flex:1}});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The runtime writes watch history automatically from `entryId`. Every navigation
|
|
100
|
+
target above belongs to this offline graph. The online Home, sign-in, purchases
|
|
101
|
+
and remote search are deliberately absent from this path; add another local route
|
|
102
|
+
only when it has a complete offline implementation.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Offline watch history
|
|
2
|
+
|
|
3
|
+
The runtime automatically resumes and saves a Player with an `entryId`, including
|
|
4
|
+
pause, background and screen departure. Use the normal profile progress selectors
|
|
5
|
+
for Resume, Continue Watching and watched indicators. Do not add timers or an
|
|
6
|
+
authored save-position action. See [profiles and progress](../profiles.md).
|
|
7
|
+
|
|
8
|
+
In an app with offline support, history writes settle after durable local storage
|
|
9
|
+
succeeds. Pending progress and watched changes survive restarting the app. Storage
|
|
10
|
+
failure is an error; it must not be presented as saved. Downloads and app artwork
|
|
11
|
+
preparation do not discard pending history to make room.
|
|
12
|
+
|
|
13
|
+
Local history belongs to the saved library's app, account and selected profile,
|
|
14
|
+
even while signed out. A local video resumes the bookmark for its media identity. Switching profiles does not borrow
|
|
15
|
+
another profile's progress; signing out does not upload an old viewer's queue as
|
|
16
|
+
a new viewer. Offline profile selection needs a prepared offline package for that
|
|
17
|
+
profile. Wait for a profile selection to settle before requesting another profile
|
|
18
|
+
or app-mode change; overlapping requests fail with `PROFILE_SELECTION_PENDING`.
|
|
19
|
+
Profile editing and favorites require a connection.
|
|
20
|
+
|
|
21
|
+
Continue Watching overlays local changes on the last known server state. Finishing
|
|
22
|
+
an episode advances to the next playable episode in catalogue order; finishing the
|
|
23
|
+
last episode does not resurrect an earlier bookmark. Clearing progress clears the
|
|
24
|
+
title's bookmarks while preserving explicit watched marks.
|
|
25
|
+
|
|
26
|
+
When connectivity returns, upload waits for the saved library's account to be
|
|
27
|
+
authenticated and authorized online. A signed-out session or a different signed-in
|
|
28
|
+
account leaves the queue local. Temporary app-verification/network/server failures
|
|
29
|
+
retain the queue and retry automatically with bounded backoff. An authentication
|
|
30
|
+
refusal during app verification pauses replay without interrupting local playback.
|
|
31
|
+
Do not add polling timers or discard pending progress to handle those states.
|
|
32
|
+
Conditional replay protects newer server history.
|
|
33
|
+
Each local change is judged on the server state it was made on: changes the
|
|
34
|
+
device made in a row keep applying, while a change from another device made
|
|
35
|
+
after that state wins over stale offline changes. A change made with no known
|
|
36
|
+
server state is discarded on reconnect rather than overwriting server history. Replays
|
|
37
|
+
retain their operation identity across retries, so a lost response cannot apply
|
|
38
|
+
the same action twice. Replay needs no screen of its own; see
|
|
39
|
+
[connectivity](connectivity.md#connection-changes-during-a-session).
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Offline app mode
|
|
2
|
+
|
|
3
|
+
Downloaded videos and offline app startup are separate capabilities. A download
|
|
4
|
+
does not create an offline app definition. Without an explicit offline app entry,
|
|
5
|
+
a cold launch needs a connection and offers Retry when disconnected.
|
|
6
|
+
|
|
7
|
+
An offline app needs a separate self-contained entry and local navigation path.
|
|
8
|
+
Opt in with `defineApp({ ..., offline: { root: OfflineApp } })`. See
|
|
9
|
+
[startup and navigation](startup-navigation.md) for the separate entry and route
|
|
10
|
+
graph. Do not reuse the ordinary cached app as an implicit fallback.
|
|
11
|
+
|
|
12
|
+
Connection changes during a session follow
|
|
13
|
+
[connectivity](connectivity.md#connection-changes-during-a-session). Download
|
|
14
|
+
eligibility and pricing remain authored-app choices as described in
|
|
15
|
+
[downloads](../player/downloads.md).
|
|
16
|
+
|
|
17
|
+
See [package preparation and storage](package-storage.md) for completeness, local
|
|
18
|
+
artwork, identity scope and the distinction between downloaded media and a ready
|
|
19
|
+
offline app.
|
|
20
|
+
|
|
21
|
+
See [connectivity and explicit mode selection](connectivity.md) for observational
|
|
22
|
+
state and builder-requested switches between the two graphs.
|
|
23
|
+
|
|
24
|
+
See [offline watch history](history-sync.md) for automatic durable progress, local
|
|
25
|
+
Resume and conditional replay after reconnecting.
|
|
26
|
+
|
|
27
|
+
See [platform limits](platforms.md) for browser shell readiness, TV and ephemeral
|
|
28
|
+
preview inspection, and the [complete route example](example.md) for Downloads,
|
|
29
|
+
local details and a player.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Preparing a local offline package
|
|
2
|
+
|
|
3
|
+
An offline app uses its own complete definition, theme, translations, navigation
|
|
4
|
+
and safe catalogue metadata. The runtime prepares that package after an eligible
|
|
5
|
+
online session. It does not download every video or cache the ordinary online
|
|
6
|
+
Home as a substitute for an authored offline entry.
|
|
7
|
+
|
|
8
|
+
Preparation keeps required UI artwork and available downloaded-title artwork
|
|
9
|
+
locally. Optional missing images use a local placeholder. A missing required
|
|
10
|
+
resource, interrupted write or full storage cannot replace the previous usable
|
|
11
|
+
package. Do not tell a viewer that offline startup is ready merely because an
|
|
12
|
+
individual video finished downloading: browser startup also needs a prepared
|
|
13
|
+
runtime shell.
|
|
14
|
+
|
|
15
|
+
Publishing prepares a separate offline definition for each orientation and platform.
|
|
16
|
+
An incomplete offline definition prevents publication. A draft may keep previewing
|
|
17
|
+
the online app while its offline definition is still incomplete.
|
|
18
|
+
|
|
19
|
+
Packages are stored by app, release channel, saved account/profile, platform, form
|
|
20
|
+
factor and locale. Offline startup selects the last successfully prepared local
|
|
21
|
+
library even when signed out. Account/profile metadata keeps files and progress
|
|
22
|
+
associated with that library; it is not an authentication gate. Switching local
|
|
23
|
+
profiles requires a complete package for that profile. Signing out or receiving
|
|
24
|
+
an online authentication refusal does not remove local Downloads. Network
|
|
25
|
+
credentials, source headers and remote media/license grants stay outside offline
|
|
26
|
+
JSON.
|
|
27
|
+
|
|
28
|
+
Removing offline support blocks future cached launches. A browser's already-open
|
|
29
|
+
offline graph keeps its validated package artwork until the viewer leaves that
|
|
30
|
+
graph or closes the app, including if the browser restarts an idle service worker.
|
|
31
|
+
A failed or timed-out local profile change keeps the current graph and its
|
|
32
|
+
artwork usable. Only a successfully activated replacement retires that binding.
|
|
33
|
+
|
|
34
|
+
Remote video URLs are not downloaded sources. Use the opaque completed task's
|
|
35
|
+
`playbackSource` from [downloads](../player/downloads.md) for local playback.
|
|
36
|
+
Respect technical storage, source and license failures. Download eligibility,
|
|
37
|
+
pricing and subscription rules remain the builder's authored choices.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Offline platform limits
|
|
2
|
+
|
|
3
|
+
Native apps already contain their runtime JavaScript. A ready offline package
|
|
4
|
+
still needs its complete definition and required artwork on this device.
|
|
5
|
+
Downloaded media remains in the supported native engine's storage. Protected
|
|
6
|
+
playback depends on the actual stored license; unknown expiry does not mean a
|
|
7
|
+
permanent license.
|
|
8
|
+
|
|
9
|
+
A browser also needs a cached runtime shell. Preparation requires a secure,
|
|
10
|
+
top-level runtime with a service worker, IndexedDB, Cache Storage and Web Locks.
|
|
11
|
+
If those are unavailable or the shell cannot be prepared, `offlineAvailable`
|
|
12
|
+
remains false. JSON saved by itself is not proof of a usable cold offline launch.
|
|
13
|
+
The runtime caches only its build's hashed public files; app definitions, account
|
|
14
|
+
metadata and artwork retain their separate scoped storage. Dashboard and API
|
|
15
|
+
responses, signed media URLs and preview credentials are not shell cache entries.
|
|
16
|
+
|
|
17
|
+
Media source formats and browser license limits follow
|
|
18
|
+
[player platform support](../player/platforms.md). A ready app package does not
|
|
19
|
+
extend those media capabilities.
|
|
20
|
+
|
|
21
|
+
On native TV, cast and download operations are inert. An authored offline graph can
|
|
22
|
+
still present an appropriate empty or app-specific local experience; it cannot
|
|
23
|
+
manufacture media downloads. Web-TV packages do not register the browser shell;
|
|
24
|
+
durable offline startup is unavailable there. Check `offlineAvailable` before
|
|
25
|
+
offering an explicit transition. Connection changes follow
|
|
26
|
+
[connectivity](connectivity.md#connection-changes-during-a-session).
|
|
27
|
+
|
|
28
|
+
Preview mode can inspect a separately authored offline graph while its current
|
|
29
|
+
preview capability is admitted. That graph stays in memory. `offlineAvailable`
|
|
30
|
+
there means the offline graph can be inspected, not that a preview grant or its
|
|
31
|
+
resources have been made durable. Switching checks current capability authority;
|
|
32
|
+
a refusal clears the inspected graph. A new preview activation starts with its
|
|
33
|
+
normal graph. Closing or losing the preview grant cannot create a cold offline
|
|
34
|
+
app. Local downloaded-file, license, receiver and background acceptance needs the
|
|
35
|
+
actual supported device; a preview screenshot is layout evidence.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Offline entry and navigation
|
|
2
|
+
|
|
3
|
+
Offline startup is an explicit app choice; [downloads do not enable it](index.md).
|
|
4
|
+
Discuss it with the builder before adding it.
|
|
5
|
+
|
|
6
|
+
The offline entry opens the saved local Downloads library without authentication,
|
|
7
|
+
including after sign-out. Do not put a sign-in gate, auth-loading screen or token
|
|
8
|
+
refresh in `OfflineApp`. Login and sign-up require a connection and belong to the
|
|
9
|
+
online graph. Saved account/profile metadata selects local files and history; it
|
|
10
|
+
does not represent a signed-in session. Authentication is checked before online
|
|
11
|
+
requests and history replay, never to open local Downloads.
|
|
12
|
+
|
|
13
|
+
Reference a separate authored component in `app.tsx`:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { defineApp } from '@adelin/navigation';
|
|
17
|
+
import App from './components/App';
|
|
18
|
+
import OfflineApp from './components/OfflineApp';
|
|
19
|
+
|
|
20
|
+
export default defineApp({
|
|
21
|
+
name: 'My app',
|
|
22
|
+
version: '1',
|
|
23
|
+
root: App,
|
|
24
|
+
offline: { root: OfflineApp },
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Build `OfflineApp` with the same typed components and navigators as the online
|
|
29
|
+
entry. Its screens, shared components, theme, store and translations compile
|
|
30
|
+
into a standalone definition. Register every route it can navigate to within
|
|
31
|
+
that graph. Back stays within that graph; do not link to an unregistered online
|
|
32
|
+
Home, sign-in, purchase or remote search route. The app's `onBack` applies to the
|
|
33
|
+
online graph only; at the offline root, Back uses the default behaviour.
|
|
34
|
+
|
|
35
|
+
The usual starting design is Downloads → local details → player, with an empty
|
|
36
|
+
state when nothing is downloaded. Offline, downloads can be played, paused and
|
|
37
|
+
removed but not started, resumed or renewed; see [downloads](../player/downloads.md).
|
|
38
|
+
The builder can choose another useful offline experience. Reusing shared components at build time is supported; relying on a
|
|
39
|
+
previously cached online definition to fill missing screens is not.
|
|
40
|
+
|
|
41
|
+
Disconnected startup without a prepared, compatible package shows the runtime's
|
|
42
|
+
offline/setup-required state. Removing offline support, app removal or a required
|
|
43
|
+
upgrade prevents future cached entry, including when the accepted release is
|
|
44
|
+
loaded while signed out or authentication is still loading. Online authentication refusals do not erase
|
|
45
|
+
the saved library or prevent its local use. Profile history stays in its saved
|
|
46
|
+
partition; cached data cannot authorize online requests.
|
|
47
|
+
|
|
48
|
+
Connection changes during a session follow
|
|
49
|
+
[connectivity](connectivity.md#connection-changes-during-a-session).
|
|
50
|
+
|
|
51
|
+
If a requested return online fails, including an authentication refusal, the local
|
|
52
|
+
graph and player stay open. Handle the failed mode-switch result within that
|
|
53
|
+
screen; do not route the viewer away from their available downloads.
|