@uploadfilm/sdk 0.0.0-stage → 0.1.0

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.
Files changed (218) hide show
  1. package/LICENSE +4 -0
  2. package/README.md +509 -2
  3. package/dist/ai/embed.d.ts +58 -0
  4. package/dist/ai/fake.d.ts +41 -0
  5. package/dist/ai/http.d.ts +17 -0
  6. package/dist/ai/index.d.ts +27 -0
  7. package/dist/ai/languages.d.ts +2 -0
  8. package/dist/ai/ollama.d.ts +23 -0
  9. package/dist/ai/openaiCompatible.d.ts +54 -0
  10. package/dist/ai/passages.d.ts +28 -0
  11. package/dist/ai/transcribe.d.ts +84 -0
  12. package/dist/ai/types.d.ts +141 -0
  13. package/dist/ai/usage.d.ts +66 -0
  14. package/dist/ai/whisperJson.d.ts +15 -0
  15. package/dist/ai/workersAi.d.ts +56 -0
  16. package/dist/ai.js +1 -0
  17. package/dist/ai.mjs +1 -0
  18. package/dist/cards/files.d.ts +91 -0
  19. package/dist/cards/index.d.ts +15 -0
  20. package/dist/cards/layouts.d.ts +121 -0
  21. package/dist/cards/probe.d.ts +69 -0
  22. package/dist/cards/proxies.d.ts +70 -0
  23. package/dist/cards/select.d.ts +68 -0
  24. package/dist/cards/volumes.d.ts +170 -0
  25. package/dist/cards/xml.d.ts +80 -0
  26. package/dist/cards.js +1 -0
  27. package/dist/cards.mjs +1 -0
  28. package/dist/copy/checksums.d.ts +66 -0
  29. package/dist/copy/engine.d.ts +24 -0
  30. package/dist/copy/errors.d.ts +109 -0
  31. package/dist/copy/index.d.ts +15 -0
  32. package/dist/copy/steps.d.ts +28 -0
  33. package/dist/copy/sweep.d.ts +24 -0
  34. package/dist/copy/types.d.ts +336 -0
  35. package/dist/embed/player.js +2 -0
  36. package/dist/host/adapters.d.ts +107 -0
  37. package/dist/host/detect.d.ts +68 -0
  38. package/dist/host/encoders.d.ts +34 -0
  39. package/dist/host/environment.d.ts +53 -0
  40. package/dist/host/index.d.ts +20 -0
  41. package/dist/host/linux.d.ts +94 -0
  42. package/dist/host/mac.d.ts +47 -0
  43. package/dist/host/network.d.ts +54 -0
  44. package/dist/host/node.d.ts +13 -0
  45. package/dist/host/policy.d.ts +101 -0
  46. package/dist/host/tuner.d.ts +48 -0
  47. package/dist/host/types.d.ts +118 -0
  48. package/dist/host-node.js +1 -0
  49. package/dist/host-node.mjs +1 -0
  50. package/dist/host.js +1 -0
  51. package/dist/host.mjs +1 -0
  52. package/dist/images/index.d.ts +11 -0
  53. package/dist/images/settings.d.ts +43 -0
  54. package/dist/images/types.d.ts +83 -0
  55. package/dist/images/url.d.ts +65 -0
  56. package/dist/index.d.ts +16 -0
  57. package/dist/index.js +1 -0
  58. package/dist/index.mjs +1 -0
  59. package/dist/player/adapters/hlsjs.d.ts +28 -0
  60. package/dist/player/bandwidthMemory.d.ts +28 -0
  61. package/dist/player/captions/index.d.ts +55 -0
  62. package/dist/player/embed/code.d.ts +195 -0
  63. package/dist/player/embed/constants.d.ts +4 -0
  64. package/dist/player/embed/controller.d.ts +62 -0
  65. package/dist/player/embed/element.d.ts +32 -0
  66. package/dist/player/embed/frame.d.ts +65 -0
  67. package/dist/player/embed/global.d.ts +14 -0
  68. package/dist/player/embed/index.d.ts +15 -0
  69. package/dist/player/embed/loader.d.ts +1 -0
  70. package/dist/player/embed/oembed.d.ts +74 -0
  71. package/dist/player/embed/protocol.d.ts +64 -0
  72. package/dist/player/engine.d.ts +215 -0
  73. package/dist/player/index.d.ts +18 -0
  74. package/dist/player/start.d.ts +62 -0
  75. package/dist/player/store.d.ts +10 -0
  76. package/dist/player/storyboard/index.d.ts +161 -0
  77. package/dist/player/stream.d.ts +206 -0
  78. package/dist/player/tracks.d.ts +41 -0
  79. package/dist/player.js +1 -0
  80. package/dist/player.mjs +1 -0
  81. package/dist/proxies/args.d.ts +19 -0
  82. package/dist/proxies/budget.d.ts +57 -0
  83. package/dist/proxies/camera.d.ts +104 -0
  84. package/dist/proxies/formats.d.ts +36 -0
  85. package/dist/proxies/index.d.ts +18 -0
  86. package/dist/proxies/jobs.d.ts +98 -0
  87. package/dist/proxies/node.d.ts +32 -0
  88. package/dist/proxies/plan.d.ts +89 -0
  89. package/dist/proxies/probe.d.ts +39 -0
  90. package/dist/proxies/render.d.ts +104 -0
  91. package/dist/proxies/safety.d.ts +45 -0
  92. package/dist/proxies/types.d.ts +83 -0
  93. package/dist/proxies/upload.d.ts +14 -0
  94. package/dist/react/BigPlay.d.ts +26 -0
  95. package/dist/react/Player.d.ts +58 -0
  96. package/dist/react/embed/index.d.ts +45 -0
  97. package/dist/react/examples/CustomControls.d.ts +8 -0
  98. package/dist/react/images/Image.d.ts +16 -0
  99. package/dist/react/images/index.d.ts +4 -0
  100. package/dist/react/images/useImage.d.ts +47 -0
  101. package/dist/react/index.d.ts +17 -0
  102. package/dist/react/storyboard/index.d.ts +58 -0
  103. package/dist/react/theme.d.ts +37 -0
  104. package/dist/react/useAdapterErrors.d.ts +8 -0
  105. package/dist/react/usePlaybackStart.d.ts +18 -0
  106. package/dist/react/usePlayer.d.ts +28 -0
  107. package/dist/react/useReducedMotion.d.ts +2 -0
  108. package/dist/react/useTimedTrack.d.ts +22 -0
  109. package/dist/react.js +1 -0
  110. package/dist/react.mjs +1 -0
  111. package/dist/server/auth/apiKeys.d.ts +30 -0
  112. package/dist/server/auth/cache.d.ts +21 -0
  113. package/dist/server/auth/deviceTokens.d.ts +38 -0
  114. package/dist/server/auth/envelope.d.ts +15 -0
  115. package/dist/server/auth/grants.d.ts +76 -0
  116. package/dist/server/auth/index.d.ts +19 -0
  117. package/dist/server/auth/jwt.d.ts +65 -0
  118. package/dist/server/auth/keyring.d.ts +31 -0
  119. package/dist/server/auth/kv.d.ts +12 -0
  120. package/dist/server/auth/repository.d.ts +45 -0
  121. package/dist/server/auth/revocations.d.ts +21 -0
  122. package/dist/server/auth/scope.d.ts +4 -0
  123. package/dist/server/auth/serviceAuth.d.ts +24 -0
  124. package/dist/server/auth/signedUrls.d.ts +28 -0
  125. package/dist/server/embed/index.d.ts +36 -0
  126. package/dist/server/embed/lifecycle.d.ts +53 -0
  127. package/dist/server/embed/playerScript.d.ts +4 -0
  128. package/dist/server/images/index.d.ts +15 -0
  129. package/dist/server/images/job.d.ts +80 -0
  130. package/dist/server/images/layout.d.ts +24 -0
  131. package/dist/server/images/params.d.ts +90 -0
  132. package/dist/server/images/route.d.ts +101 -0
  133. package/dist/server/images/sign.d.ts +55 -0
  134. package/dist/server/index.d.ts +42 -0
  135. package/dist/server/media/client.d.ts +66 -0
  136. package/dist/server/media/frameCheck.d.ts +62 -0
  137. package/dist/server/media/index.d.ts +10 -0
  138. package/dist/server/media/protocol.d.ts +318 -0
  139. package/dist/server/media/storyboard.d.ts +144 -0
  140. package/dist/server/media/transcript.d.ts +143 -0
  141. package/dist/server/pipeline/index.d.ts +12 -0
  142. package/dist/server/pipeline/match.d.ts +10 -0
  143. package/dist/server/pipeline/pipeline.d.ts +182 -0
  144. package/dist/server/pipeline/queues.d.ts +108 -0
  145. package/dist/server/pipeline/sources.d.ts +54 -0
  146. package/dist/server/r2/client.d.ts +150 -0
  147. package/dist/server/r2/crc32.d.ts +24 -0
  148. package/dist/server/r2/encoding.d.ts +35 -0
  149. package/dist/server/r2/errors.d.ts +9 -0
  150. package/dist/server/r2/integrity.d.ts +25 -0
  151. package/dist/server/r2/parts.d.ts +46 -0
  152. package/dist/server/r2/sign.d.ts +47 -0
  153. package/dist/server/redis/index.d.ts +39 -0
  154. package/dist/server/state/memory.d.ts +18 -0
  155. package/dist/server/state/r2.d.ts +73 -0
  156. package/dist/server/state/types.d.ts +57 -0
  157. package/dist/server/storage/chunked.d.ts +21 -0
  158. package/dist/server/storage/index.d.ts +12 -0
  159. package/dist/server/storage/r2.d.ts +96 -0
  160. package/dist/server/storage/s3.d.ts +93 -0
  161. package/dist/server/testing/fake-r2.d.ts +390 -0
  162. package/dist/server/testing/index.d.ts +10 -0
  163. package/dist/server/testing/kv-contract.d.ts +14 -0
  164. package/dist/server/transfer/handler.d.ts +167 -0
  165. package/dist/server/transfer/keys.d.ts +45 -0
  166. package/dist/server/transfer/protocol.d.ts +141 -0
  167. package/dist/server/zip/client.d.ts +32 -0
  168. package/dist/server/zip/generations.d.ts +83 -0
  169. package/dist/server/zip/index.d.ts +12 -0
  170. package/dist/server/zip/planner.d.ts +94 -0
  171. package/dist/server/zip/sign.d.ts +22 -0
  172. package/dist/server-media.js +1 -0
  173. package/dist/server-media.mjs +1 -0
  174. package/dist/server-redis.js +1 -0
  175. package/dist/server-redis.mjs +1 -0
  176. package/dist/server-testing.js +1 -0
  177. package/dist/server-testing.mjs +1 -0
  178. package/dist/server.js +1 -0
  179. package/dist/server.mjs +1 -0
  180. package/dist/storage/browserFile.d.ts +19 -0
  181. package/dist/storage/index.d.ts +12 -0
  182. package/dist/storage/local.d.ts +9 -0
  183. package/dist/storage/presigned.d.ts +22 -0
  184. package/dist/sync/ffmpeg.d.ts +44 -0
  185. package/dist/sync/index.d.ts +17 -0
  186. package/dist/sync/match.d.ts +28 -0
  187. package/dist/sync/probe.d.ts +30 -0
  188. package/dist/sync/timecode.d.ts +50 -0
  189. package/dist/sync/transcript.d.ts +35 -0
  190. package/dist/sync/types.d.ts +172 -0
  191. package/dist/sync/waveform.d.ts +89 -0
  192. package/dist/sync.js +1 -0
  193. package/dist/sync.mjs +1 -0
  194. package/dist/transfer/claims.d.ts +41 -0
  195. package/dist/transfer/client.d.ts +256 -0
  196. package/dist/transfer/download.d.ts +192 -0
  197. package/dist/transfer/engine.d.ts +382 -0
  198. package/dist/transfer/errors.d.ts +50 -0
  199. package/dist/transfer/index.d.ts +39 -0
  200. package/dist/transfer/integrity.d.ts +93 -0
  201. package/dist/transfer/limits.d.ts +34 -0
  202. package/dist/transfer/node.d.ts +63 -0
  203. package/dist/transfer/pool.d.ts +83 -0
  204. package/dist/transfer/protocol.d.ts +167 -0
  205. package/dist/transfer/signer.d.ts +29 -0
  206. package/dist/transfer/storage.d.ts +110 -0
  207. package/dist/transfer/timing.d.ts +132 -0
  208. package/dist/transfer/transports/electronNet.d.ts +62 -0
  209. package/dist/transfer/transports/fetch.d.ts +15 -0
  210. package/dist/transfer/transports/retryAfter.d.ts +12 -0
  211. package/dist/transfer/transports/undici.d.ts +72 -0
  212. package/dist/transfer/tuner.d.ts +56 -0
  213. package/dist/zip/index.d.ts +13 -0
  214. package/dist/zip/layout.d.ts +129 -0
  215. package/dist/zip/names.d.ts +34 -0
  216. package/dist/zip/plan.d.ts +115 -0
  217. package/dist/zip/sw.d.ts +7 -0
  218. package/package.json +265 -4
@@ -0,0 +1,215 @@
1
+ import { type AutoplayResult } from "./start";
2
+ import { type Mode, type OriginalSource } from "./stream";
3
+ import { type Store } from "./store";
4
+ import { type Cue, type TimedTrack } from "./tracks";
5
+ /** A loaded stream (hls.js instance or similar). `engine.bandwidthEstimate` feeds the bandwidth memory. */
6
+ export interface StreamHandle {
7
+ engine?: {
8
+ bandwidthEstimate?: number;
9
+ };
10
+ destroy(): void;
11
+ }
12
+ /** Plays an HLS URL into a <video>. Injected (hlsJsLoader(Hls)), so the SDK doesn't import a streaming library. */
13
+ export interface StreamLoader {
14
+ name: string;
15
+ supported(): boolean;
16
+ attach(video: HTMLVideoElement, url: string, ctx: {
17
+ config: Record<string, unknown>;
18
+ onFatal: (detail: StreamFailure) => void;
19
+ }): StreamHandle;
20
+ }
21
+ export interface StreamFailure {
22
+ type?: string;
23
+ details?: string;
24
+ status?: number;
25
+ }
26
+ export interface PlayerSources {
27
+ /** The adaptive stream (an HLS master playlist URL), when there is one. */
28
+ hls?: string | null;
29
+ /** The progressive file: what plays without HLS, and the fallback ("" when there's none). */
30
+ mp4: string;
31
+ /**
32
+ * The original, when it plays only in some browsers (HEVC, VP9, AV1): with no MP4, it is the progressive file (what
33
+ * plays without a stream this browser plays, and the stream's fallback), but only where `canPlayType(type)` answers
34
+ * "maybe" or "probably", asked before any request. Elsewhere "cant-play", as without it. Ignored when there's an MP4.
35
+ */
36
+ original?: OriginalSource | null;
37
+ }
38
+ /** Why a source was loaded. */
39
+ export type SourceReason = "initial" | "late-stream" | "fallback" | "recover" | "retry-early" | "online";
40
+ export interface RefreshContext {
41
+ mode: Mode;
42
+ /** The source's base URL (as given in `sources`). */
43
+ url: string;
44
+ /** This recovery's number on the file (1 for the first; a fallback or an early retry keeps the count). */
45
+ attempt: number;
46
+ reason: SourceReason;
47
+ }
48
+ /** Timers, clock and connectivity: the browser's by default, injectable for tests. */
49
+ export interface PlayerEnvironment {
50
+ online(): boolean;
51
+ /** Calls `cb` when the browser is back online; returns an unsubscribe. */
52
+ onOnline(cb: () => void): () => void;
53
+ setTimeout(cb: () => void, ms: number): unknown;
54
+ clearTimeout(t: unknown): void;
55
+ now(): number;
56
+ }
57
+ export interface PlayerOptions {
58
+ sources: PlayerSources;
59
+ /** How HLS is played where the browser can't natively (hlsJsLoader(Hls)). Without it, HLS needs native support. */
60
+ stream?: StreamLoader;
61
+ /** Can this browser play HLS (default: hlsCapable(): MediaSource, ManagedMediaSource or native HLS). */
62
+ canPlayHls?: () => boolean;
63
+ /** "engine" (default): the engine sets sources. "external": a skin does (see the module comment). */
64
+ loader?: "engine" | "external";
65
+ /** Start playing on open (default true): the `autoplay` attribute, play() on the first element, kickStart. */
66
+ autoplay?: boolean;
67
+ /** play() (muted if sound is refused) when the first element attaches (default: `autoplay`). Embeds rely on the attribute. */
68
+ startOnAttach?: boolean;
69
+ /** Start a pending autoplay once there's data, over a small start gap (default: `autoplay`). */
70
+ kickStart?: boolean;
71
+ /** Seconds to start from. */
72
+ startAt?: number;
73
+ /**
74
+ * An MP4 failing before anything played. "once" (default): one fresh URL at once, then "cant-play" (the browser can't
75
+ * decode it: the first failure may just have been the network). `{ tries }`: back off and retry `tries` times, then
76
+ * "failed" (embeds: 3).
77
+ */
78
+ earlyRetry?: "once" | {
79
+ tries: number;
80
+ };
81
+ /** A fresh URL for a recovery. Default: `url` with `r=<now>` added (a new query skips edge-cached redirects). */
82
+ refreshSource?: (ctx: RefreshContext) => string | Promise<string>;
83
+ /** hls.js settings (default: hlsJsConfig(): this browser's start estimate, patient retries, deep buffer). */
84
+ hlsConfig?: Record<string, unknown>;
85
+ /** Keep hls.js's measured bandwidth for the next video (default true). */
86
+ rememberBandwidth?: boolean;
87
+ /**
88
+ * A progressive MP4 waiting this long, online, with nothing moving or arriving, is reloaded; so is a playing HLS
89
+ * element whose playhead stays put this long with data buffered ahead and nothing new arriving (default STALL_MS).
90
+ */
91
+ stallMs?: number;
92
+ /** Asks whether `sources.original` plays here (default: a <video>'s canPlayType; "" on the server). */
93
+ canPlayType?: (type: string) => string;
94
+ /** Seconds buffered ahead of the picture (or the whole clip) before "ready" (default 4). */
95
+ readyAheadS?: number;
96
+ tracks?: TimedTrack[];
97
+ env?: Partial<PlayerEnvironment>;
98
+ }
99
+ export type PlayerStatus = "idle" | "loading" | "playing" | "paused" | "buffering" | "recovering" | "offline" | "ended" | "cant-play" | "failed";
100
+ export interface PlayerState {
101
+ /** null until decided (on the client: it depends on the browser). */
102
+ mode: Mode | null;
103
+ src: string | null;
104
+ /** Whether the current source should start by itself (a recovery of a paused video stays paused). */
105
+ autoPlay: boolean;
106
+ /** Changes with every source load: the key of a skin's media element. */
107
+ sourceId: number;
108
+ status: PlayerStatus;
109
+ /** Something played on this file (the "playing" event fired at least once). */
110
+ played: boolean;
111
+ paused: boolean;
112
+ ended: boolean;
113
+ muted: boolean;
114
+ volume: number;
115
+ currentTime: number;
116
+ duration: number;
117
+ /** End of the buffered range that holds the current time (seconds). */
118
+ bufferedEnd: number;
119
+ retries: number;
120
+ hlsFailures: number;
121
+ /** Active cues per timed track id. */
122
+ activeCues: Record<string, Cue[]>;
123
+ tracks: TimedTrack[];
124
+ /** The caption/subtitle track showing, by id. */
125
+ textTrack: string | null;
126
+ }
127
+ export interface PlayerEvents {
128
+ statechange: PlayerState;
129
+ sourcechange: {
130
+ mode: Mode;
131
+ src: string;
132
+ reason: SourceReason;
133
+ };
134
+ /** A failure seen (element error, stream fatal error, stall). */
135
+ error: {
136
+ mode: Mode;
137
+ reason: "media" | "stream" | "stall";
138
+ detail?: StreamFailure;
139
+ };
140
+ /** A recovery scheduled: a fresh URL of `mode` after `delay` ms. */
141
+ recover: {
142
+ mode: Mode;
143
+ attempt: number;
144
+ delay: number;
145
+ };
146
+ /** The stream gave up: the MP4 plays from the same spot. */
147
+ fallback: {
148
+ from: Mode;
149
+ };
150
+ /** Offline: waiting for the connection. */
151
+ offline: void;
152
+ online: void;
153
+ /** Playing with `readyAheadS` buffered ahead (or all of it): once per file. */
154
+ ready: void;
155
+ /** Waiting for data after it had played. */
156
+ stall: void;
157
+ /** The browser can't decode this file (an MP4 that failed twice before playing). */
158
+ cantplay: void;
159
+ /** Out of tries. */
160
+ failed: void;
161
+ cuechange: {
162
+ track: string;
163
+ cues: Cue[];
164
+ };
165
+ /** The new source has its metadata (a recovery resumed, or the first load). */
166
+ loadedmetadata: void;
167
+ play: void;
168
+ playing: void;
169
+ pause: void;
170
+ ended: void;
171
+ timeupdate: {
172
+ currentTime: number;
173
+ };
174
+ volumechange: {
175
+ muted: boolean;
176
+ volume: number;
177
+ };
178
+ seeked: {
179
+ currentTime: number;
180
+ };
181
+ }
182
+ export interface Player {
183
+ readonly store: Store<PlayerState>;
184
+ getState(): PlayerState;
185
+ subscribe(listener: (s: PlayerState, prev: PlayerState) => void): () => void;
186
+ on<K extends keyof PlayerEvents>(event: K, cb: (payload: PlayerEvents[K]) => void): () => void;
187
+ /** Decide the mode (HLS or MP4) for this browser. Called by attach() if needed; a skin calls it from a layout effect. */
188
+ start(): void;
189
+ /** Give the engine the <video> (a new one per mode in an external skin). Returns a detach. */
190
+ attach(video: HTMLVideoElement): () => void;
191
+ /** Video.js's HLS adapter (mediaRef), for its errors and the bandwidth memory; null when it goes. */
192
+ bindAdapter(adapter: unknown): void;
193
+ /** New sources (the page's answer refreshed): a stream arriving before anything played is switched to. */
194
+ setSources(sources: PlayerSources): void;
195
+ /** Play (with sound when allowed, else muted). */
196
+ play(): Promise<AutoplayResult>;
197
+ pause(): void;
198
+ seek(t: number): void;
199
+ setMuted(muted: boolean): void;
200
+ setVolume(volume: number): void;
201
+ setTracks(tracks: TimedTrack[]): void;
202
+ /** Show a caption/subtitle track by id (null: none). */
203
+ selectTextTrack(id: string | null): void;
204
+ /** hls.js settings for a skin that loads the stream itself (Video.js: `engine: { hlsJs: player.hlsConfig }`). */
205
+ readonly hlsConfig: Record<string, unknown>;
206
+ /** The <video> currently attached. */
207
+ readonly element: HTMLVideoElement | null;
208
+ /** A recovery is under way (a fresh source is loading). */
209
+ readonly recovering: boolean;
210
+ /** The viewer asked it to stay paused (and hasn't played since). */
211
+ readonly pausedByViewer: boolean;
212
+ readonly destroyed: boolean;
213
+ destroy(): void;
214
+ }
215
+ export declare function createPlayer(options: PlayerOptions): Player;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `@uploadfilm/sdk/player`: the headless player engine (no DOM rendering, no React, no CSS), its framework-free store,
3
+ * timed tracks (markers, chapters, captions), the stream loader interface (hls.js injected) and the pure playback
4
+ * decisions it is built on. RFC §2.2. Embeds: options, snippets and guides, oEmbed, the postMessage control API and
5
+ * <uploadfilm-player> (./embed).
6
+ */
7
+ export declare const SDK_ENTRY: "player";
8
+ export { createPlayer } from "./engine";
9
+ export type { Player, PlayerEnvironment, PlayerEvents, PlayerOptions, PlayerSources, PlayerState, PlayerStatus, RefreshContext, SourceReason, StreamFailure, StreamHandle, StreamLoader, } from "./engine";
10
+ export { hlsJsLoader, type HlsClassLike, type HlsLike } from "./adapters/hlsjs";
11
+ export { createStore, type Store } from "./store";
12
+ export { POINT_CUE_S, activeCues, cuePosition, nextCue, previousCue, sortCues, type Cue, type TimedTrack, type TrackKind, } from "./tracks";
13
+ export { captionsFromVtt, captionsTrack, cueMarkup, cueText, loadCaptions, parseVtt, showCaptions, vttSeconds, type CaptionVideo, type CaptionsOptions, } from "./captions";
14
+ export { BandwidthMemory, type BandwidthSource } from "./bandwidthMemory";
15
+ export { BANDWIDTH_KEY, HLS_JS_CONFIG, MAX_RECOVERIES, REMEMBER_AFTER_S, REMEMBER_MAX, REMEMBER_MIN, REMEMBER_MS, FROZEN_AHEAD_S, STALL_MS, START_ESTIMATE, browserCanPlayType, hlsCapable, hlsJsConfig, onPlaybackError, playableOriginal, recoveryDelay, rememberBandwidth, startEstimate, watchFrozen, watchStalls, type Mode, type Next, type OriginalSource, } from "./stream";
16
+ export { START_GAP_S, kickStart, pauseIntent, recoveryFrom, startAutoplay, startPlayback, type AutoplayResult, } from "./start";
17
+ export * from "./embed";
18
+ export { MAX_VTT_BYTES, createTimelinePreviews, cueIndexAt, defaultLoadImage, layoutCues, parseStoryboardVtt, spriteStyle, thumbnailsVtt, type StoryboardLayout, type StoryboardSource, type TimelinePreview, type TimelinePreviews, type TimelinePreviewsOptions, type TimelinePreviewsState, } from "./storyboard";
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Starting playback (moved from UploadFilm's web/lib/startPlayback.ts, behaviour unchanged).
3
+ *
4
+ * Start a video the moment it opens. The `autoPlay` attribute alone stays paused whenever the browser
5
+ * blocks sound: a share link opened directly (nothing clicked yet in Chrome), and Safari's default
6
+ * for every site. So ask explicitly, and when the browser refuses because of sound, play muted: the
7
+ * mute button in the controls turns it back on. Any other refusal (a format it can't decode, a source
8
+ * that changed) is left to the player's error handling.
9
+ *
10
+ * Call it from a layout effect: React runs those inside the click, which is what lets Safari count
11
+ * the click as permission to play with sound.
12
+ */
13
+ export declare function startPlayback(video: Pick<HTMLVideoElement, "play" | "muted">): void;
14
+ /** A gap this small before the first buffered picture is jumped over (WebKit's starts at ~0.17 s: see kickStart). */
15
+ export declare const START_GAP_S = 0.5;
16
+ /**
17
+ * Start a video that should be playing but hasn't started, once it has data (call on loadeddata and canplay).
18
+ *
19
+ * Two WebKit (Safari) behaviours left a short clip on a spinner at 0:00, found on a 3 s FX30 preview on 2026-11-13:
20
+ * - its autoplay waits for "enough data", which for a 3 s clip is the whole clip (the first frame came after every
21
+ * segment had loaded, ~1 s late), and the skin shows its spinner all the while (autoplay pending);
22
+ * - its buffer starts a little after 0 (0.166 s: fMP4 with B-frames has no edit list for MSE), so 0:00 has no
23
+ * picture, and hls.js only jumps such a gap once the video is playing, which a pending autoplay never is.
24
+ * So: jump a small start gap, then play() (muted if sound is refused).
25
+ */
26
+ /**
27
+ * Whether the viewer has asked this video to stay paused (and not played since). A pause during a pending autoplay
28
+ * fires no "pause" event (the element is already paused; Video.js calls media.pause(), which only cancels the
29
+ * autoplay), so calls to pause() count as well as the event. Cleared by "play". Our own code calls pause() only to
30
+ * honour the viewer (reduced motion, a tap), which counts too.
31
+ *
32
+ * `state` is the player's own (one per opened file): a new element (HLS failing over to the MP4, or the stream arriving
33
+ * after the MP4 opened) gets a new tracker on the same state, so a pause made on the old element still holds.
34
+ */
35
+ export declare function pauseIntent(video: HTMLVideoElement, state?: {
36
+ paused: boolean;
37
+ }): {
38
+ readonly paused: boolean;
39
+ dispose(): void;
40
+ };
41
+ export declare function kickStart(video: Pick<HTMLVideoElement, "play" | "muted" | "paused" | "ended" | "currentTime" | "buffered">): void;
42
+ /**
43
+ * Recovering a failed source (an expired URL): reload at the same spot, in the same state. A video the
44
+ * viewer paused stays paused, so `autoPlay` follows it: left on, the reload would start it.
45
+ */
46
+ export declare const recoveryFrom: (last: {
47
+ at: number;
48
+ playing: boolean;
49
+ }) => {
50
+ at: number;
51
+ play: boolean;
52
+ autoPlay: boolean;
53
+ };
54
+ /**
55
+ * Embed autoplay with sound (`autoplay=1&muted=0`). Try unmuted; when the browser refuses because the visitor
56
+ * hasn't interacted with the page (NotAllowedError), play muted instead so there is still motion ("muted": the
57
+ * player keeps that state). An AbortError means the source was swapped under the play() (a recovery): "aborted",
58
+ * left unmuted for the caller to retry on the new source. Any other refusal is "failed". Whenever nothing plays,
59
+ * the video is left unmuted, so the viewer's own tap plays with sound. Without `sound` it only plays.
60
+ */
61
+ export type AutoplayResult = "sound" | "muted" | "failed" | "aborted";
62
+ export declare function startAutoplay(video: Pick<HTMLVideoElement, "play" | "muted">, sound: boolean): Promise<AutoplayResult>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * A tiny framework-free store: the player's state lives here, any UI (React's useSyncExternalStore, a web component,
3
+ * plain DOM) subscribes to it. Updates are shallow merges; listeners run only when something actually changed.
4
+ */
5
+ export interface Store<T extends object> {
6
+ getState(): T;
7
+ setState(patch: Partial<T> | ((s: T) => Partial<T>)): void;
8
+ subscribe(listener: (state: T, prev: T) => void): () => void;
9
+ }
10
+ export declare function createStore<T extends object>(initial: T): Store<T>;
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Timeline hover previews (storyboards), headless: which thumbnail to show for a time on the timeline, and the sheets
3
+ * it lives in, loaded only when needed.
4
+ *
5
+ * const previews = createTimelinePreviews("https://…/storyboard/storyboard.vtt"); // or a StoryboardDescriptor
6
+ * previews.subscribe(() => redraw());
7
+ * const p = previews.getPreviewAt(hoverTime); // { url, x, y, w, h, … } or null until the track is read
8
+ *
9
+ * The source is a WebVTT thumbnails track (cue text `sheet.webp#xywh=x,y,w,h`, the format Video.js, Media Chrome and
10
+ * the media worker's `storyboard` step use) or a descriptor with the layout already known (no VTT fetch at all).
11
+ * getPreviewAt is synchronous and cheap (a binary search); the first call for a sheet starts loading it, and its
12
+ * neighbours (`prefetch` sheets either side) after it, so scrubbing along the bar rarely waits. No DOM is touched
13
+ * beyond `new Image()` (or `fetch` where there is no Image); rendering is yours (spriteStyle helps), or the React
14
+ * entry's useTimelinePreview / <TimelinePreview>.
15
+ */
16
+ import { type Store } from "../store";
17
+ /** A thumbnail: sheet `url`, the rectangle x,y,w,h in it, and the times it stands for. */
18
+ export interface TimelinePreview {
19
+ url: string;
20
+ x: number;
21
+ y: number;
22
+ w: number;
23
+ h: number;
24
+ start: number;
25
+ end: number;
26
+ /** Which sheet (0-based, in order of first use in the track). */
27
+ sheet: number;
28
+ /** Has the sheet loaded? (false: draw a placeholder; subscribers hear when it has.) */
29
+ loaded: boolean;
30
+ }
31
+ /** A storyboard whose layout is known (the SDK's StoryboardDescriptor with its index): no VTT is fetched. */
32
+ export interface StoryboardLayout {
33
+ interval: number;
34
+ cols: number;
35
+ rows: number;
36
+ width: number;
37
+ height: number;
38
+ count: number;
39
+ /** The picture's length (the last thumbnail lasts until then). */
40
+ seconds?: number;
41
+ /** Absolute URLs of the sheets, in order. */
42
+ sheets: string[];
43
+ }
44
+ /** A VTT URL, or { vtt } (the descriptor without its index), or a layout. */
45
+ export type StoryboardSource = string | {
46
+ vtt: string;
47
+ } | StoryboardLayout;
48
+ export interface TimelinePreviewsOptions {
49
+ /** For the VTT (default: global fetch). */
50
+ fetch?: typeof fetch;
51
+ /** Loads one sheet (default: an Image, else a fetch). Rejects when it can't be loaded. */
52
+ loadImage?: (url: string) => Promise<unknown>;
53
+ /** Sheets to load either side of the one in use. Default 1; 0: none. */
54
+ prefetch?: number;
55
+ /** Credentials for the VTT fetch (sheets loaded by an Image follow its own rules). Default "same-origin". */
56
+ credentials?: "omit" | "same-origin" | "include";
57
+ }
58
+ /** The previews' state, as a store any UI can subscribe to (React: useSyncExternalStore). */
59
+ export interface TimelinePreviewsState {
60
+ /** The track is read: getPreviewAt answers. */
61
+ ready: boolean;
62
+ /** Why the track couldn't be read. */
63
+ error: Error | null;
64
+ /** Sheets loaded so far (changes whenever one more has: redraw a thumbnail that was waiting for it). */
65
+ loadedSheets: number;
66
+ }
67
+ export interface TimelinePreviews {
68
+ /** ready, error and loadedSheets: subscribe to redraw. */
69
+ readonly store: Store<TimelinePreviewsState>;
70
+ /** Reads the track (once; later calls return the same promise). getPreviewAt starts it too. */
71
+ load(): Promise<void>;
72
+ /** The thumbnail for this time, or null while the track isn't read (or has nothing). Starts loading its sheet. */
73
+ getPreviewAt(time: number): TimelinePreview | null;
74
+ /** Every cue (empty until the track is read). */
75
+ cues(): readonly TimelinePreview[];
76
+ readonly ready: boolean;
77
+ /** Why the track couldn't be read. */
78
+ readonly error: Error | null;
79
+ /** Called when the track is read, fails, or a sheet loads. Returns the unsubscribe. */
80
+ subscribe(fn: () => void): () => void;
81
+ /** Stops loading and notifying. */
82
+ destroy(): void;
83
+ }
84
+ /** A VTT bigger than this isn't a thumbnails track. */
85
+ export declare const MAX_VTT_BYTES = 2000000;
86
+ interface ParsedCue {
87
+ start: number;
88
+ end: number;
89
+ url: string;
90
+ x: number;
91
+ y: number;
92
+ w: number;
93
+ h: number;
94
+ }
95
+ /**
96
+ * The cues of a WebVTT thumbnails track. Cue text is an image URL (relative to `baseUrl`, the VTT's own URL) with an
97
+ * optional media fragment `#xywh=[pixel:]x,y,w,h`; cues without a usable URL or rectangle are skipped (percent
98
+ * fragments too: their pixels need the image's size). Sorted by start.
99
+ */
100
+ export declare function parseStoryboardVtt(text: string, baseUrl?: string): ParsedCue[];
101
+ /** The cues a layout stands for (the same the media worker writes into its VTT). */
102
+ export declare function layoutCues(l: StoryboardLayout): ParsedCue[];
103
+ /**
104
+ * A WebVTT thumbnails track of these cues with absolute sheet URLs: for a player that resolves cue URLs against the
105
+ * page rather than the track (Video.js's skin over an hls.js adapter has no track URL to resolve against).
106
+ */
107
+ export declare function thumbnailsVtt(cues: readonly Pick<TimelinePreview, "start" | "end" | "url" | "x" | "y" | "w" | "h">[]): string;
108
+ /**
109
+ * A response's text, refusing (and cancelling) one longer than `max` bytes as it streams in: an oversized "track" is
110
+ * never buffered whole.
111
+ */
112
+ export declare function readCapped(res: Response, max: number): Promise<string>;
113
+ /** Default sheet loader: an Image where there is one (the browser's image cache serves the sprite after), else fetch. */
114
+ export declare function defaultLoadImage(url: string): Promise<unknown>;
115
+ /** The cue at `time` in cues sorted by start: the last one starting at or before it (clamped to the first/last). */
116
+ export declare function cueIndexAt(cues: readonly {
117
+ start: number;
118
+ end: number;
119
+ }[], time: number): number;
120
+ export declare function createTimelinePreviews(source: StoryboardSource, o?: TimelinePreviewsOptions): TimelinePreviews;
121
+ /**
122
+ * Plain style objects to draw a thumbnail at `width` pixels wide (default: its own size), for any renderer: an outer
123
+ * box that clips, and an inner one with the sheet as its background, shifted to the thumbnail and scaled (no need to
124
+ * know the sheet's size). Without a rectangle (a whole-image cue) the image fills the box.
125
+ */
126
+ export declare function spriteStyle(p: Pick<TimelinePreview, "url" | "x" | "y" | "w" | "h">, width?: number, fallbackAspect?: number): {
127
+ outer: {
128
+ position: "relative";
129
+ overflow: "hidden";
130
+ width: string;
131
+ height: string;
132
+ };
133
+ inner: {
134
+ position: "absolute";
135
+ inset: string;
136
+ backgroundImage: string;
137
+ backgroundSize: string;
138
+ backgroundPosition: string;
139
+ left?: undefined;
140
+ top?: undefined;
141
+ width?: undefined;
142
+ height?: undefined;
143
+ backgroundRepeat?: undefined;
144
+ transform?: undefined;
145
+ transformOrigin?: undefined;
146
+ } | {
147
+ position: "absolute";
148
+ left: string;
149
+ top: string;
150
+ width: string;
151
+ height: string;
152
+ backgroundImage: string;
153
+ backgroundRepeat: string;
154
+ backgroundPosition: string;
155
+ transform: string | undefined;
156
+ transformOrigin: string;
157
+ inset?: undefined;
158
+ backgroundSize?: undefined;
159
+ };
160
+ };
161
+ export {};
@@ -0,0 +1,206 @@
1
+ /**
2
+ * How a player stays playing on a bad connection: pure decisions (the engine, ./engine.ts, and any player of your own
3
+ * act on them). Moved from UploadFilm's web/lib/streamPlayback.ts, behaviour unchanged (its tests still run there).
4
+ *
5
+ * A video plays its adaptive stream (HLS) when it has one and the browser can play HLS, else the MP4. hls.js picks the
6
+ * picture size from the measured bandwidth, buffers ahead and retries segments by itself; what's left to the player is
7
+ * a stream that fails outright (an expired token after a long pause, a long outage) and the MP4, which has none of that.
8
+ */
9
+ /**
10
+ * The first guess at the link before anything was measured: 720p (≈2.9 Mbit/s) fits under it, 1080p (≈5.7) doesn't.
11
+ * Measured with the real ladder and hls.js on a simulated link (UploadFilm docs/PLAYBACK-START.md): starting at 1080p took 3.5 s
12
+ * to the first frame on 4G and 12 s on a 2 Mbit/s link (a 2.7 MB first segment); 360p started fast but stepped up
13
+ * visibly a second later. 720p is sharp and starts in about half a second on 4G.
14
+ */
15
+ export declare const START_ESTIMATE = 4000000;
16
+ /** What this browser measured last time is the better guess, for a day (a laptop moves between networks). */
17
+ export declare const REMEMBER_MS: number;
18
+ /** localStorage key of the remembered bandwidth (kept from UploadFilm, so a browser keeps what it measured). */
19
+ export declare const BANDWIDTH_KEY = "uf:bw";
20
+ type Store = Pick<Storage, "getItem" | "setItem">;
21
+ /**
22
+ * The remembered start is kept between these. At least 1 Mbit/s: the 360p rung (≈0.84 Mbit/s) always fits, because
23
+ * when nothing fits hls.js starts on the first variant listed, which is our best one (bestFirst). At most 20 Mbit/s:
24
+ * that already starts 1080p, and it bounds a reading inflated by segments the browser served from its cache.
25
+ */
26
+ export declare const REMEMBER_MIN = 1000000;
27
+ export declare const REMEMBER_MAX = 20000000;
28
+ /** Played this far (s) before a measurement is kept: several segments came over the network, not just warmed ones. */
29
+ export declare const REMEMBER_AFTER_S = 8;
30
+ /**
31
+ * The bandwidth to start from: what this browser measured on the last video (within REMEMBER_MS), else START_ESTIMATE.
32
+ * A fast link starts at 1080p straight away, a weak one at 360p: no step from one to the other a second in.
33
+ */
34
+ export declare function startEstimate(s?: Store | undefined, now?: number): number;
35
+ /**
36
+ * Keep hls.js's measured bandwidth for the next video (a little under it: the start is a guess, not a promise). Only
37
+ * a measurement: the caller passes it once REMEMBER_AFTER_S have played (before that hls.js answers with the guess it
38
+ * was given, and keeping it would lower the next start each time a video is opened and closed).
39
+ */
40
+ export declare function rememberBandwidth(bps: number, s?: Store | undefined, now?: number): void;
41
+ /** hls.js settings for this browser (the start estimate is read when a player opens). */
42
+ export declare const hlsJsConfig: (estimate?: number) => {
43
+ abrEwmaDefaultEstimate: number;
44
+ capLevelToPlayerSize: true;
45
+ abrBandWidthUpFactor: 0.6;
46
+ abrBandWidthFactor: 0.9;
47
+ maxBufferLength: 60;
48
+ maxMaxBufferLength: 120;
49
+ backBufferLength: 30;
50
+ fragLoadPolicy: {
51
+ readonly default: {
52
+ readonly maxTimeToFirstByteMs: 15000;
53
+ readonly maxLoadTimeMs: 120000;
54
+ readonly timeoutRetry: {
55
+ readonly maxNumRetry: 6;
56
+ readonly retryDelayMs: 0;
57
+ readonly maxRetryDelayMs: 0;
58
+ };
59
+ readonly errorRetry: {
60
+ readonly maxNumRetry: 10;
61
+ readonly retryDelayMs: 1000;
62
+ readonly maxRetryDelayMs: 15000;
63
+ };
64
+ };
65
+ };
66
+ playlistLoadPolicy: {
67
+ readonly default: {
68
+ readonly maxTimeToFirstByteMs: 15000;
69
+ readonly maxLoadTimeMs: 30000;
70
+ readonly timeoutRetry: {
71
+ readonly maxNumRetry: 4;
72
+ readonly retryDelayMs: 0;
73
+ readonly maxRetryDelayMs: 0;
74
+ };
75
+ readonly errorRetry: {
76
+ readonly maxNumRetry: 6;
77
+ readonly retryDelayMs: 1000;
78
+ readonly maxRetryDelayMs: 8000;
79
+ };
80
+ };
81
+ };
82
+ };
83
+ /** hls.js settings for flaky links: a deeper buffer, patient retries, and a first guess at the bandwidth. */
84
+ export declare const HLS_JS_CONFIG: {
85
+ readonly abrEwmaDefaultEstimate: 4000000;
86
+ readonly capLevelToPlayerSize: true;
87
+ readonly abrBandWidthUpFactor: 0.6;
88
+ readonly abrBandWidthFactor: 0.9;
89
+ readonly maxBufferLength: 60;
90
+ readonly maxMaxBufferLength: 120;
91
+ readonly backBufferLength: 30;
92
+ readonly fragLoadPolicy: {
93
+ readonly default: {
94
+ readonly maxTimeToFirstByteMs: 15000;
95
+ readonly maxLoadTimeMs: 120000;
96
+ readonly timeoutRetry: {
97
+ readonly maxNumRetry: 6;
98
+ readonly retryDelayMs: 0;
99
+ readonly maxRetryDelayMs: 0;
100
+ };
101
+ readonly errorRetry: {
102
+ readonly maxNumRetry: 10;
103
+ readonly retryDelayMs: 1000;
104
+ readonly maxRetryDelayMs: 15000;
105
+ };
106
+ };
107
+ };
108
+ readonly playlistLoadPolicy: {
109
+ readonly default: {
110
+ readonly maxTimeToFirstByteMs: 15000;
111
+ readonly maxLoadTimeMs: 30000;
112
+ readonly timeoutRetry: {
113
+ readonly maxNumRetry: 4;
114
+ readonly retryDelayMs: 0;
115
+ readonly maxRetryDelayMs: 0;
116
+ };
117
+ readonly errorRetry: {
118
+ readonly maxNumRetry: 6;
119
+ readonly retryDelayMs: 1000;
120
+ readonly maxRetryDelayMs: 8000;
121
+ };
122
+ };
123
+ };
124
+ };
125
+ /** Can this browser play HLS: hls.js over (Managed)MediaSource, or natively (Safari, iOS)? */
126
+ export declare function hlsCapable(w?: {
127
+ MediaSource?: unknown;
128
+ ManagedMediaSource?: unknown;
129
+ document?: Document;
130
+ } | undefined): boolean;
131
+ /** Recoveries (fresh URL, same spot) after playback started, before the player gives up. Reset after 5 s of good playback. */
132
+ export declare const MAX_RECOVERIES = 8;
133
+ /**
134
+ * A progressive MP4 waiting this long with the device online is stuck (a dropped connection Chrome doesn't report); an
135
+ * HLS playhead frozen this long with data buffered ahead is too (watchFrozen).
136
+ */
137
+ export declare const STALL_MS = 20000;
138
+ export type Mode = "hls" | "mp4";
139
+ export type Next =
140
+ /** The stream failed before playing, or keeps failing: play the MP4 instead, from the same spot. */
141
+ "fallback-mp4"
142
+ /** Offline: do nothing until the browser says it's back online, then recover (costs no retry). */
143
+ | "wait-online"
144
+ /** Load a fresh URL and carry on from the same spot. */
145
+ | "recover"
146
+ /** MP4 failed once before playing (maybe the network): one fresh URL. */
147
+ | "retry-early"
148
+ /** MP4 failed twice before playing: the browser can't decode it. */
149
+ | "cant-play"
150
+ /** Out of recoveries. */
151
+ | "stop";
152
+ export declare function onPlaybackError(s: {
153
+ mode: Mode;
154
+ played: boolean;
155
+ earlyRetried: boolean;
156
+ retries: number;
157
+ hlsFailures: number;
158
+ online: boolean;
159
+ }): Next;
160
+ /** Wait before recovery n (0-based): at once, then 1, 2, 4, 8 s… up to 15 s, so a struggling link isn't hammered. */
161
+ export declare const recoveryDelay: (n: number) => number;
162
+ /**
163
+ * Watches a progressive MP4 for a stall that never errors: waiting while playing and online, with neither the picture
164
+ * moving nor a byte arriving ("progress") for STALL_MS, calls `onStall` (the player recovers with a fresh URL). A slow
165
+ * download that still trickles in is left alone: restarting it would only lose what it has. Returns a cleanup.
166
+ */
167
+ export declare function watchStalls(v: HTMLVideoElement, onStall: () => void, opts?: {
168
+ ms?: number;
169
+ online?: () => boolean;
170
+ }): () => void;
171
+ /** A frozen playhead has at least this much (s) buffered ahead of it: less is a wait for the network, not a freeze. */
172
+ export declare const FROZEN_AHEAD_S = 0.5;
173
+ type Timers = {
174
+ setTimeout(cb: () => void, ms: number): unknown;
175
+ clearTimeout(t: unknown): void;
176
+ };
177
+ /**
178
+ * Watches an HLS element for a frozen playhead (WebKit, hls.js on MSE or native: security lab O-4, REALITY-CHECK
179
+ * RC-P1a): playing (not paused, not ended, not seeking), online, at least FROZEN_AHEAD_S buffered ahead, and yet the
180
+ * time hasn't moved for `ms` (STALL_MS), with no "waiting", no error and no stall event to say so. Calls `onFrozen`
181
+ * (the player recovers with a fresh URL at the same spot); the wait then starts over.
182
+ *
183
+ * What proves it alive: the playhead moving, or the buffer growing (its end advancing, checked by polling the element,
184
+ * since native HLS may fire no "progress" events; a "progress" event also starts the wait over). A stall with less than
185
+ * FROZEN_AHEAD_S ahead is a wait for the network and is left to the stream's own retries and timeouts (hls.js reports
186
+ * them as fatal errors): this watchdog never cuts a slow segment that is still on its way. Returns a cleanup.
187
+ */
188
+ export declare function watchFrozen(v: HTMLVideoElement, onFrozen: () => void, opts?: {
189
+ ms?: number;
190
+ online?: () => boolean;
191
+ timers?: Timers;
192
+ }): () => void;
193
+ /** An original file (the camera's own), played only where the browser says it can decode it. */
194
+ export interface OriginalSource {
195
+ url: string;
196
+ /** MIME type with codecs, asked with canPlayType before any request, e.g. `video/mp4; codecs="hvc1.2.4.L153.B0"`. */
197
+ type: string;
198
+ }
199
+ /** The browser's canPlayType (a detached <video>'s); "" where there's no DOM (the server), so nothing is promised there. */
200
+ export declare const browserCanPlayType: (type: string) => string;
201
+ /**
202
+ * The original's URL if this browser says it can play it, else null (UploadFilm's "original-if-supported": HEVC, VP9
203
+ * or AV1 originals play where canPlayType answers "maybe" or "probably"; "" means no).
204
+ */
205
+ export declare function playableOriginal(o: OriginalSource | null | undefined, canPlayType?: (type: string) => string): string | null;
206
+ export {};