@oxyhq/bloom 1.2.2 → 1.4.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 (84) hide show
  1. package/docs/media-flight.mdx +133 -0
  2. package/lib/commonjs/media-flight/MediaFlightHost.js +58 -0
  3. package/lib/commonjs/media-flight/MediaFlightHost.js.map +1 -0
  4. package/lib/commonjs/media-flight/MediaFlightHost.web.js +87 -0
  5. package/lib/commonjs/media-flight/MediaFlightHost.web.js.map +1 -0
  6. package/lib/commonjs/media-flight/MediaFlightLayer.js +4 -2
  7. package/lib/commonjs/media-flight/MediaFlightLayer.js.map +1 -1
  8. package/lib/commonjs/media-flight/MediaFlightLayer.web.js +198 -0
  9. package/lib/commonjs/media-flight/MediaFlightLayer.web.js.map +1 -0
  10. package/lib/commonjs/media-flight/MediaSurface.js +13 -5
  11. package/lib/commonjs/media-flight/MediaSurface.js.map +1 -1
  12. package/lib/commonjs/media-flight/index.js +8 -1
  13. package/lib/commonjs/media-flight/index.js.map +1 -1
  14. package/lib/commonjs/media-flight/index.web.js +115 -0
  15. package/lib/commonjs/media-flight/index.web.js.map +1 -0
  16. package/lib/commonjs/media-flight/media-node.web.js +314 -0
  17. package/lib/commonjs/media-flight/media-node.web.js.map +1 -0
  18. package/lib/commonjs/media-flight/store.js +19 -4
  19. package/lib/commonjs/media-flight/store.js.map +1 -1
  20. package/lib/module/media-flight/MediaFlightHost.js +53 -0
  21. package/lib/module/media-flight/MediaFlightHost.js.map +1 -0
  22. package/lib/module/media-flight/MediaFlightHost.web.js +82 -0
  23. package/lib/module/media-flight/MediaFlightHost.web.js.map +1 -0
  24. package/lib/module/media-flight/MediaFlightLayer.js +4 -2
  25. package/lib/module/media-flight/MediaFlightLayer.js.map +1 -1
  26. package/lib/module/media-flight/MediaFlightLayer.web.js +192 -0
  27. package/lib/module/media-flight/MediaFlightLayer.web.js.map +1 -0
  28. package/lib/module/media-flight/MediaSurface.js +13 -5
  29. package/lib/module/media-flight/MediaSurface.js.map +1 -1
  30. package/lib/module/media-flight/index.js +2 -1
  31. package/lib/module/media-flight/index.js.map +1 -1
  32. package/lib/module/media-flight/index.web.js +19 -0
  33. package/lib/module/media-flight/index.web.js.map +1 -0
  34. package/lib/module/media-flight/media-node.web.js +304 -0
  35. package/lib/module/media-flight/media-node.web.js.map +1 -0
  36. package/lib/module/media-flight/store.js +19 -4
  37. package/lib/module/media-flight/store.js.map +1 -1
  38. package/lib/typescript/commonjs/media-flight/MediaFlightHost.d.ts +6 -0
  39. package/lib/typescript/commonjs/media-flight/MediaFlightHost.d.ts.map +1 -0
  40. package/lib/typescript/commonjs/media-flight/MediaFlightHost.web.d.ts +6 -0
  41. package/lib/typescript/commonjs/media-flight/MediaFlightHost.web.d.ts.map +1 -0
  42. package/lib/typescript/commonjs/media-flight/MediaFlightLayer.web.d.ts +5 -0
  43. package/lib/typescript/commonjs/media-flight/MediaFlightLayer.web.d.ts.map +1 -0
  44. package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts +19 -7
  45. package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts.map +1 -1
  46. package/lib/typescript/commonjs/media-flight/index.d.ts +2 -1
  47. package/lib/typescript/commonjs/media-flight/index.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/media-flight/index.web.d.ts +19 -0
  49. package/lib/typescript/commonjs/media-flight/index.web.d.ts.map +1 -0
  50. package/lib/typescript/commonjs/media-flight/media-node.web.d.ts +93 -0
  51. package/lib/typescript/commonjs/media-flight/media-node.web.d.ts.map +1 -0
  52. package/lib/typescript/commonjs/media-flight/store.d.ts +19 -4
  53. package/lib/typescript/commonjs/media-flight/store.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/media-flight/types.d.ts +93 -0
  55. package/lib/typescript/commonjs/media-flight/types.d.ts.map +1 -1
  56. package/lib/typescript/module/media-flight/MediaFlightHost.d.ts +6 -0
  57. package/lib/typescript/module/media-flight/MediaFlightHost.d.ts.map +1 -0
  58. package/lib/typescript/module/media-flight/MediaFlightHost.web.d.ts +6 -0
  59. package/lib/typescript/module/media-flight/MediaFlightHost.web.d.ts.map +1 -0
  60. package/lib/typescript/module/media-flight/MediaFlightLayer.web.d.ts +5 -0
  61. package/lib/typescript/module/media-flight/MediaFlightLayer.web.d.ts.map +1 -0
  62. package/lib/typescript/module/media-flight/MediaSurface.d.ts +19 -7
  63. package/lib/typescript/module/media-flight/MediaSurface.d.ts.map +1 -1
  64. package/lib/typescript/module/media-flight/index.d.ts +2 -1
  65. package/lib/typescript/module/media-flight/index.d.ts.map +1 -1
  66. package/lib/typescript/module/media-flight/index.web.d.ts +19 -0
  67. package/lib/typescript/module/media-flight/index.web.d.ts.map +1 -0
  68. package/lib/typescript/module/media-flight/media-node.web.d.ts +93 -0
  69. package/lib/typescript/module/media-flight/media-node.web.d.ts.map +1 -0
  70. package/lib/typescript/module/media-flight/store.d.ts +19 -4
  71. package/lib/typescript/module/media-flight/store.d.ts.map +1 -1
  72. package/lib/typescript/module/media-flight/types.d.ts +93 -0
  73. package/lib/typescript/module/media-flight/types.d.ts.map +1 -1
  74. package/package.json +6 -1
  75. package/src/media-flight/MediaFlightHost.tsx +56 -0
  76. package/src/media-flight/MediaFlightHost.web.tsx +85 -0
  77. package/src/media-flight/MediaFlightLayer.tsx +4 -2
  78. package/src/media-flight/MediaFlightLayer.web.tsx +191 -0
  79. package/src/media-flight/MediaSurface.tsx +36 -12
  80. package/src/media-flight/index.ts +2 -0
  81. package/src/media-flight/index.web.ts +45 -0
  82. package/src/media-flight/media-node.web.ts +373 -0
  83. package/src/media-flight/store.ts +19 -4
  84. package/src/media-flight/types.ts +96 -0
@@ -0,0 +1,93 @@
1
+ import type { MediaSurfaceContent, MediaVideoSlot } from './types';
2
+ /** What the layer paints into a shared node, as its current holder wants it. */
3
+ export interface MediaNodeRender {
4
+ content: MediaSurfaceContent;
5
+ contentFit: 'contain' | 'cover';
6
+ /** The consumer's own video element, if it brought one. Compared by identity. */
7
+ renderVideo: MediaVideoSlot | undefined;
8
+ nativeControls: boolean;
9
+ accessibilityLabel: string | undefined;
10
+ /** Forwarded to the media, so a consumer keeps its own first-frame signal. */
11
+ flightId: string | undefined;
12
+ }
13
+ /** A flight outranks a host: the layer holds the node until the leg ends. */
14
+ export declare const HOST_RANK = 0;
15
+ export declare const FLIGHT_RANK = 1;
16
+ interface MediaNodeClaim {
17
+ el: HTMLElement;
18
+ rank: number;
19
+ /** Registration order, so the most recent host wins among equals. */
20
+ seq: number;
21
+ /**
22
+ * What this claimant wants painted — or `undefined` for a claim that decides
23
+ * only WHERE the node lives.
24
+ *
25
+ * The flight is the second kind, and that distinction is load-bearing. A
26
+ * flight that published a render of its own would replace whatever the hosts
27
+ * were painting for the length of the leg, and if a consumer brought its own
28
+ * element (`renderVideo`) the flight would swap it out and back — two
29
+ * remounts, in the middle of the one operation whose entire purpose is that
30
+ * the element is never rebuilt. Measured: the consumer's `<video>` ended the
31
+ * flight as a different node, with the original left disconnected.
32
+ */
33
+ render: MediaNodeRender | undefined;
34
+ }
35
+ interface MediaNodeRecord {
36
+ wrapper: HTMLDivElement;
37
+ claims: MediaNodeClaim[];
38
+ /**
39
+ * How the media is painted right now: the top claim's, or — while the node is
40
+ * PARKED between hosts — the last claim's.
41
+ *
42
+ * Parking has to keep painting. A node the layer stopped rendering would lose
43
+ * its element to React, which is the removal this whole module exists to
44
+ * avoid, and it would lose it exactly in the gap between the origin
45
+ * unmounting and the destination mounting: the moment of the flight.
46
+ */
47
+ render: MediaNodeRender;
48
+ }
49
+ /** What the layer needs in order to paint one shared node. */
50
+ export interface MediaNodeView {
51
+ id: string;
52
+ wrapper: HTMLDivElement;
53
+ render: MediaNodeRender;
54
+ }
55
+ interface NodeRegistry {
56
+ nodes: Map<string, MediaNodeRecord>;
57
+ listeners: Set<() => void>;
58
+ /** Cached for `useSyncExternalStore`, which compares snapshots by identity. */
59
+ snapshot: readonly MediaNodeView[];
60
+ holder: HTMLElement | null;
61
+ seq: number;
62
+ }
63
+ declare global {
64
+ var __oxyhq_bloom_media_nodes__: NodeRegistry | undefined;
65
+ }
66
+ /**
67
+ * Claim the shared node for `id` into `el`.
68
+ *
69
+ * Idempotent for an unchanged claim: called from a layout effect on every
70
+ * render, it moves the node once and publishes nothing afterwards.
71
+ */
72
+ export declare function claimMediaNode(id: string, el: HTMLElement, rank: number, render?: MediaNodeRender): void;
73
+ /**
74
+ * Drop a claim. The node goes to the next claim, or parks — or is DISPOSED, if
75
+ * nothing is going to want it back.
76
+ *
77
+ * "Nothing is going to want it back" is a fact the registry can read rather
78
+ * than a timeout it has to guess: no claim left AND no flight live for this id.
79
+ * During a navigation there IS a flight live — that is what a flight IS — so
80
+ * the node survives the gap between the origin unmounting and the destination
81
+ * mounting. Without a flight, an unmounted host is just a host that went away.
82
+ */
83
+ export declare function releaseMediaNode(id: string, el: HTMLElement, rank: number): void;
84
+ /** Whether anything holds a shared node for this id. */
85
+ export declare function hasMediaNode(id: string): boolean;
86
+ /** Subscribe to the shared-node set. The layer's `useSyncExternalStore` half. */
87
+ export declare function subscribeToMediaNodes(listener: () => void): () => void;
88
+ /** Every shared node that something is currently holding. Stable identity. */
89
+ export declare function getMediaNodes(): readonly MediaNodeView[];
90
+ /** Test seam: drop every node and take its wrapper out of the document. */
91
+ export declare function resetMediaNodes(): void;
92
+ export {};
93
+ //# sourceMappingURL=media-node.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-node.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/media-node.web.ts"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEnE,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC,iFAAiF;IACjF,WAAW,EAAE,cAAc,GAAG,SAAS,CAAC;IACxC,cAAc,EAAE,OAAO,CAAC;IAC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AE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAehF;AAED,wDAAwD;AACxD,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAMtE;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,IAAI,SAAS,aAAa,EAAE,CAExD;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,IAAI,IAAI,CAUtC"}
@@ -139,10 +139,25 @@ export declare function flyBack(id: string): void;
139
139
  * nobody having called `pause()`.
140
140
  *
141
141
  * Rendering `player={null}` for one commit runs expo-video's own `[props.player]`
142
- * effect while the node is STILL in the DOM: its cleanup calls
143
- * `unmountVideoView`, the element leaves `_mountedVideos`, and its later pause
144
- * reaches nobody. That is the documented mount/unmount pair, not a patch of
145
- * somebody else's module.
142
+ * effect while the node is STILL in the DOM, and the operative part of that is
143
+ * NOT the unbind. `unmountVideoView` takes the element out of `_mountedVideos`
144
+ * and leaves the `onpause` handler `_addListeners` installed, so unbinding
145
+ * alone would still mirror. What saves it is the other half of the same
146
+ * branch: `removeAttribute('src'); load()` (`VideoView.web.js:206`). The media
147
+ * element load algorithm sets `paused` to true WITHOUT firing `pause`, so the
148
+ * element goes quiet, and its later removal fires nothing either because it is
149
+ * already paused.
150
+ *
151
+ * Measured in real Chrome, with controls: a playing element put through
152
+ * `removeAttribute('src') + load()` reports events `["play"]` and nothing more,
153
+ * while the same element paused by hand, or removed from the DOM while
154
+ * playing, reports `["play","pause"]`. Against real builds: without this commit
155
+ * the destination ends STOPPED (5/5), with it PLAYING (6/6) and the position
156
+ * carried.
157
+ *
158
+ * DO NOT replace this with a direct `unmountVideoView` call. It looks
159
+ * equivalent, it is the half that does not matter, and the fix would disappear
160
+ * silently. `MediaFlight.test.tsx` makes that substitution its control.
146
161
  *
147
162
  * The cost is one frame in which the outgoing surface shows its poster instead
148
163
  * of video. It is already on its way out and the destination is live by then —
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/store.ts"],"names":[],"mappings":"AA2BA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAUjC,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,IAAsB,CAAC;AAEhE;;;;;;;;;GASG;AACH,UAAU,YAAY;IACpB,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,YAAY,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;IAChC,UAAU,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;IACjD,uEAAuE;IACvE,WAAW,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;CACnD;AAED,UAAU,QAAQ;IAChB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAC5C,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAClC,SAAS,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IACjC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,4BAA4B,EAAE,QAAQ,GAAG,SAAS,CAAC;CACxD;AAyDD,kFAAkF;AA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BAAgB,UAAU,IAAI,SAAS,WAAW,EAAE,CAEnD;AAED,wDAAwD;AACxD,wBAAgB,cAAc,IAAI,WAAW,CAAC,MAAM,CAAC,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAInF;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAWtE;AAED,oDAAoD;AACpD,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAE7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,KAAK,CACnB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,IAAI,CAAC,CA4Df;AAuBD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAIrD;AAED,4DAA4D;AAC5D,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAIrD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAQ9C;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAyBxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CA6B9C;AAED,kDAAkD;AAClD,wBAAgB,gBAAgB,IAAI,IAAI,CAOvC"}
@@ -1,3 +1,5 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
1
3
  import type { SharedValue } from 'react-native-reanimated';
2
4
  import type { VideoPlayerLike, VideoSurfaceType } from './expo-video-module';
3
5
  /**
@@ -205,4 +207,95 @@ export interface MediaFlightController {
205
207
  */
206
208
  progress: SharedValue<number>;
207
209
  }
210
+ /**
211
+ * What Bloom hands a video slot: the three things it must decide, and nothing
212
+ * else.
213
+ *
214
+ * `style` is not advisory. A DOM `<video>` is a REPLACED element, and
215
+ * `position:absolute; inset:0` with `width/height:auto` resolves it to its
216
+ * INTRINSIC size (300x150) instead of stretching — so a slot that drops this
217
+ * style paints a 300x150 video inside whatever box it was given. Spread it.
218
+ */
219
+ export interface MediaVideoSlotProps {
220
+ /**
221
+ * The player Bloom was given — never one Bloom created.
222
+ *
223
+ * `null` means UNBIND THIS ELEMENT NOW, and it must be passed straight
224
+ * through. expo-video answers a null player by emptying the source, which
225
+ * pauses the element without an event; that silence is what stops a surface
226
+ * on its way out from pausing the one the viewer just landed on. Substituting
227
+ * anything else here — keeping the old player, unmounting instead — brings
228
+ * that defect back. See `releaseFlight`.
229
+ */
230
+ player: VideoPlayerLike | null;
231
+ /** Fills the box. Spread it — see above. */
232
+ style: StyleProp<ViewStyle>;
233
+ contentFit: 'contain' | 'cover';
234
+ }
235
+ /**
236
+ * Paint the video yourself.
237
+ *
238
+ * Bloom mounts a `VideoView` with the handful of props it knows about, which is
239
+ * enough until a consumer needs something only its OWN element can give it: a
240
+ * `ref` for `startPictureInPicture()` or `enterFullscreen()`, expo-video's
241
+ * picture-in-picture callbacks, `onFirstFrameRender`, anything expo-video adds
242
+ * later. Widening Bloom's props to cover those would drag expo-video's surface
243
+ * into Bloom's API, and it would be behind again on the next release.
244
+ *
245
+ * So the consumer may build the element instead, with Bloom deciding only what
246
+ * it has to: which player, and a style that fills the box.
247
+ *
248
+ * MEMOISE IT (`useCallback`). The slot is part of what a host publishes to the
249
+ * layer, compared by identity — a new function every render republishes every
250
+ * render. Correct either way, wasteful if you skip it.
251
+ */
252
+ export type MediaVideoSlot = (props: MediaVideoSlotProps) => ReactNode;
253
+ /**
254
+ * A place a media surface may live: the feed row it starts in, the fullscreen
255
+ * player it lands in, and every other end of a flight.
256
+ *
257
+ * A host DECLARES a box; it does not own the media. On web that distinction is
258
+ * the whole feature — the media is ONE DOM node the layer paints once and moves
259
+ * between hosts, so it survives the origin route unmounting mid-flight without
260
+ * ever leaving the document. On native a host renders its media inline, which
261
+ * is what it has always done and what the platform makes correct there.
262
+ */
263
+ export interface MediaFlightHostProps {
264
+ /** The id this host shares with the flight and with the other end. */
265
+ id: string;
266
+ /** What to paint: a still image, or a consumer-owned expo-video player. */
267
+ content: MediaSurfaceContent;
268
+ /** Style of the host BOX. Give it the radius and `overflow: 'hidden'` you want. */
269
+ style?: StyleProp<ViewStyle>;
270
+ /** How the media fills the box. Defaults to `'cover'`. */
271
+ contentFit?: 'contain' | 'cover';
272
+ /**
273
+ * Paint the video yourself, keeping your own `ref` and expo-video props. See
274
+ * {@link MediaVideoSlot}; memoise it.
275
+ */
276
+ renderVideo?: MediaVideoSlot;
277
+ /** Whether the video arm shows expo-video's own controls. Defaults to `false`. */
278
+ nativeControls?: boolean;
279
+ accessibilityLabel?: string;
280
+ /**
281
+ * Android's rendering surface for the video arm. See `MediaSurfaceProps`.
282
+ * Ignored on web, where there is no such choice.
283
+ */
284
+ surfaceType?: VideoSurfaceType;
285
+ /**
286
+ * Passed through as a PROP, never as a style key — react-native-web resolves
287
+ * `box-none`/`box-only` from the prop path only.
288
+ */
289
+ pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only';
290
+ /**
291
+ * Set on a DESTINATION host, to the id its flight was started with, when the
292
+ * destination paints its media ITSELF rather than through the shared node —
293
+ * which on native is always. The web host does not need it: a flight there
294
+ * ends when the destination host claims the node, because by then the node it
295
+ * is claiming has been showing the media all along.
296
+ *
297
+ * Leave it unset on an origin host, which would otherwise hand off to itself.
298
+ */
299
+ flightId?: string;
300
+ }
208
301
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceR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,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;OASG;IACH,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,4CAA4C;IAC5C,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,SAAS,CAAC;AAEvE;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,OAAO,EAAE,mBAAmB,CAAC;IAC7B,mFAAmF;IACnF,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1D;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,6 @@
1
+ import type { MediaFlightHostProps } from './types';
2
+ export declare function MediaFlightHost({ id, content, style, contentFit, renderVideo, nativeControls, accessibilityLabel, surfaceType, pointerEvents, flightId, }: MediaFlightHostProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare namespace MediaFlightHost {
4
+ var displayName: string;
5
+ }
6
+ //# sourceMappingURL=MediaFlightHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaFlightHost.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,OAAO,EACP,KAAK,EACL,UAAoB,EACpB,WAAW,EACX,cAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,QAAQ,GACT,EAAE,oBAAoB,2CAsBtB;yBAjCe,eAAe"}
@@ -0,0 +1,6 @@
1
+ import type { MediaFlightHostProps } from './types';
2
+ export declare function MediaFlightHost({ id, content, style, contentFit, renderVideo, nativeControls, accessibilityLabel, pointerEvents, flightId, }: MediaFlightHostProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare namespace MediaFlightHost {
4
+ var displayName: string;
5
+ }
6
+ //# sourceMappingURL=MediaFlightHost.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaFlightHost.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.web.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,wBAAgB,eAAe,CAAC,EAC9B,EAAE,EACF,OAAO,EACP,KAAK,EACL,UAAoB,EACpB,WAAW,EACX,cAAsB,EACtB,kBAAkB,EAClB,aAAa,EACb,QAAQ,GACT,EAAE,oBAAoB,2CA6CtB;yBAvDe,eAAe"}
@@ -0,0 +1,5 @@
1
+ export declare function MediaFlightLayer(): import("react/jsx-runtime").JSX.Element | null;
2
+ export declare namespace MediaFlightLayer {
3
+ var displayName: string;
4
+ }
5
+ //# sourceMappingURL=MediaFlightLayer.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaFlightLayer.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightLayer.web.tsx"],"names":[],"mappings":"AAqDA,wBAAgB,gBAAgB,mDA+B/B;yBA/Be,gBAAgB"}
@@ -16,7 +16,7 @@
16
16
  import { type ComponentProps } from 'react';
17
17
  import { type ImageStyle, type StyleProp, type ViewStyle } from 'react-native';
18
18
  import Animated from 'react-native-reanimated';
19
- import type { MediaSurfaceContent } from './types';
19
+ import type { MediaSurfaceContent, MediaVideoSlot } from './types';
20
20
  import { type VideoSurfaceType } from './expo-video-module';
21
21
  /**
22
22
  * Exactly what `Animated.View` accepts, taken from the component rather than
@@ -46,6 +46,14 @@ export interface MediaSurfaceProps {
46
46
  * is every property a flying box relies on.
47
47
  */
48
48
  surfaceType?: VideoSurfaceType;
49
+ /**
50
+ * Paint the video yourself, keeping your own `ref` and expo-video props.
51
+ *
52
+ * When this is given, Bloom builds no `VideoView` at all and the optional
53
+ * peer is never loaded on this path — the consumer already imported
54
+ * expo-video to write the slot. See {@link MediaVideoSlot}.
55
+ */
56
+ renderVideo?: MediaVideoSlot;
49
57
  /** Whether the video arm shows expo-video's own controls. Defaults to `false`. */
50
58
  nativeControls?: boolean;
51
59
  accessibilityLabel?: string;
@@ -74,12 +82,16 @@ export interface MediaSurfaceProps {
74
82
  * the element is still in the DOM.
75
83
  *
76
84
  * expo-video's web player mirrors pause across every element bound to it, and
77
- * a `<video>` removed from the DOM is auto-paused by the browser but
78
- * `unmountVideoView` only runs in a PASSIVE effect cleanup, so it happens
79
- * after removal and after that auto-pause. A dying element therefore pauses
80
- * the one the viewer is watching. Setting this for one commit before unmount
81
- * runs expo-video's own `[props.player]` effect early, whose cleanup unbinds,
82
- * so the later pause reaches nobody.
85
+ * a `<video>` removed from the DOM is auto-paused by the browser, so a dying
86
+ * element pauses the one the viewer is watching.
87
+ *
88
+ * Setting this for one commit runs expo-video's own `[props.player]` effect
89
+ * early and the half that matters is `removeAttribute('src'); load()`
90
+ * (`VideoView.web.js:206`), not the unbind beside it. The media element load
91
+ * algorithm pauses WITHOUT firing `pause` (measured in real Chrome, with
92
+ * controls), so the element goes quiet and its later removal fires nothing.
93
+ * Unbinding alone does not help: `unmountVideoView` never clears the handler
94
+ * it installed. See `releaseFlight`.
83
95
  */
84
96
  detached?: boolean;
85
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MediaSurface.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaSurface.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAG/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAE7B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC;AASjE,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,OAAO,EAAE,mBAAmB,CAAC;IAC7B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,4DAA4D;IAC5D,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1D;;;;;;;;;;;;;OAaG;IACH,QAAQ,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AO,EAAE,mBAAmB,CAAC;IAC7B,0EAA0E;IAC1E,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,4DAA4D;IAC5D,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,kFAAkF;IAClF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1D;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,yDA6FvB,CAAC;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,UAAoB,EACpB,kBAAkB,GACnB,EAAE;IACD,OAAO,EAAE,mBAAmB,CAAC;IAC7B,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,2CAaA;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,gBAAgB,CAAA;CAAE,2CAExE"}
@@ -1,9 +1,10 @@
1
1
  export { MediaFlightLayer } from './MediaFlightLayer';
2
+ export { MediaFlightHost } from './MediaFlightHost';
2
3
  export { MediaSurface, MediaPoster, EmptyMediaSurface } from './MediaSurface';
3
4
  export { useMediaFlight } from './use-media-flight';
4
5
  export { DEFAULT_FLIGHT_CORNER_RADIUS, flightProgress, handOffFlight, hasFlight, releaseFlight, resetMediaFlight, } from './store';
5
6
  export { SURFACE_MOUNT_TIMEOUT_MS } from './constants';
6
7
  export { loadExpoVideo, warnExpoVideoUnavailable, provideExpoVideo, resetExpoVideoModule, type ExpoVideoLike, type VideoPlayerLike, type VideoSurfaceContentFit, type VideoSurfaceType, type VideoViewLikeProps, } from './expo-video-module';
7
- export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
8
+ export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightHostProps, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
8
9
  export type { MediaSurfaceProps } from './MediaSurface';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,aAAa,EACb,SAAS,EACT,aAAa,EACb,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,aAAa,EACb,SAAS,EACT,aAAa,EACb,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The web barrel, which exists to NAME the `.web` siblings.
3
+ *
4
+ * Export conditions do not apply to relative specifiers, so a bundler that is
5
+ * not Metro reaches `MediaFlightLayer.web.tsx` and `MediaFlightHost.web.tsx`
6
+ * only because this file spells them out. Those two are the whole web fork of
7
+ * this family: the layer that paints each shared media node once, and the host
8
+ * that claims it. Everything else below is the same module on both platforms.
9
+ */
10
+ export { MediaFlightLayer } from './MediaFlightLayer.web';
11
+ export { MediaFlightHost } from './MediaFlightHost.web';
12
+ export { MediaSurface, MediaPoster, EmptyMediaSurface } from './MediaSurface';
13
+ export { useMediaFlight } from './use-media-flight';
14
+ export { DEFAULT_FLIGHT_CORNER_RADIUS, flightProgress, handOffFlight, hasFlight, releaseFlight, resetMediaFlight, } from './store';
15
+ export { SURFACE_MOUNT_TIMEOUT_MS } from './constants';
16
+ export { loadExpoVideo, warnExpoVideoUnavailable, provideExpoVideo, resetExpoVideoModule, type ExpoVideoLike, type VideoPlayerLike, type VideoSurfaceContentFit, type VideoSurfaceType, type VideoViewLikeProps, } from './expo-video-module';
17
+ export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightHostProps, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
18
+ export type { MediaSurfaceProps } from './MediaSurface';
19
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/index.web.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,aAAa,EACb,SAAS,EACT,aAAa,EACb,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,93 @@
1
+ import type { MediaSurfaceContent, MediaVideoSlot } from './types';
2
+ /** What the layer paints into a shared node, as its current holder wants it. */
3
+ export interface MediaNodeRender {
4
+ content: MediaSurfaceContent;
5
+ contentFit: 'contain' | 'cover';
6
+ /** The consumer's own video element, if it brought one. Compared by identity. */
7
+ renderVideo: MediaVideoSlot | undefined;
8
+ nativeControls: boolean;
9
+ accessibilityLabel: string | undefined;
10
+ /** Forwarded to the media, so a consumer keeps its own first-frame signal. */
11
+ flightId: string | undefined;
12
+ }
13
+ /** A flight outranks a host: the layer holds the node until the leg ends. */
14
+ export declare const HOST_RANK = 0;
15
+ export declare const FLIGHT_RANK = 1;
16
+ interface MediaNodeClaim {
17
+ el: HTMLElement;
18
+ rank: number;
19
+ /** Registration order, so the most recent host wins among equals. */
20
+ seq: number;
21
+ /**
22
+ * What this claimant wants painted — or `undefined` for a claim that decides
23
+ * only WHERE the node lives.
24
+ *
25
+ * The flight is the second kind, and that distinction is load-bearing. A
26
+ * flight that published a render of its own would replace whatever the hosts
27
+ * were painting for the length of the leg, and if a consumer brought its own
28
+ * element (`renderVideo`) the flight would swap it out and back — two
29
+ * remounts, in the middle of the one operation whose entire purpose is that
30
+ * the element is never rebuilt. Measured: the consumer's `<video>` ended the
31
+ * flight as a different node, with the original left disconnected.
32
+ */
33
+ render: MediaNodeRender | undefined;
34
+ }
35
+ interface MediaNodeRecord {
36
+ wrapper: HTMLDivElement;
37
+ claims: MediaNodeClaim[];
38
+ /**
39
+ * How the media is painted right now: the top claim's, or — while the node is
40
+ * PARKED between hosts — the last claim's.
41
+ *
42
+ * Parking has to keep painting. A node the layer stopped rendering would lose
43
+ * its element to React, which is the removal this whole module exists to
44
+ * avoid, and it would lose it exactly in the gap between the origin
45
+ * unmounting and the destination mounting: the moment of the flight.
46
+ */
47
+ render: MediaNodeRender;
48
+ }
49
+ /** What the layer needs in order to paint one shared node. */
50
+ export interface MediaNodeView {
51
+ id: string;
52
+ wrapper: HTMLDivElement;
53
+ render: MediaNodeRender;
54
+ }
55
+ interface NodeRegistry {
56
+ nodes: Map<string, MediaNodeRecord>;
57
+ listeners: Set<() => void>;
58
+ /** Cached for `useSyncExternalStore`, which compares snapshots by identity. */
59
+ snapshot: readonly MediaNodeView[];
60
+ holder: HTMLElement | null;
61
+ seq: number;
62
+ }
63
+ declare global {
64
+ var __oxyhq_bloom_media_nodes__: NodeRegistry | undefined;
65
+ }
66
+ /**
67
+ * Claim the shared node for `id` into `el`.
68
+ *
69
+ * Idempotent for an unchanged claim: called from a layout effect on every
70
+ * render, it moves the node once and publishes nothing afterwards.
71
+ */
72
+ export declare function claimMediaNode(id: string, el: HTMLElement, rank: number, render?: MediaNodeRender): void;
73
+ /**
74
+ * Drop a claim. The node goes to the next claim, or parks — or is DISPOSED, if
75
+ * nothing is going to want it back.
76
+ *
77
+ * "Nothing is going to want it back" is a fact the registry can read rather
78
+ * than a timeout it has to guess: no claim left AND no flight live for this id.
79
+ * During a navigation there IS a flight live — that is what a flight IS — so
80
+ * the node survives the gap between the origin unmounting and the destination
81
+ * mounting. Without a flight, an unmounted host is just a host that went away.
82
+ */
83
+ export declare function releaseMediaNode(id: string, el: HTMLElement, rank: number): void;
84
+ /** Whether anything holds a shared node for this id. */
85
+ export declare function hasMediaNode(id: string): boolean;
86
+ /** Subscribe to the shared-node set. The layer's `useSyncExternalStore` half. */
87
+ export declare function subscribeToMediaNodes(listener: () => void): () => void;
88
+ /** Every shared node that something is currently holding. Stable identity. */
89
+ export declare function getMediaNodes(): readonly MediaNodeView[];
90
+ /** Test seam: drop every node and take its wrapper out of the document. */
91
+ export declare function resetMediaNodes(): void;
92
+ export {};
93
+ //# sourceMappingURL=media-node.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-node.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/media-node.web.ts"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEnE,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC,iFAAiF;IACjF,WAAW,EAAE,cAAc,GAAG,SAAS,CAAC;IACxC,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,6EAA6E;AAC7E,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,UAAU,cAAc;IACtB,EAAE,EAAE,WAAW,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;;;OAWG;IACH,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC;CACrC;AAED,UAAU,eAAe;IACvB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB;;;;;;;;OAQG;IACH,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACpC,SAAS,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;IAC3B,+EAA+E;IAC/E,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IACnC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,2BAA2B,EAAE,YAAY,GAAG,SAAS,CAAC;CAC3D;AAuJD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,WAAW,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,eAAe,GACvB,IAAI,CAgBN;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAehF;AAED,wDAAwD;AACxD,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAMtE;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,IAAI,SAAS,aAAa,EAAE,CAExD;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,IAAI,IAAI,CAUtC"}
@@ -139,10 +139,25 @@ export declare function flyBack(id: string): void;
139
139
  * nobody having called `pause()`.
140
140
  *
141
141
  * Rendering `player={null}` for one commit runs expo-video's own `[props.player]`
142
- * effect while the node is STILL in the DOM: its cleanup calls
143
- * `unmountVideoView`, the element leaves `_mountedVideos`, and its later pause
144
- * reaches nobody. That is the documented mount/unmount pair, not a patch of
145
- * somebody else's module.
142
+ * effect while the node is STILL in the DOM, and the operative part of that is
143
+ * NOT the unbind. `unmountVideoView` takes the element out of `_mountedVideos`
144
+ * and leaves the `onpause` handler `_addListeners` installed, so unbinding
145
+ * alone would still mirror. What saves it is the other half of the same
146
+ * branch: `removeAttribute('src'); load()` (`VideoView.web.js:206`). The media
147
+ * element load algorithm sets `paused` to true WITHOUT firing `pause`, so the
148
+ * element goes quiet, and its later removal fires nothing either because it is
149
+ * already paused.
150
+ *
151
+ * Measured in real Chrome, with controls: a playing element put through
152
+ * `removeAttribute('src') + load()` reports events `["play"]` and nothing more,
153
+ * while the same element paused by hand, or removed from the DOM while
154
+ * playing, reports `["play","pause"]`. Against real builds: without this commit
155
+ * the destination ends STOPPED (5/5), with it PLAYING (6/6) and the position
156
+ * carried.
157
+ *
158
+ * DO NOT replace this with a direct `unmountVideoView` call. It looks
159
+ * equivalent, it is the half that does not matter, and the fix would disappear
160
+ * silently. `MediaFlight.test.tsx` makes that substitution its control.
146
161
  *
147
162
  * The cost is one frame in which the outgoing surface shows its poster instead
148
163
  * of video. It is already on its way out and the destination is live by then —
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/store.ts"],"names":[],"mappings":"AA2BA,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAUjC,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,IAAsB,CAAC;AAEhE;;;;;;;;;GASG;AACH,UAAU,YAAY;IACpB,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,YAAY,EAAE,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC;IAChC,UAAU,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;IACjD,uEAAuE;IACvE,WAAW,EAAE,UAAU,CA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