@oxyhq/bloom 1.2.1 → 1.3.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 (85) hide show
  1. package/docs/getting-started.mdx +29 -0
  2. package/docs/media-flight.mdx +108 -0
  3. package/lib/commonjs/media-flight/MediaFlightHost.js +56 -0
  4. package/lib/commonjs/media-flight/MediaFlightHost.js.map +1 -0
  5. package/lib/commonjs/media-flight/MediaFlightHost.web.js +85 -0
  6. package/lib/commonjs/media-flight/MediaFlightHost.web.js.map +1 -0
  7. package/lib/commonjs/media-flight/MediaFlightLayer.js +9 -1
  8. package/lib/commonjs/media-flight/MediaFlightLayer.js.map +1 -1
  9. package/lib/commonjs/media-flight/MediaFlightLayer.web.js +212 -0
  10. package/lib/commonjs/media-flight/MediaFlightLayer.web.js.map +1 -0
  11. package/lib/commonjs/media-flight/MediaSurface.js +3 -2
  12. package/lib/commonjs/media-flight/MediaSurface.js.map +1 -1
  13. package/lib/commonjs/media-flight/index.js +8 -1
  14. package/lib/commonjs/media-flight/index.js.map +1 -1
  15. package/lib/commonjs/media-flight/index.web.js +115 -0
  16. package/lib/commonjs/media-flight/index.web.js.map +1 -0
  17. package/lib/commonjs/media-flight/media-node.web.js +291 -0
  18. package/lib/commonjs/media-flight/media-node.web.js.map +1 -0
  19. package/lib/commonjs/media-flight/store.js +61 -2
  20. package/lib/commonjs/media-flight/store.js.map +1 -1
  21. package/lib/module/media-flight/MediaFlightHost.js +51 -0
  22. package/lib/module/media-flight/MediaFlightHost.js.map +1 -0
  23. package/lib/module/media-flight/MediaFlightHost.web.js +80 -0
  24. package/lib/module/media-flight/MediaFlightHost.web.js.map +1 -0
  25. package/lib/module/media-flight/MediaFlightLayer.js +9 -1
  26. package/lib/module/media-flight/MediaFlightLayer.js.map +1 -1
  27. package/lib/module/media-flight/MediaFlightLayer.web.js +206 -0
  28. package/lib/module/media-flight/MediaFlightLayer.web.js.map +1 -0
  29. package/lib/module/media-flight/MediaSurface.js +3 -2
  30. package/lib/module/media-flight/MediaSurface.js.map +1 -1
  31. package/lib/module/media-flight/index.js +2 -1
  32. package/lib/module/media-flight/index.js.map +1 -1
  33. package/lib/module/media-flight/index.web.js +19 -0
  34. package/lib/module/media-flight/index.web.js.map +1 -0
  35. package/lib/module/media-flight/media-node.web.js +281 -0
  36. package/lib/module/media-flight/media-node.web.js.map +1 -0
  37. package/lib/module/media-flight/store.js +61 -2
  38. package/lib/module/media-flight/store.js.map +1 -1
  39. package/lib/typescript/commonjs/media-flight/MediaFlightHost.d.ts +6 -0
  40. package/lib/typescript/commonjs/media-flight/MediaFlightHost.d.ts.map +1 -0
  41. package/lib/typescript/commonjs/media-flight/MediaFlightHost.web.d.ts +6 -0
  42. package/lib/typescript/commonjs/media-flight/MediaFlightHost.web.d.ts.map +1 -0
  43. package/lib/typescript/commonjs/media-flight/MediaFlightLayer.web.d.ts +5 -0
  44. package/lib/typescript/commonjs/media-flight/MediaFlightLayer.web.d.ts.map +1 -0
  45. package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts +17 -0
  46. package/lib/typescript/commonjs/media-flight/MediaSurface.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/media-flight/index.d.ts +2 -1
  48. package/lib/typescript/commonjs/media-flight/index.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/media-flight/index.web.d.ts +19 -0
  50. package/lib/typescript/commonjs/media-flight/index.web.d.ts.map +1 -0
  51. package/lib/typescript/commonjs/media-flight/media-node.web.d.ts +79 -0
  52. package/lib/typescript/commonjs/media-flight/media-node.web.d.ts.map +1 -0
  53. package/lib/typescript/commonjs/media-flight/store.d.ts +39 -1
  54. package/lib/typescript/commonjs/media-flight/store.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/media-flight/types.d.ts +57 -0
  56. package/lib/typescript/commonjs/media-flight/types.d.ts.map +1 -1
  57. package/lib/typescript/module/media-flight/MediaFlightHost.d.ts +6 -0
  58. package/lib/typescript/module/media-flight/MediaFlightHost.d.ts.map +1 -0
  59. package/lib/typescript/module/media-flight/MediaFlightHost.web.d.ts +6 -0
  60. package/lib/typescript/module/media-flight/MediaFlightHost.web.d.ts.map +1 -0
  61. package/lib/typescript/module/media-flight/MediaFlightLayer.web.d.ts +5 -0
  62. package/lib/typescript/module/media-flight/MediaFlightLayer.web.d.ts.map +1 -0
  63. package/lib/typescript/module/media-flight/MediaSurface.d.ts +17 -0
  64. package/lib/typescript/module/media-flight/MediaSurface.d.ts.map +1 -1
  65. package/lib/typescript/module/media-flight/index.d.ts +2 -1
  66. package/lib/typescript/module/media-flight/index.d.ts.map +1 -1
  67. package/lib/typescript/module/media-flight/index.web.d.ts +19 -0
  68. package/lib/typescript/module/media-flight/index.web.d.ts.map +1 -0
  69. package/lib/typescript/module/media-flight/media-node.web.d.ts +79 -0
  70. package/lib/typescript/module/media-flight/media-node.web.d.ts.map +1 -0
  71. package/lib/typescript/module/media-flight/store.d.ts +39 -1
  72. package/lib/typescript/module/media-flight/store.d.ts.map +1 -1
  73. package/lib/typescript/module/media-flight/types.d.ts +57 -0
  74. package/lib/typescript/module/media-flight/types.d.ts.map +1 -1
  75. package/package.json +6 -1
  76. package/src/media-flight/MediaFlightHost.tsx +54 -0
  77. package/src/media-flight/MediaFlightHost.web.tsx +84 -0
  78. package/src/media-flight/MediaFlightLayer.tsx +7 -1
  79. package/src/media-flight/MediaFlightLayer.web.tsx +219 -0
  80. package/src/media-flight/MediaSurface.tsx +19 -1
  81. package/src/media-flight/index.ts +2 -0
  82. package/src/media-flight/index.web.ts +45 -0
  83. package/src/media-flight/media-node.web.ts +335 -0
  84. package/src/media-flight/store.ts +61 -1
  85. package/src/media-flight/types.ts +58 -0
@@ -64,6 +64,35 @@ export function Hello() {
64
64
  }
65
65
  ```
66
66
 
67
+ ## If you build with Vite (or any ESM web bundler)
68
+
69
+ Bloom reaches its **optional** peers through a `require()` that Metro marks
70
+ optional. An ESM web bundle has no `require` at all — measured: `typeof require`
71
+ is `undefined` in a Vite bundle — so those loads cannot run and every optional
72
+ peer degrades **even when the package is installed**. Metro is unaffected, which
73
+ is why this only appears off Metro.
74
+
75
+ **Check in one line**, in your app's console:
76
+
77
+ ```js
78
+ typeof require // "undefined" -> the optional peers below are inert for you
79
+ ```
80
+
81
+ Today one of them can be handed over explicitly:
82
+
83
+ ```ts
84
+ import * as ExpoVideo from 'expo-video';
85
+ import { provideExpoVideo } from '@oxyhq/bloom/media-flight';
86
+
87
+ provideExpoVideo(ExpoVideo); // otherwise video silently shows only its poster
88
+ ```
89
+
90
+ The others have no equivalent yet, so on an ESM bundle you currently lose
91
+ scoped NativeWind presets (`BloomColorScope`), adaptive colours, haptics and the
92
+ connection toasts. Most of them say so in the dev console — the warning ends
93
+ `Reason: this bundle has no CommonJS require` — with the exception noted in
94
+ `theme/adaptive-colors.ts`, which degrades silently.
95
+
67
96
  ## Recommended layout
68
97
 
69
98
  If your app supports both light and dark themes:
@@ -130,6 +130,15 @@ reports that itself (expo-video's `onFirstFrameRender`, expo-image's `onLoad`).
130
130
  Called mid-flight, a hand-off is remembered rather than obeyed — the surface
131
131
  finishes travelling first, or it would vanish between the two rects.
132
132
 
133
+ On web the release then renders one commit with `player={null}` before the node
134
+ leaves the DOM. What that buys is **not** the unbind beside it: expo-video
135
+ answers a null player with `removeAttribute('src'); load()`, and the media
136
+ element load algorithm pauses WITHOUT firing `pause`, so the outgoing element
137
+ goes quiet and its removal mirrors nothing. Unbinding alone would not help —
138
+ `unmountVideoView` never clears the `onpause` it installed. Measured in real
139
+ Chrome with controls, and against real builds: without that commit the
140
+ destination ends stopped, with it playing and in position.
141
+
133
142
  **The success criterion is continuity, not speed.** With a shared player the
134
143
  frame is already on screen before the tap; the flight does not make the video
135
144
  appear sooner, it makes it never disappear. Measure "was there ever no frame?"
@@ -198,10 +207,88 @@ Concretely:
198
207
  | `flyBack(id)` | flies it to its anchor and releases it on landing |
199
208
  | `progress` | `SharedValue<number>`, 0 → 1 for the most recent leg |
200
209
 
210
+ And one component, `<MediaFlightHost id content style … />` — where the media
211
+ lives when it is not flying. See below.
212
+
201
213
  The most recently registered node for an id **is** the anchor, which is what
202
214
  makes a destination mounting over an origin take over as the fly-back target
203
215
  without either of them coordinating.
204
216
 
217
+ ## `MediaFlightHost`: one element for the whole flight, on web
218
+
219
+ Everything above is what a flight does with a **picture**. A video needs one
220
+ more thing, and it is not a matter of ordering: on web the pause and the
221
+ restart are properties of TWO elements sharing one player.
222
+
223
+ Measured against expo-video's real `VideoPlayerWeb` (57.0.2), across every
224
+ element topology a consumer can produce on one player:
225
+
226
+ | topology | position | playback |
227
+ | ------------------------------------------ | -------- | -------- |
228
+ | origin dies BEFORE the destination mounts | `ct=0` | playing |
229
+ | origin dies AFTER the destination mounts | `ct=4.28`| paused |
230
+ | one element, re-parented | `ct=4.28`| playing |
231
+
232
+ The first two rows contain no Bloom surface at all — a feed row and a fullscreen
233
+ player sharing a player produce them on their own. Two elements give you the
234
+ position or the playback, never both, because `mountVideoView` seeds a new
235
+ element from the first one already mounted and `_addListeners` gives every
236
+ element an `onpause` that pauses all the others — handlers `unmountVideoView`
237
+ never removes. An element on its way out still governs the player.
238
+
239
+ So on web, Bloom paints the media **once**, into a wrapper it created outside
240
+ React, and moves that wrapper between the boxes that want it:
241
+
242
+ ```tsx
243
+ // The feed row
244
+ <MediaFlightHost id={mediaId} content={{ kind: 'video', player }} contentFit="cover"
245
+ style={{ width: 320, height: 180, borderRadius: 12, overflow: 'hidden' }} />
246
+
247
+ // The fullscreen route, later, with the same id and the same player
248
+ <MediaFlightHost id={mediaId} content={{ kind: 'video', player }} contentFit="contain"
249
+ style={StyleSheet.absoluteFill} />
250
+ ```
251
+
252
+ A host **declares a box**; it does not own the media. It also registers itself
253
+ as the flight's anchor, so `flyTo`/`flyBack` measure the box the media actually
254
+ paints in rather than a box the consumer measured separately.
255
+
256
+ On **native** `MediaFlightHost` renders its own `MediaSurface` inline, exactly
257
+ as consumers did before it existed. One API, two implementations, and nothing
258
+ about the call site says which one you got.
259
+
260
+ ### Why it works, in three parts
261
+
262
+ - **React never sees the move.** The media is rendered with `createPortal` into
263
+ a container whose identity never changes, and a portal's container is not part
264
+ of React's tree. `createPortal` to a container that *changes* unmounts and
265
+ remounts — the thing being avoided — so the container is created once, outside
266
+ React, and only its position in the document changes.
267
+ - **The browser never sees a removal.** HTML's removal steps for a media element
268
+ await a stable state and then abort if the element is back in a document, so a
269
+ synchronous `appendChild` from one parent to another does not pause playback.
270
+ (This is why re-parenting a `<video>` works and re-parenting an `<iframe>`
271
+ does not: an iframe reloads.)
272
+ - **A node with no host waits IN the document.** It parks in a 1×1 transparent
273
+ holder, because a detached `<video>` is auto-paused. It is disposed when
274
+ nothing can want it back — no claim and no flight live for that id — which is
275
+ a fact the registry reads rather than a timeout it guesses.
276
+
277
+ ### The flight outranks every host
278
+
279
+ A destination that mounts mid-flight claims its id, and the layer keeps the node
280
+ anyway until the leg ends — otherwise the media would jump to its landing place
281
+ while still travelling. That claim IS the hand-off: with one element there is no
282
+ first frame to wait for, because the element the destination just claimed has
283
+ been playing since the origin. `flightId` and `handOff` remain for native and
284
+ for a destination that paints its own surface.
285
+
286
+ ### What it does not change
287
+
288
+ `flyTo` with an id that has no host still paints its own `MediaSurface`, which
289
+ is what every image flight does. Nothing about the gallery, the anchors or the
290
+ animation changes.
291
+
205
292
  ## It never takes a click
206
293
 
207
294
  Every node the layer renders is `pointerEvents="none"`, inside an `OverlayRoot`
@@ -260,6 +347,27 @@ the root barrel, because Metro does not tree-shake). `expo-video` is
260
347
  flies video without it gets the poster plus a single dev warning naming the
261
348
  package.
262
349
 
350
+ <Callout variant="warning" title="On Vite (or any ESM web bundler) you must hand expo-video over">
351
+ Bloom loads optional peers through a `require()` that Metro marks optional.
352
+ **An ESM web bundle has no `require` at all** — measured: `typeof require` is
353
+ `undefined` in a Vite bundle — so the load cannot run and video degrades to its
354
+ poster **even when `expo-video` is installed**. Metro has a real `require` and
355
+ is unaffected, which is why this only shows up off Metro.
356
+
357
+ One line at startup fixes it:
358
+
359
+ ```ts
360
+ import * as ExpoVideo from 'expo-video';
361
+ import { provideExpoVideo } from '@oxyhq/bloom/media-flight';
362
+
363
+ provideExpoVideo(ExpoVideo);
364
+ ```
365
+
366
+ How to tell whether it applies to you: run `typeof require` in your app's
367
+ console. If it answers `"undefined"`, you need this. The dev console also says
368
+ so directly — the warning ends `Reason: this bundle has no CommonJS require`.
369
+ </Callout>
370
+
263
371
  ## What a jest run can and cannot see
264
372
 
265
373
  The registry: that a flight is created, that a second `flyTo` retargets rather
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MediaFlightHost = MediaFlightHost;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _MediaSurface = require("./MediaSurface.js");
10
+ var _store = require("./store.js");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ /**
13
+ * A place a media surface lives — NATIVE.
14
+ *
15
+ * Here a host is exactly what it looks like: a box that renders its own
16
+ * `MediaSurface`. Native has no equivalent of the web problem this component
17
+ * exists for (a DOM `<video>` that must survive its React owner), and expo-video
18
+ * on native hands a player between views without the pause mirroring that makes
19
+ * two web elements mutually destructive. So this is the plain implementation,
20
+ * and `MediaFlightHost.web.tsx` is the one that re-parents.
21
+ *
22
+ * ONE API, two implementations. A consumer writes the same JSX on both
23
+ * platforms and never learns which one it got.
24
+ */
25
+
26
+ function MediaFlightHost({
27
+ id,
28
+ content,
29
+ style,
30
+ contentFit = 'cover',
31
+ nativeControls = false,
32
+ accessibilityLabel,
33
+ surfaceType,
34
+ pointerEvents,
35
+ flightId
36
+ }) {
37
+ // A callback ref rather than an effect: the anchor must be measurable the
38
+ // moment the box is on screen, and a tap can come one frame later.
39
+ const setNode = (0, _react.useCallback)(node => (0, _store.registerAnchor)(id, node), [id]);
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
41
+ ref: setNode,
42
+ style: style,
43
+ pointerEvents: pointerEvents,
44
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaSurface.MediaSurface, {
45
+ content: content,
46
+ contentFit: contentFit,
47
+ nativeControls: nativeControls,
48
+ accessibilityLabel: accessibilityLabel,
49
+ surfaceType: surfaceType,
50
+ flightId: flightId,
51
+ style: _reactNative.StyleSheet.absoluteFill
52
+ })
53
+ });
54
+ }
55
+ MediaFlightHost.displayName = 'MediaFlightHost';
56
+ //# sourceMappingURL=MediaFlightHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_MediaSurface","_store","_jsxRuntime","MediaFlightHost","id","content","style","contentFit","nativeControls","accessibilityLabel","surfaceType","pointerEvents","flightId","setNode","useCallback","node","registerAnchor","jsx","View","ref","children","MediaSurface","StyleSheet","absoluteFill","displayName"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightHost.tsx"],"mappings":";;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAyC,IAAAI,WAAA,GAAAJ,OAAA;AAjBzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQO,SAASK,eAAeA,CAAC;EAC9BC,EAAE;EACFC,OAAO;EACPC,KAAK;EACLC,UAAU,GAAG,OAAO;EACpBC,cAAc,GAAG,KAAK;EACtBC,kBAAkB;EAClBC,WAAW;EACXC,aAAa;EACbC;AACoB,CAAC,EAAE;EACvB;EACA;EACA,MAAMC,OAAO,GAAG,IAAAC,kBAAW,EACxBC,IAAiB,IAAK,IAAAC,qBAAc,EAACZ,EAAE,EAAEW,IAAI,CAAC,EAC/C,CAACX,EAAE,CACL,CAAC;EAED,oBACE,IAAAF,WAAA,CAAAe,GAAA,EAAClB,YAAA,CAAAmB,IAAI;IAACC,GAAG,EAAEN,OAAQ;IAACP,KAAK,EAAEA,KAAM;IAACK,aAAa,EAAEA,aAAc;IAAAS,QAAA,eAC7D,IAAAlB,WAAA,CAAAe,GAAA,EAACjB,aAAA,CAAAqB,YAAY;MACXhB,OAAO,EAAEA,OAAQ;MACjBE,UAAU,EAAEA,UAAW;MACvBC,cAAc,EAAEA,cAAe;MAC/BC,kBAAkB,EAAEA,kBAAmB;MACvCC,WAAW,EAAEA,WAAY;MACzBE,QAAQ,EAAEA,QAAS;MACnBN,KAAK,EAAEgB,uBAAU,CAACC;IAAa,CAChC;EAAC,CACE,CAAC;AAEX;AAEApB,eAAe,CAACqB,WAAW,GAAG,iBAAiB","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MediaFlightHost = MediaFlightHost;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _mediaNodeWeb = require("./media-node.web.js");
10
+ var _store = require("./store.js");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ /**
13
+ * A place a media surface lives — WEB, where it does NOT render the media.
14
+ *
15
+ * This host renders an empty box and CLAIMS the shared node for its id. The
16
+ * media itself is one DOM node the layer paints once and moves between hosts
17
+ * with `appendChild`, so a video keeps its element, its decoder and its
18
+ * position when the origin route unmounts mid-flight. See `media-node.web.ts`
19
+ * for why one element is the only topology that keeps both the position and the
20
+ * playback.
21
+ *
22
+ * The consumer writes the same JSX as on native and never learns the
23
+ * difference — including that here, `flightId` is not needed: a flight ends
24
+ * when a destination host claims the node, and the node it claims has been
25
+ * showing the media all along.
26
+ */
27
+
28
+ function MediaFlightHost({
29
+ id,
30
+ content,
31
+ style,
32
+ contentFit = 'cover',
33
+ nativeControls = false,
34
+ accessibilityLabel,
35
+ pointerEvents,
36
+ flightId
37
+ }) {
38
+ // State rather than a ref, because the claim runs in a layout effect and an
39
+ // effect cannot depend on a ref's mutation. One extra render at mount.
40
+ const [node, setNode] = (0, _react.useState)(null);
41
+ const setHost = (0, _react.useCallback)(next => {
42
+ (0, _store.registerAnchor)(id, next);
43
+ setNode(next);
44
+ }, [id]);
45
+ const render = (0, _react.useMemo)(() => ({
46
+ content,
47
+ contentFit,
48
+ nativeControls,
49
+ accessibilityLabel,
50
+ flightId
51
+ }), [content, contentFit, nativeControls, accessibilityLabel, flightId]);
52
+ const renderRef = (0, _react.useRef)(render);
53
+
54
+ // Declared FIRST so it runs first on mount: it seeds the ref the claim below
55
+ // reads, and afterwards it is what pushes prop changes into a live claim —
56
+ // in place, without releasing, because a release would move the node and a
57
+ // move away and back is a removal, which is what pauses a video.
58
+ (0, _react.useLayoutEffect)(() => {
59
+ renderRef.current = render;
60
+ const el = node;
61
+ if (el !== null) (0, _mediaNodeWeb.claimMediaNode)(id, el, _mediaNodeWeb.HOST_RANK, render);
62
+ }, [id, node, render]);
63
+
64
+ // Owns the claim's LIFETIME, and only that: its cleanup must run when the
65
+ // host really goes away, never on a prop change.
66
+ (0, _react.useLayoutEffect)(() => {
67
+ const el = node;
68
+ if (el === null) return undefined;
69
+ (0, _mediaNodeWeb.claimMediaNode)(id, el, _mediaNodeWeb.HOST_RANK, renderRef.current);
70
+ // A new host appearing mid-flight IS the hand-off. On native the
71
+ // destination has to decode a first frame before it can say this; here the
72
+ // node it just claimed is the one that has been playing since the origin,
73
+ // so mounting is the whole signal. An origin host does not reach this with
74
+ // a flight live — it claimed before the flight began.
75
+ if ((0, _store.hasFlight)(id)) (0, _store.handOffFlight)(id);
76
+ return () => (0, _mediaNodeWeb.releaseMediaNode)(id, el, _mediaNodeWeb.HOST_RANK);
77
+ }, [id, node]);
78
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
79
+ ref: setHost,
80
+ style: style,
81
+ pointerEvents: pointerEvents
82
+ });
83
+ }
84
+ MediaFlightHost.displayName = 'MediaFlightHost';
85
+ //# sourceMappingURL=MediaFlightHost.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_mediaNodeWeb","_store","_jsxRuntime","MediaFlightHost","id","content","style","contentFit","nativeControls","accessibilityLabel","pointerEvents","flightId","node","setNode","useState","setHost","useCallback","next","registerAnchor","render","useMemo","renderRef","useRef","useLayoutEffect","current","el","claimMediaNode","HOST_RANK","undefined","hasFlight","handOffFlight","releaseMediaNode","jsx","View","ref","displayName"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightHost.web.tsx"],"mappings":";;;;;;AAeA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AAMA,IAAAG,MAAA,GAAAH,OAAA;AAAmE,IAAAI,WAAA,GAAAJ,OAAA;AAxBnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaO,SAASK,eAAeA,CAAC;EAC9BC,EAAE;EACFC,OAAO;EACPC,KAAK;EACLC,UAAU,GAAG,OAAO;EACpBC,cAAc,GAAG,KAAK;EACtBC,kBAAkB;EAClBC,aAAa;EACbC;AACoB,CAAC,EAAE;EACvB;EACA;EACA,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAG,IAAAC,eAAQ,EAAc,IAAI,CAAC;EAEnD,MAAMC,OAAO,GAAG,IAAAC,kBAAW,EACxBC,IAAiB,IAAK;IACrB,IAAAC,qBAAc,EAACd,EAAE,EAAEa,IAAI,CAAC;IACxBJ,OAAO,CAACI,IAAI,CAAC;EACf,CAAC,EACD,CAACb,EAAE,CACL,CAAC;EAED,MAAMe,MAAM,GAAG,IAAAC,cAAO,EACpB,OAAO;IAAEf,OAAO;IAAEE,UAAU;IAAEC,cAAc;IAAEC,kBAAkB;IAAEE;EAAS,CAAC,CAAC,EAC7E,CAACN,OAAO,EAAEE,UAAU,EAAEC,cAAc,EAAEC,kBAAkB,EAAEE,QAAQ,CACpE,CAAC;EACD,MAAMU,SAAS,GAAG,IAAAC,aAAM,EAACH,MAAM,CAAC;;EAEhC;EACA;EACA;EACA;EACA,IAAAI,sBAAe,EAAC,MAAM;IACpBF,SAAS,CAACG,OAAO,GAAGL,MAAM;IAC1B,MAAMM,EAAE,GAAGb,IAAqC;IAChD,IAAIa,EAAE,KAAK,IAAI,EAAE,IAAAC,4BAAc,EAACtB,EAAE,EAAEqB,EAAE,EAAEE,uBAAS,EAAER,MAAM,CAAC;EAC5D,CAAC,EAAE,CAACf,EAAE,EAAEQ,IAAI,EAAEO,MAAM,CAAC,CAAC;;EAEtB;EACA;EACA,IAAAI,sBAAe,EAAC,MAAM;IACpB,MAAME,EAAE,GAAGb,IAAqC;IAChD,IAAIa,EAAE,KAAK,IAAI,EAAE,OAAOG,SAAS;IACjC,IAAAF,4BAAc,EAACtB,EAAE,EAAEqB,EAAE,EAAEE,uBAAS,EAAEN,SAAS,CAACG,OAAO,CAAC;IACpD;IACA;IACA;IACA;IACA;IACA,IAAI,IAAAK,gBAAS,EAACzB,EAAE,CAAC,EAAE,IAAA0B,oBAAa,EAAC1B,EAAE,CAAC;IACpC,OAAO,MAAM,IAAA2B,8BAAgB,EAAC3B,EAAE,EAAEqB,EAAE,EAAEE,uBAAS,CAAC;EAClD,CAAC,EAAE,CAACvB,EAAE,EAAEQ,IAAI,CAAC,CAAC;EAEd,oBAAO,IAAAV,WAAA,CAAA8B,GAAA,EAACjC,YAAA,CAAAkC,IAAI;IAACC,GAAG,EAAEnB,OAAQ;IAACT,KAAK,EAAEA,KAAM;IAACI,aAAa,EAAEA;EAAc,CAAE,CAAC;AAC3E;AAEAP,eAAe,CAACgC,WAAW,GAAG,iBAAiB","ignoreList":[]}
@@ -94,7 +94,8 @@ function MediaFlightSurface({
94
94
  content,
95
95
  cornerRadius,
96
96
  contentFit,
97
- surfaceType
97
+ surfaceType,
98
+ unbinding
98
99
  } = flight;
99
100
 
100
101
  // The COMMIT signal `flyTo`'s promise waits on, and the reason it is an effect
@@ -131,6 +132,13 @@ function MediaFlightSurface({
131
132
  content: content,
132
133
  contentFit: contentFit,
133
134
  surfaceType: surfaceType
135
+ // One commit with no player before this node leaves the DOM — see
136
+ // `releaseFlight`, and note there that what it buys is expo-video
137
+ // emptying the source, not the unbind. Without it the dying element's
138
+ // auto-pause mirrors through expo-video and stops the video the viewer
139
+ // just landed on.
140
+ ,
141
+ detached: unbinding
134
142
  // A flying surface is a picture, never a control: it must not intercept
135
143
  // the press that is already travelling to whatever is underneath it.
136
144
  ,
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_index","_portal","_MediaSurface","_store","_jsxRuntime","MediaFlightLayer","flights","useSyncExternalStore","subscribeToFlights","getFlights","length","jsx","Portal","children","OverlayRoot","map","flight","MediaFlightSurface","id","displayName","from","to","progress","content","cornerRadius","contentFit","surfaceType","useEffect","notifySurfaceMounted","originX","x","originY","y","boxStyle","useAnimatedStyle","transform","translateX","interpolate","value","translateY","width","height","MediaSurface","pointerEvents","style","styles","box","left","top","borderRadius","StyleSheet","create","position","overflow"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightLayer.tsx"],"mappings":";;;;;;AAqCA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA+E,IAAAO,WAAA,GAAAP,OAAA;AA5C/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,gBAAgBA,CAAA,EAAG;EACjC,MAAMC,OAAO,GAAG,IAAAC,2BAAoB,EAACC,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ACZ;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_index","_portal","_MediaSurface","_store","_jsxRuntime","MediaFlightLayer","flights","useSyncExternalStore","subscribeToFlights","getFlights","length","jsx","Portal","children","OverlayRoot","map","flight","MediaFlightSurface","id","displayName","from","to","progress","content","cornerRadius","contentFit","surfaceType","unbinding","useEffect","notifySurfaceMounted","originX","x","originY","y","boxStyle","useAnimatedStyle","transform","translateX","interpolate","value","translateY","width","height","MediaSurface","detached","pointerEvents","style","styles","box","left","top","borderRadius","StyleSheet","create","position","overflow"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightLayer.tsx"],"mappings":";;;;;;AAqCA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA+E,IAAAO,WAAA,GAAAP,OAAA;AA5C/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,gBAAgBA,CAAA,EAAG;EACjC,MAAMC,OAAO,GAAG,IAAAC,2BAAoB,EAACC,yBAAkB,EAAEC,iBAAU,EAAEA,iBAAU,CAAC;EAEhF,IAAIH,OAAO,CAACI,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAErC,oBACE,IAAAN,WAAA,CAAAO,GAAA,EAACV,OAAA,CAAAW,MAAM;IAAAC,QAAA,eAKL,IAAAT,WAAA,CAAAO,GAAA,EAACX,MAAA,CAAAc,WAAW;M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K,EAAE,IAAAH,kCAAW,EAAChB,QAAQ,CAACiB,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAACnB,IAAI,CAACqB,KAAK,EAAEpB,EAAE,CAACoB,KAAK,CAAC,CAAC;IAClEC,MAAM,EAAE,IAAAJ,kCAAW,EAAChB,QAAQ,CAACiB,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAACnB,IAAI,CAACsB,MAAM,EAAErB,EAAE,CAACqB,MAAM,CAAC;EACtE,CAAC,CAAC,EACF,CAACpB,QAAQ,EAAEQ,OAAO,EAAEE,OAAO,EAAEZ,IAAI,CAACqB,KAAK,EAAErB,IAAI,CAACsB,MAAM,EAAErB,EAAE,CAACoB,KAAK,EAAEpB,EAAE,CAACqB,MAAM,CAC3E,CAAC;EAED,oBACE,IAAAtC,WAAA,CAAAO,GAAA,EAACT,aAAA,CAAAyC,YAAY;IACXpB,OAAO,EAAEA,OAAQ;IACjBE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA;IACb;IACA;IACA;IACA;IACA;IAAA;IACAkB,QAAQ,EAAEjB;IACV;IACA;IAAA;IACAkB,aAAa,EAAC,MAAM;IACpBC,KAAK,EAAE,CAACC,MAAM,CAACC,GAAG,EAAE;MAAEC,IAAI,EAAE5B,EAAE,CAACU,CAAC;MAAEmB,GAAG,EAAE7B,EAAE,CAACY,CAAC;MAAEkB,YAAY,EAAE3B;IAAa,CAAC,EAAEU,QAAQ;EAAE,CACtF,CAAC;AAEN;AAEA,MAAMa,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,GAAG,EAAE;IACHM,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MediaFlightLayer = MediaFlightLayer;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _reactDom = require("react-dom");
10
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
+ var _index = require("../overlay/index.js");
12
+ var _indexWeb = require("../portal/index.web.js");
13
+ var _MediaSurface = require("./MediaSurface.js");
14
+ var _mediaNodeWeb = require("./media-node.web.js");
15
+ var _store = require("./store.js");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
18
+ /**
19
+ * The layer that survives navigation — WEB, where it also OWNS the media.
20
+ *
21
+ * Everything in `MediaFlightLayer.tsx` still holds: mounted once at the app
22
+ * root, painting through `Portal` so a flying surface belongs to neither route.
23
+ * What this fork adds is the other half of the web story.
24
+ *
25
+ * ## It paints each shared node exactly once, forever
26
+ *
27
+ * `createPortal(<MediaSurface …/>, wrapper)` for every id a host has claimed.
28
+ * The wrapper is a plain `<div>` created OUTSIDE React by `media-node.web.ts`,
29
+ * so React reconciles the media against a container whose identity never
30
+ * changes while the registry moves that container between hosts with
31
+ * `appendChild`. React never sees the move; the browser never sees a removal;
32
+ * the video never loses its element, its decoder or its position.
33
+ *
34
+ * That is why the layer, and not the host, renders the media on web: the media
35
+ * has to be rendered by a tree that outlives every host, and the app root is
36
+ * the only such tree.
37
+ *
38
+ * ## A flying surface with a shared node paints nothing itself
39
+ *
40
+ * It becomes a positioned, animated BOX that claims the node — one more host,
41
+ * outranking the others for the length of the leg. A flight for an id with no
42
+ * shared node (an image gallery, any consumer that has not adopted a host)
43
+ * falls back to painting its own `MediaSurface`, which is what every flight did
44
+ * before hosts existed.
45
+ */
46
+
47
+ function MediaFlightLayer() {
48
+ const flights = (0, _react.useSyncExternalStore)(_store.subscribeToFlights, _store.getFlights, _store.getFlights);
49
+ const nodes = (0, _react.useSyncExternalStore)(_mediaNodeWeb.subscribeToMediaNodes, _mediaNodeWeb.getMediaNodes, _mediaNodeWeb.getMediaNodes);
50
+ if (flights.length === 0 && nodes.length === 0) return null;
51
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
52
+ children: [nodes.map(node => /*#__PURE__*/(0, _jsxRuntime.jsx)(SharedMediaNode, {
53
+ node: node
54
+ }, node.id)), flights.length === 0 ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_indexWeb.Portal, {
55
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.OverlayRoot, {
56
+ children: flights.map(flight => /*#__PURE__*/(0, _jsxRuntime.jsx)(MediaFlightSurface, {
57
+ flight: flight
58
+ // Read from the SNAPSHOT, never from the registry: a lookup
59
+ // during render is external mutable state in a memoized
60
+ // position, which the React Compiler is allowed to freeze.
61
+ ,
62
+ shared: nodes.some(node => node.id === flight.id)
63
+ }, flight.id))
64
+ })
65
+ })]
66
+ });
67
+ }
68
+ MediaFlightLayer.displayName = 'MediaFlightLayer';
69
+
70
+ /** One media element, painted into the wrapper its id owns, and never again. */
71
+ function SharedMediaNode({
72
+ node
73
+ }) {
74
+ const {
75
+ content,
76
+ contentFit,
77
+ nativeControls,
78
+ accessibilityLabel,
79
+ flightId
80
+ } = node.render;
81
+ return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaSurface.MediaSurface, {
82
+ content: content,
83
+ contentFit: contentFit,
84
+ nativeControls: nativeControls,
85
+ accessibilityLabel: accessibilityLabel,
86
+ flightId: flightId,
87
+ style: _reactNative.StyleSheet.absoluteFill
88
+ }), node.wrapper);
89
+ }
90
+
91
+ /**
92
+ * One flying surface. See `MediaFlightLayer.tsx` for why the size is animated
93
+ * rather than scaled.
94
+ */
95
+ function MediaFlightSurface({
96
+ flight,
97
+ shared
98
+ }) {
99
+ const {
100
+ id,
101
+ from,
102
+ to,
103
+ progress,
104
+ content,
105
+ cornerRadius,
106
+ contentFit,
107
+ surfaceType,
108
+ unbinding
109
+ } = flight;
110
+ (0, _react.useEffect)(() => {
111
+ (0, _store.notifySurfaceMounted)(id);
112
+ }, [id]);
113
+ const originX = from.x - to.x;
114
+ const originY = from.y - to.y;
115
+
116
+ // CRITICAL — every shared value a mapper READS must be listed in its deps.
117
+ // On web WITHOUT the react-native-worklets babel plugin, reanimated drives a
118
+ // mapper off its deps array rather than off the reads it detects: with none,
119
+ // it runs ONCE and freezes at the opening frame. See `MediaFlightLayer.tsx`.
120
+ const boxStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
121
+ transform: [{
122
+ translateX: (0, _reactNativeReanimated.interpolate)(progress.value, [0, 1], [originX, 0])
123
+ }, {
124
+ translateY: (0, _reactNativeReanimated.interpolate)(progress.value, [0, 1], [originY, 0])
125
+ }],
126
+ width: (0, _reactNativeReanimated.interpolate)(progress.value, [0, 1], [from.width, to.width]),
127
+ height: (0, _reactNativeReanimated.interpolate)(progress.value, [0, 1], [from.height, to.height])
128
+ }), [progress, originX, originY, from.width, from.height, to.width, to.height]);
129
+ const box = [styles.box, {
130
+ left: to.x,
131
+ top: to.y,
132
+ borderRadius: cornerRadius
133
+ }, boxStyle];
134
+ const render = (0, _react.useMemo)(() => ({
135
+ content,
136
+ contentFit,
137
+ nativeControls: false,
138
+ accessibilityLabel: undefined,
139
+ // A flying surface never hands off to itself.
140
+ flightId: undefined
141
+ }), [content, contentFit]);
142
+
143
+ // The shared node is already painting this media. The flight is then a BOX
144
+ // that borrows it for the length of the leg, never a second copy.
145
+ if (shared) return /*#__PURE__*/(0, _jsxRuntime.jsx)(FlyingSharedNode, {
146
+ id: id,
147
+ style: box,
148
+ render: render
149
+ });
150
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaSurface.MediaSurface, {
151
+ content: content,
152
+ contentFit: contentFit,
153
+ surfaceType: surfaceType
154
+ // One commit with no player before this node leaves the DOM — see
155
+ // `releaseFlight`. Only the no-shared-node path can need it: a shared
156
+ // node is never removed, which is the point of the whole mechanism.
157
+ ,
158
+ detached: unbinding
159
+ // A flying surface is a picture, never a control.
160
+ ,
161
+ pointerEvents: "none",
162
+ style: box
163
+ });
164
+ }
165
+
166
+ /**
167
+ * The flight's own claim on a shared node.
168
+ *
169
+ * `pointerEvents` stays `none` on the BOX: a flying surface must not take the
170
+ * press travelling to whatever is underneath it. The wrapper inside sets
171
+ * `pointer-events: auto` for the media's sake, which is what a host needs and
172
+ * is inert here — a descendant asking for `auto` does not override a `none`
173
+ * ancestor.
174
+ */
175
+ function FlyingSharedNode({
176
+ id,
177
+ style,
178
+ render
179
+ }) {
180
+ const [node, setNode] = (0, _react.useState)(null);
181
+ const setBox = (0, _react.useCallback)(next => setNode(next), []);
182
+ const renderRef = (0, _react.useRef)(render);
183
+
184
+ // Declared first so it runs first on mount, and afterwards is what pushes
185
+ // prop changes into a live claim IN PLACE — releasing and re-claiming would
186
+ // move the node away and back, and a move away is a removal.
187
+ (0, _react.useLayoutEffect)(() => {
188
+ renderRef.current = render;
189
+ const el = node;
190
+ if (el !== null) (0, _mediaNodeWeb.claimMediaNode)(id, el, _mediaNodeWeb.FLIGHT_RANK, render);
191
+ }, [id, node, render]);
192
+
193
+ // Owns the claim's LIFETIME, and only that.
194
+ (0, _react.useLayoutEffect)(() => {
195
+ const el = node;
196
+ if (el === null) return undefined;
197
+ (0, _mediaNodeWeb.claimMediaNode)(id, el, _mediaNodeWeb.FLIGHT_RANK, renderRef.current);
198
+ return () => (0, _mediaNodeWeb.releaseMediaNode)(id, el, _mediaNodeWeb.FLIGHT_RANK);
199
+ }, [id, node]);
200
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
201
+ ref: setBox,
202
+ style: style,
203
+ pointerEvents: "none"
204
+ });
205
+ }
206
+ const styles = _reactNative.StyleSheet.create({
207
+ box: {
208
+ position: 'absolute',
209
+ overflow: 'hidden'
210
+ }
211
+ });
212
+ //# sourceMappingURL=MediaFlightLayer.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_reactDom","_reactNativeReanimated","_interopRequireWildcard","_index","_indexWeb","_MediaSurface","_mediaNodeWeb","_store","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","MediaFlightLayer","flights","useSyncExternalStore","subscribeToFlights","getFlights","nodes","subscribeToMediaNodes","getMediaNodes","length","jsxs","Fragment","children","map","node","jsx","SharedMediaNode","id","Portal","OverlayRoot","flight","MediaFlightSurface","shared","some","displayName","content","contentFit","nativeControls","accessibilityLabel","flightId","render","createPortal","MediaSurface","style","StyleSheet","absoluteFill","wrapper","from","to","progress","cornerRadius","surfaceType","unbinding","useEffect","notifySurfaceMounted","originX","x","originY","y","boxStyle","useAnimatedStyle","transform","translateX","interpolate","value","translateY","width","height","box","styles","left","top","borderRadius","useMemo","undefined","FlyingSharedNode","detached","pointerEvents","setNode","useState","setBox","useCallback","next","renderRef","useRef","useLayoutEffect","current","el","claimMediaNode","FLIGHT_RANK","releaseMediaNode","View","ref","create","position","overflow"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightLayer.web.tsx"],"mappings":";;;;;;AA4BA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAC,uBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,I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BAAA,CAAAkB,OAAQ,CAACyF,IAAI;IAACC,GAAG,EAAEZ,MAAO;IAACrC,KAAK,EAAEA,KAAM;IAACkC,aAAa,EAAC;EAAM,CAAE,CAAC;AAC1E;AAEA,MAAMR,MAAM,GAAGzB,uBAAU,CAACiD,MAAM,CAAC;EAC/BzB,GAAG,EAAE;IACH0B,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -67,7 +67,8 @@ const MediaSurface = exports.MediaSurface = /*#__PURE__*/(0, _react.memo)(functi
67
67
  nativeControls = false,
68
68
  accessibilityLabel,
69
69
  pointerEvents,
70
- flightId
70
+ flightId,
71
+ detached = false
71
72
  }) {
72
73
  // Captured once — see `surfaceType` above. A consumer changing it later gets
73
74
  // the value the view was mounted with, which is the only value expo-video
@@ -118,7 +119,7 @@ const MediaSurface = exports.MediaSurface = /*#__PURE__*/(0, _react.memo)(functi
118
119
  onLoad: content.kind === 'video' ? undefined : reportLive,
119
120
  ...webDraggableProps
120
121
  }), content.kind === 'video' && expoVideo !== null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(expoVideo.VideoView, {
121
- player: content.player,
122
+ player: detached ? null : content.player,
122
123
  contentFit: contentFit,
123
124
  surfaceType: mountedSurfaceType,
124
125
  nativeControls: nativeControls
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","_expoImage","_reactNativeReanimated","_interopRequireDefault","_store","_expoVideoModule","_jsxRuntime","e","__esModule","default","webDraggableProps","Platform","OS","draggable","MediaSurface","exports","memo","content","style","contentFit","surfaceType","nativeControls","accessibilityLabel","pointerEvents","flightId","mountedSurfaceType","useState","reportLive","useCallback","undefined","handOffFlight","still","kind","poster","uri","expoVideo","loadExpoVideo","warnExpoVideoUnavailable","jsxs","View","styles","box","children","jsx","Image","source","StyleSheet","absoluteFill","transition","onLoad","VideoView","player","fillReplaced","onFirstFrameRender","displayName","MediaPoster","EmptyMediaSurface","empty","create","width","height","overflow","backgroundColor"],"sourceRoot":"../../../src","sources":["media-flight/MediaSurface.tsx"],"mappings":";;;;;;;;AAeA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,gBAAA,GAAAN,OAAA;AAI6B,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAI,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMG,iBAAiB,GAAGC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG;EAAEC,SAAS,EAAE;AAAM,CAAC,GAAG,CAAC,CAAC;AA0C3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAG,IAAAE,WAAI,EAAC,SAASF,YAAYA,CAAC;EACrDG,OAAO;EACPC,KAAK;EACLC,UAAU,GAAG,SAAS;EACtBC,WAAW,GAAG,aAAa;EAC3BC,cAAc,GAAG,KAAK;EACtBC,kBAAkB;EAClBC,aAAa;EACbC;AACiB,CAAC,EAAE;EACpB;EACA;EACA;EACA,MAAM,CAACC,kBAAkB,CAAC,GAAG,IAAAC,eAAQ,EAACN,WAAW,CAAC;;EAElD;EACA;EACA;EACA;EACA,MAAMO,UAAU,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACnC,IAAIJ,QAAQ,KAAKK,SAAS,EAAE,IAAAC,oBAAa,EAACN,QAAQ,CAAC;EACrD,CAAC,E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MAAMiB,MAAM,GAAGM,uBAAU,CAACY,MAAM,CAAC;EAC/B;AACF;AACA;AACA;EACEN,YAAY,EAAE;IACZO,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDnB,GAAG,EAAE;IACH;IACA;IACAoB,QAAQ,EAAE;EACZ,CAAC;EACDJ,KAAK,EAAE;IACLK,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_reactNative","_expoImage","_reactNativeReanimated","_interopRequireDefault","_store","_expoVideoModule","_jsxRuntime","e","__esModule","default","webDraggableProps","Platform","OS","draggable","MediaSurface","exports","memo","content","style","contentFit","surfaceType","nativeControls","accessibilityLabel","pointerEvents","flightId","detached","mountedSurfaceType","useState","reportLive","useCallback","undefined","handOffFlight","still","kind","poster","uri","expoVideo","loadExpoVideo","warnExpoVideoUnavailable","jsxs","View","styles","box","children","jsx","Image","source","StyleSheet","absoluteFill","transition","onLoad","VideoView","player","fillReplaced","onFirstFrameRender","displayName","MediaPoster","EmptyMediaSurface","empty","create","width","height","overflow","backgroundColor"],"sourceRoot":"../../../src","sources":["media-flight/MediaSurface.tsx"],"mappings":";;;;;;;;AAeA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,gBAAA,GAAAN,OAAA;AAI6B,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAI,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAjC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;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