@oxyhq/bloom 1.5.0 → 1.7.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.
- package/NOTICE +46 -0
- package/docs/media-flight.mdx +162 -3
- package/lib/commonjs/media-flight/MediaFlightHost.js +14 -1
- package/lib/commonjs/media-flight/MediaFlightHost.js.map +1 -1
- package/lib/commonjs/media-flight/MediaFlightHost.web.js +9 -1
- package/lib/commonjs/media-flight/MediaFlightHost.web.js.map +1 -1
- package/lib/commonjs/media-flight/MediaFlightLayer.js +4 -5
- package/lib/commonjs/media-flight/MediaFlightLayer.js.map +1 -1
- package/lib/commonjs/media-flight/media-node.web.js +37 -1
- package/lib/commonjs/media-flight/media-node.web.js.map +1 -1
- package/lib/module/media-flight/MediaFlightHost.js +14 -1
- package/lib/module/media-flight/MediaFlightHost.js.map +1 -1
- package/lib/module/media-flight/MediaFlightHost.web.js +9 -1
- package/lib/module/media-flight/MediaFlightHost.web.js.map +1 -1
- package/lib/module/media-flight/MediaFlightLayer.js +4 -5
- package/lib/module/media-flight/MediaFlightLayer.js.map +1 -1
- package/lib/module/media-flight/media-node.web.js +37 -1
- package/lib/module/media-flight/media-node.web.js.map +1 -1
- package/lib/typescript/commonjs/media-flight/MediaFlightHost.d.ts +2 -1
- package/lib/typescript/commonjs/media-flight/MediaFlightHost.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/MediaFlightHost.web.d.ts +9 -1
- package/lib/typescript/commonjs/media-flight/MediaFlightHost.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/MediaFlightLayer.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/index.d.ts +1 -1
- package/lib/typescript/commonjs/media-flight/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/index.web.d.ts +1 -1
- package/lib/typescript/commonjs/media-flight/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/media-node.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/media-flight/types.d.ts +24 -7
- package/lib/typescript/commonjs/media-flight/types.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/MediaFlightHost.d.ts +2 -1
- package/lib/typescript/module/media-flight/MediaFlightHost.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/MediaFlightHost.web.d.ts +9 -1
- package/lib/typescript/module/media-flight/MediaFlightHost.web.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/MediaFlightLayer.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/index.d.ts +1 -1
- package/lib/typescript/module/media-flight/index.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/index.web.d.ts +1 -1
- package/lib/typescript/module/media-flight/index.web.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/media-node.web.d.ts.map +1 -1
- package/lib/typescript/module/media-flight/types.d.ts +24 -7
- package/lib/typescript/module/media-flight/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/media-flight/MediaFlightHost.tsx +21 -4
- package/src/media-flight/MediaFlightHost.web.tsx +20 -4
- package/src/media-flight/MediaFlightLayer.tsx +4 -5
- package/src/media-flight/index.ts +3 -0
- package/src/media-flight/index.web.ts +3 -0
- package/src/media-flight/media-node.web.ts +42 -1
- package/src/media-flight/types.ts +27 -7
package/NOTICE
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@oxyhq/bloom — third-party notices
|
|
2
|
+
=================================
|
|
3
|
+
|
|
4
|
+
Bloom includes code derived from other open-source projects. Each derived file
|
|
5
|
+
carries a header naming its source, the version it was taken from, and what was
|
|
6
|
+
changed; this file carries the licences those sources require, in full.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
react-native-teleport
|
|
10
|
+
---------------------
|
|
11
|
+
|
|
12
|
+
https://github.com/kirillzyusko/react-native-teleport — by Kiryl Ziusko.
|
|
13
|
+
|
|
14
|
+
Bloom's media-flight layer moves one media element between hosts instead of
|
|
15
|
+
rebuilding it at each end. Bloom arrived at the web technique independently and
|
|
16
|
+
then found that react-native-teleport had solved the same problem, better in
|
|
17
|
+
places: it is the source of the `moveBefore`-with-`insertBefore`-fallback move
|
|
18
|
+
used in `src/media-flight/media-node.web.ts`, and — where noted in those files —
|
|
19
|
+
of Bloom's native re-parenting.
|
|
20
|
+
|
|
21
|
+
We are grateful for it, and for the fact that it is readable: the reasoning in
|
|
22
|
+
its source and its documentation is what let us check our own.
|
|
23
|
+
|
|
24
|
+
Taken from version 1.2.0.
|
|
25
|
+
|
|
26
|
+
MIT License
|
|
27
|
+
|
|
28
|
+
Copyright (c) 2025 Kiryl Ziusko
|
|
29
|
+
|
|
30
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
31
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
32
|
+
in the Software without restriction, including without limitation the rights
|
|
33
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
34
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
35
|
+
furnished to do so, subject to the following conditions:
|
|
36
|
+
|
|
37
|
+
The above copyright notice and this permission notice shall be included in all
|
|
38
|
+
copies or substantial portions of the Software.
|
|
39
|
+
|
|
40
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
41
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
42
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
43
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
44
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
45
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
46
|
+
SOFTWARE.
|
package/docs/media-flight.mdx
CHANGED
|
@@ -149,9 +149,67 @@ and "did `currentTime` advance monotonically?", not time-to-first-frame.
|
|
|
149
149
|
|
|
150
150
|
## Why this exists rather than `react-native-teleport`
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
**Correction, 2026-08-26.** This section used to say that `react-native-teleport`
|
|
153
|
+
requires `presentation: 'transparentModal'` and "has no web story at all". Both
|
|
154
|
+
were false, both were written here without checking, and they described someone
|
|
155
|
+
else's work wrongly in a public repository. Verified against the published
|
|
156
|
+
package (`react-native-teleport@1.2.0`), what is actually true is the opposite,
|
|
157
|
+
and it is worth reading:
|
|
158
|
+
|
|
159
|
+
```js
|
|
160
|
+
// lib/module/views/Portal/index.js — the WEB implementation
|
|
161
|
+
if (!elRef.current) elRef.current = document.createElement("div"); // outside React
|
|
162
|
+
const supportsMoveBefore = "moveBefore" in Element.prototype;
|
|
163
|
+
parent.moveBefore(child, before); // insertBefore fallback
|
|
164
|
+
createPortal(children, elRef.current);
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Their own documentation says so plainly — "✅ Works across **iOS, Android, and
|
|
168
|
+
Web**" (`docs/docs/intro.mdx`) and "Cross-platform: Consistent on iOS, Android
|
|
169
|
+
and web" (`docs/docs/guides/portal.md`) — which is what this guide should have
|
|
170
|
+
checked before claiming otherwise.
|
|
171
|
+
|
|
172
|
+
That is **the same mechanism** described elsewhere in this guide as Bloom's:
|
|
173
|
+
a wrapper created outside React, `createPortal` into a container whose identity
|
|
174
|
+
never changes, and the wrapper moved between hosts. Down to the `moveBefore`
|
|
175
|
+
with a fallback. Bloom arrived at it independently, which is corroboration that
|
|
176
|
+
the technique is right — not grounds for having said they lacked it.
|
|
177
|
+
|
|
178
|
+
**The real reasons Bloom has its own**, both checkable:
|
|
179
|
+
|
|
180
|
+
- **Bloom needed a flight, not a portal.** The animated box, the anchor
|
|
181
|
+
registry, the rect measurement, the poster behind the media, `contentFit`, and
|
|
182
|
+
the shared-player semantics are the feature; teleporting the node is one piece
|
|
183
|
+
of it.
|
|
184
|
+
- **`react-native-teleport` ships native code** — `codegenConfig`
|
|
185
|
+
(`TeleportViewSpec`), C++ shadow nodes under `common/cpp/`, `android/build.gradle`,
|
|
186
|
+
`Teleport.podspec`. Bloom has never shipped native code, deliberately: adding
|
|
187
|
+
it would force a native rebuild on Mention, Allo, Alia, TNP, Homiio and Inbox
|
|
188
|
+
at the next bump.
|
|
189
|
+
|
|
190
|
+
### What Bloom takes from them, and where to look for more
|
|
191
|
+
|
|
192
|
+
Bloom's web move primitive is now **theirs**: `moveBefore` with an
|
|
193
|
+
`insertBefore` fallback, derived from `src/views/Portal/index.tsx` in
|
|
194
|
+
react-native-teleport 1.2.0 (MIT, Copyright (c) 2025 Kiryl Ziusko — see
|
|
195
|
+
`NOTICE` at the repository root, and the header on
|
|
196
|
+
`src/media-flight/media-node.web.ts`). `appendChild` of an attached node is a
|
|
197
|
+
remove followed by an insert; `moveBefore` does not run the removal steps at
|
|
198
|
+
all. Measured, it makes no difference to a playing `<video>` — and Bloom is not
|
|
199
|
+
only video, so the correct primitive is worth having for focus, `<iframe>`s and
|
|
200
|
+
CSS animations, where the aborted-removal reprieve does not apply.
|
|
201
|
+
|
|
202
|
+
**This is a FORK, and forks go stale.** Their fixes will not arrive here on
|
|
203
|
+
their own, and their repository is active — there is a note in their blog from
|
|
204
|
+
August 2026 about faster re-parenting on Android that Bloom does not have.
|
|
205
|
+
Anyone maintaining this in a year: the upstream is
|
|
206
|
+
https://github.com/kirillzyusko/react-native-teleport, and it is worth reading
|
|
207
|
+
before rewriting anything here.
|
|
208
|
+
|
|
209
|
+
**And what Bloom did NOT do:** their native side re-parents for real. Bloom's
|
|
210
|
+
native path does not — it keeps the origin, the flying surface and the
|
|
211
|
+
destination as three views on one player (see the section on decoders below).
|
|
212
|
+
The re-parenting here is web-only.
|
|
155
213
|
|
|
156
214
|
Under expo-router on web the origin route is **unmounted** the moment the URL
|
|
157
215
|
changes. Anything the origin was rendering — a `VideoView`, a decoded image —
|
|
@@ -323,6 +381,17 @@ and a media element that does not fill its wrapper warns once with both
|
|
|
323
381
|
rectangles. Neither is a gate — they are the three trap-doors of this contract
|
|
324
382
|
turned into three messages.
|
|
325
383
|
|
|
384
|
+
**The invariant that keeps this a primitive and not a coupling:** Bloom decides
|
|
385
|
+
`player`, `style` and `contentFit`, and those three are exactly the three that
|
|
386
|
+
depend on WHERE THE NODE IS. Nothing else about the media is Bloom's business.
|
|
387
|
+
If a fourth prop ever has to be added beside them, that is the signal that
|
|
388
|
+
coupling is leaking in — not a reason to add a fifth.
|
|
389
|
+
|
|
390
|
+
The player's own type flows from `content` into the slot, so a slot hands it
|
|
391
|
+
straight to `VideoView` with no cast. Bloom transports that object; it never
|
|
392
|
+
reads it, and narrowing what you only transport is what pushes a consumer
|
|
393
|
+
towards `as`.
|
|
394
|
+
|
|
326
395
|
The flight itself never brings an element. Its claim on a shared node says only
|
|
327
396
|
WHERE the node lives — a flight that published its own render would swap a
|
|
328
397
|
consumer's element out for Bloom's and back again, which is two remounts in the
|
|
@@ -387,6 +456,96 @@ i.e. visibly not the thumbnail it is replacing. `width`/`height` are
|
|
|
387
456
|
interpolated instead; the position still rides a transform, so the only layout
|
|
388
457
|
work per frame is one absolutely-positioned node resizing.
|
|
389
458
|
|
|
459
|
+
## Open: three decoders on native, and why the obvious cut is wrong
|
|
460
|
+
|
|
461
|
+
On web a flight re-parents one element, so there is exactly one video view for
|
|
462
|
+
the whole leg. **On native there is no re-parenting**, so during a flight the
|
|
463
|
+
origin host, the destination host and the layer's own flying surface are three
|
|
464
|
+
views on one player — and the flying one is a `TextureVideoView`, because a
|
|
465
|
+
`SurfaceView` composites outside the view hierarchy and would ignore the clip,
|
|
466
|
+
radius and transform that a flying box is made of.
|
|
467
|
+
|
|
468
|
+
Three concurrent decoders is not a detail on a phone. Many Android devices
|
|
469
|
+
guarantee only one or two concurrent hardware decoders; the third falls back to
|
|
470
|
+
software or fails, which on a low-end device is a black video — worse than
|
|
471
|
+
anything this transition is trying to hide.
|
|
472
|
+
|
|
473
|
+
**The obvious cut is to paint the poster on the flying surface for the ~300 ms
|
|
474
|
+
of the leg. Do not do that.** It is the same artefact this package spent a day
|
|
475
|
+
removing from the web path: a 267–282 ms frozen picture mid-flight was measured,
|
|
476
|
+
treated as the defect, and made the merge criterion. A still frame for 300 ms
|
|
477
|
+
cannot be a defect on web and an optimisation on native. And it is in fact
|
|
478
|
+
worse, because the poster is a *different image* — usually frame zero, not the
|
|
479
|
+
frame the viewer was looking at — so the sequence becomes playing at 4.28 s, a
|
|
480
|
+
jump to an unrelated still, then live again at 4.6 s. Two content jumps instead
|
|
481
|
+
of one freeze.
|
|
482
|
+
|
|
483
|
+
**If the decoder count does turn out to hurt, the cut goes the other way: the
|
|
484
|
+
ENDS paint posters and the flying surface keeps the video.** During a leg the
|
|
485
|
+
two hosts are covered by the surface that is flying; nobody is looking at them.
|
|
486
|
+
The one being watched should be the one that plays.
|
|
487
|
+
|
|
488
|
+
That costs something honest: it needs the layer to arbitrate who paints while a
|
|
489
|
+
leg is live — the rank machinery that exists on web and that native deliberately
|
|
490
|
+
does not have. It may not be worth it.
|
|
491
|
+
|
|
492
|
+
### What is measured about it, and what is not
|
|
493
|
+
|
|
494
|
+
Measured on an Android emulator (2026-08-26), with the flight isolated from the
|
|
495
|
+
route change by clearing app data and deep-linking straight into the fullscreen
|
|
496
|
+
route:
|
|
497
|
+
|
|
498
|
+
```
|
|
499
|
+
slot called Cannot set prop 'player'
|
|
500
|
+
cold, no flight x2 0 / 3 0 / 0
|
|
501
|
+
with a flight x2 4 / 4 2 / 2
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
**The third view is real: one per flight, and it is not remounted.** With no
|
|
505
|
+
flight there is no `TextureVideoView` and no error; with one, the layer mounts
|
|
506
|
+
its own `MediaSurface` (no `renderVideo`, so `surfaceType` defaults to
|
|
507
|
+
`'textureView'`). The name in the error is the RUNTIME class of the instance —
|
|
508
|
+
`ConcreteViewProp.kt` throws `PropSetException(name, onView::class, …)` — so it
|
|
509
|
+
is not a mislabelling.
|
|
510
|
+
|
|
511
|
+
Traced on device, one flight:
|
|
512
|
+
|
|
513
|
+
```
|
|
514
|
+
01:09:41.923 MOUNT <id> ak19
|
|
515
|
+
01:09:42.846 PropSetException: Cannot set prop 'player' on view 'TextureVideoView'
|
|
516
|
+
01:09:42.868 UNMOUNT <id> ak19 same instance
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
**The exception fires at the UNBIND, not at the mount** — ~920 ms after mounting
|
|
520
|
+
and 22 ms before the surface is destroyed. That is the `player={null}` commit
|
|
521
|
+
`releaseFlight` renders on the way out: the same instruction the web path
|
|
522
|
+
depends on (it makes an element go quiet without an event) is rejected by the
|
|
523
|
+
Kotlin view, which reports being "notified of disconnection from the player
|
|
524
|
+
view, even though it's still connected". Nothing is wrong with the mount, and
|
|
525
|
+
anyone reading this looking to fix mounting would be looking in the wrong place.
|
|
526
|
+
|
|
527
|
+
One mount, one unmount, one exception, 2 flights of 2. Matching a bench
|
|
528
|
+
measurement of the same path: the layer mounts its arm ONCE per flight, and the
|
|
529
|
+
`detached` commit is a re-render rather than a remount.
|
|
530
|
+
|
|
531
|
+
**No observed consequence.** Playback continues, and picture-in-picture opens
|
|
532
|
+
with the video playing rather than black or frozen. A failed assignment onto a
|
|
533
|
+
view that is destroyed 22 ms later has nobody left to affect. Note the limit of
|
|
534
|
+
that claim: it rules out the mechanism we suspected — a remount restarting the
|
|
535
|
+
decoder, hidden by an emulator that has no real ones — rather than proving no
|
|
536
|
+
consequence exists at all.
|
|
537
|
+
|
|
538
|
+
**What is NOT measured: whether any of this costs anything on real hardware.**
|
|
539
|
+
An emulator has no real hardware decoders, so the decoder-count question — the
|
|
540
|
+
reason this section exists — cannot be answered where everything else in this
|
|
541
|
+
package was measured. It needs a physical device.
|
|
542
|
+
|
|
543
|
+
Until then this section is the decision, not the code. The upstream report is
|
|
544
|
+
written and deliberately not filed: an issue about an error with no symptom is
|
|
545
|
+
easy to archive, and it may share a root with the web-side defect already filed
|
|
546
|
+
(`expo/expo#49359` — expo-video handling several views on one player). If a real
|
|
547
|
+
device shows a consequence, it goes up with this attached.
|
|
548
|
+
|
|
390
549
|
## Android: a flight crosses a surface-type boundary
|
|
391
550
|
|
|
392
551
|
expo-video renders Android video into a `SurfaceView` by default. A flight
|
|
@@ -23,6 +23,19 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
23
|
* platforms and never learns which one it got.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Hand a consumer's slot to `MediaSurface`, which is not generic.
|
|
28
|
+
*
|
|
29
|
+
* SOUND, and the reason is the invariant this whole family is built on: the
|
|
30
|
+
* only player Bloom ever passes to a slot is the one it took out of that
|
|
31
|
+
* slot's own `content`. Bloom transports the object and never substitutes one,
|
|
32
|
+
* so the value really is a `P` at runtime — the assertion says what the types
|
|
33
|
+
* cannot follow through a `memo`'d component, and it lives HERE, once, rather
|
|
34
|
+
* than in every consumer's `renderVideo`.
|
|
35
|
+
*/
|
|
36
|
+
function widenSlot(slot) {
|
|
37
|
+
return slot;
|
|
38
|
+
}
|
|
26
39
|
function MediaFlightHost({
|
|
27
40
|
id,
|
|
28
41
|
content,
|
|
@@ -45,7 +58,7 @@ function MediaFlightHost({
|
|
|
45
58
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MediaSurface.MediaSurface, {
|
|
46
59
|
content: content,
|
|
47
60
|
contentFit: contentFit,
|
|
48
|
-
renderVideo: renderVideo,
|
|
61
|
+
renderVideo: widenSlot(renderVideo),
|
|
49
62
|
nativeControls: nativeControls,
|
|
50
63
|
accessibilityLabel: accessibilityLabel,
|
|
51
64
|
surfaceType: surfaceType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_MediaSurface","_store","_jsxRuntime","MediaFlightHost","id","content","style","contentFit","renderVideo","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;
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_MediaSurface","_store","_jsxRuntime","widenSlot","slot","MediaFlightHost","id","content","style","contentFit","renderVideo","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;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAAyC,IAAAI,WAAA,GAAAJ,OAAA;AAlBzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASK,SAASA,CAChBC,IAAmC,EACP;EAC5B,OAAOA,IAAI;AACb;AAEO,SAASC,eAAeA,CAA8C;EAC3EC,EAAE;EACFC,OAAO;EACPC,KAAK;EACLC,UAAU,GAAG,OAAO;EACpBC,WAAW;EACXC,cAAc,GAAG,KAAK;EACtBC,kBAAkB;EAClBC,WAAW;EACXC,aAAa;EACbC;AACuB,CAAC,EAAE;EAC1B;EACA;EACA,MAAMC,OAAO,GAAG,IAAAC,kBAAW,EACxBC,IAAiB,IAAK,IAAAC,qBAAc,EAACb,EAAE,EAAEY,IAAI,CAAC,EAC/C,CAACZ,EAAE,CACL,CAAC;EAED,oBACE,IAAAJ,WAAA,CAAAkB,GAAA,EAACrB,YAAA,CAAAsB,IAAI;IAACC,GAAG,EAAEN,OAAQ;IAACR,KAAK,EAAEA,KAAM;IAACM,aAAa,EAAEA,aAAc;IAAAS,QAAA,eAC7D,IAAArB,WAAA,CAAAkB,GAAA,EAACpB,aAAA,CAAAwB,YAAY;MACXjB,OAAO,EAAEA,OAAQ;MACjBE,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEP,SAAS,CAACO,WAAW,CAAE;MACpCC,cAAc,EAAEA,cAAe;MAC/BC,kBAAkB,EAAEA,kBAAmB;MACvCC,WAAW,EAAEA,WAAY;MACzBE,QAAQ,EAAEA,QAAS;MACnBP,KAAK,EAAEiB,uBAAU,CAACC;IAAa,CAChC;EAAC,CACE,CAAC;AAEX;AAEArB,eAAe,CAACsB,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -25,6 +25,13 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
25
25
|
* showing the media all along.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* The web host publishes its slot to the layer, which paints every shared node
|
|
30
|
+
* through one non-generic `MediaSurface`. Widening is sound for the same reason
|
|
31
|
+
* as the native host's `widenSlot`: the only player Bloom ever hands a slot is
|
|
32
|
+
* the one it took out of that slot's own `content`. Bloom transports the
|
|
33
|
+
* object; it never substitutes one.
|
|
34
|
+
*/
|
|
28
35
|
function MediaFlightHost({
|
|
29
36
|
id,
|
|
30
37
|
content,
|
|
@@ -46,7 +53,8 @@ function MediaFlightHost({
|
|
|
46
53
|
const render = (0, _react.useMemo)(() => ({
|
|
47
54
|
content,
|
|
48
55
|
contentFit,
|
|
49
|
-
|
|
56
|
+
// See `widenSlot`: the player a slot gets back is the one it put in.
|
|
57
|
+
renderVideo: renderVideo,
|
|
50
58
|
nativeControls,
|
|
51
59
|
accessibilityLabel,
|
|
52
60
|
flightId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_mediaNodeWeb","_store","_jsxRuntime","MediaFlightHost","id","content","style","contentFit","renderVideo","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;
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_mediaNodeWeb","_store","_jsxRuntime","MediaFlightHost","id","content","style","contentFit","renderVideo","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;AAOA,IAAAG,MAAA,GAAAH,OAAA;AAAmE,IAAAI,WAAA,GAAAJ,OAAA;AAzBnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,eAAeA,CAA8C;EAC3EC,EAAE;EACFC,OAAO;EACPC,KAAK;EACLC,UAAU,GAAG,OAAO;EACpBC,WAAW;EACXC,cAAc,GAAG,KAAK;EACtBC,kBAAkB;EAClBC,aAAa;EACbC;AACuB,CAAC,EAAE;EAC1B;EACA;EACA,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAG,IAAAC,eAAQ,EAAc,IAAI,CAAC;EAEnD,MAAMC,OAAO,GAAG,IAAAC,kBAAW,EACxBC,IAAiB,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BAAO,IAAAX,WAAA,CAAA+B,GAAA,EAAClC,YAAA,CAAAmC,IAAI;IAACC,GAAG,EAAEnB,OAAQ;IAACV,KAAK,EAAEA,KAAM;IAACK,aAAa,EAAEA;EAAc,CAAE,CAAC;AAC3E;AAEAR,eAAe,CAACiC,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -18,11 +18,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
18
18
|
* ## The problem it exists for
|
|
19
19
|
*
|
|
20
20
|
* A shared-element transition normally assumes the ORIGIN screen is still
|
|
21
|
-
* mounted while the element travels
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* before the first frame of the transition.
|
|
21
|
+
* mounted while the element travels. Under expo-router on web the origin route
|
|
22
|
+
* is UNMOUNTED the moment the URL changes, so anything the origin was rendering
|
|
23
|
+
* (a `VideoView`, a decoded image) is gone before the first frame of the
|
|
24
|
+
* transition.
|
|
26
25
|
*
|
|
27
26
|
* The fix is to move the surface OUT of both screens for the duration of the
|
|
28
27
|
* flight. `<MediaFlightLayer>` is mounted ONCE at the app root and renders
|
|
@@ -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","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":";;;;;;
|
|
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":";;;;;;AAoCA,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;AA3C/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;;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;MAAAD,QAAA,EACTP,OAAO,CAACS,GAAG,CAAEC,MAAM,iBAClB,IAAAZ,WAAA,CAAAO,GAAA,EAACM,kBAAkB;QAAiBD,MAAM,EAAEA;MAAO,GAA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AE,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":[]}
|
|
@@ -172,6 +172,42 @@ function pick(claims) {
|
|
|
172
172
|
return best;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
/**
|
|
176
|
+
* An element that can be MOVED rather than removed and re-inserted.
|
|
177
|
+
*
|
|
178
|
+
* `moveBefore` is newer than TypeScript's DOM library, so the capability is
|
|
179
|
+
* named here and checked at runtime rather than assumed.
|
|
180
|
+
*/
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* DERIVED FROM react-native-teleport 1.2.0 — `src/views/Portal/index.tsx`,
|
|
184
|
+
* its `moveElementTo`. MIT, Copyright (c) 2025 Kiryl Ziusko; see `NOTICE`.
|
|
185
|
+
*
|
|
186
|
+
* Changed: typed for TypeScript's DOM library, which does not know `moveBefore`
|
|
187
|
+
* yet, and reduced to the append case Bloom needs (no `before` sibling).
|
|
188
|
+
*
|
|
189
|
+
* Why it is worth taking rather than keeping `appendChild`: `appendChild` of an
|
|
190
|
+
* ATTACHED node is a remove followed by an insert, and the only reason media
|
|
191
|
+
* survives it is that HTML's removal steps await a stable state and abort if
|
|
192
|
+
* the node is back in a document by then. `moveBefore` does not run the removal
|
|
193
|
+
* steps at all — it is the state-preserving primitive, which matters for
|
|
194
|
+
* anything the abort does not cover: focus, `<iframe>`s, CSS animations.
|
|
195
|
+
*
|
|
196
|
+
* Measured for a playing `<video>` in Chrome 151: indistinguishable from
|
|
197
|
+
* `appendChild` (ct 0.60 -> 1.00, never paused, 6 frames, worst frame gap
|
|
198
|
+
* 100 ms — the clip's own cadence — under both), while a real removal pauses
|
|
199
|
+
* and freezes. So this is not a fix for a defect Bloom has; it is the correct
|
|
200
|
+
* primitive for the ones it does not have yet.
|
|
201
|
+
*/
|
|
202
|
+
function moveInto(parent, child) {
|
|
203
|
+
if (supportsMoveBefore && child.parentNode !== null) {
|
|
204
|
+
parent.moveBefore(child, null);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
parent.appendChild(child);
|
|
208
|
+
}
|
|
209
|
+
const supportsMoveBefore = typeof Element !== 'undefined' && 'moveBefore' in Element.prototype;
|
|
210
|
+
|
|
175
211
|
/**
|
|
176
212
|
* Put the wrapper where its top claim says, in ONE synchronous move.
|
|
177
213
|
*
|
|
@@ -184,7 +220,7 @@ function place(record) {
|
|
|
184
220
|
const target = topClaim(record)?.el ?? holder(reg);
|
|
185
221
|
if (target === null) return;
|
|
186
222
|
if (record.wrapper.parentElement === target) return;
|
|
187
|
-
target
|
|
223
|
+
moveInto(target, record.wrapper);
|
|
188
224
|
}
|
|
189
225
|
function sameRender(a, b) {
|
|
190
226
|
if (a.contentFit !== b.contentFit) return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_store","require","HOST_RANK","exports","FLIGHT_RANK","registry","globalThis","__oxyhq_bloom_media_nodes__","nodes","Map","listeners","Set","snapshot","holder","seq","HOLDER_ID","reg","document","isConnected","existing","getElementById","created","createElement","id","style","cssText","setAttribute","body","appendChild","makeWrapper","wrapper","recordFor","render","record","get","claims","EMPTY_RENDER","set","content","uri","contentFit","renderVideo","undefined","nativeControls","accessibilityLabel","flightId","topClaim","pick","topRender","filter","claim","best","rank","place","target","el","parentElement","sameRender","a","b","x","y","kind","player","poster","publish","next","push","previous","unchanged","length","every","view","i","candidate","listener","claimMediaNode","find","releaseMediaNode","before","hasFlight","delete","remove","hasMediaNode","subscribeToMediaNodes","add","getMediaNodes","resetMediaNodes","values","clear"],"sourceRoot":"../../../src","sources":["media-flight/media-node.web.ts"],"mappings":";;;;;;;;;;;;AA6DA,IAAAA,MAAA,GAAAC,OAAA;AA7DA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAYA;AACO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,CAAC;AACnB,MAAME,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAAG,CAAC;;AAqC5B;;AAqBA,SAASC,QAAQA,CAAA,EAAiB;EAChCC,UAAU,CAACC,2BAA2B,KAAK;IACzCC,KAAK,EA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C,GAAI,EAAE;MACjGqC,IAAI,GAAGD,KAAK;IACd;EACF;EACA,OAAOC,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,KAAKA,
|
|
1
|
+
{"version":3,"names":["_store","require","HOST_RANK","exports","FLIGHT_RANK","registry","globalThis","__oxyhq_bloom_media_nodes__","nodes","Map","listeners","Set","snapshot","holder","seq","HOLDER_ID","reg","document","isConnected","existing","getElementById","created","createElement","id","style","cssText","setAttribute","body","appendChild","makeWrapper","wrapper","recordFor","render","record","get","claims","EMPTY_RENDER","set","content","uri","contentFit","renderVideo","undefined","nativeControls","accessibilityLabel","flightId","topClaim","pick","topRender","filter","claim","best","rank","moveInto","parent","child","supportsMoveBefore","parentNode","moveBefore","Element","prototype","place","target","el","parentElement","sameRender","a","b","x","y","kind","player","poster","publish","next","push","previous","unchanged","length","every","view","i","candidate","listener","claimMediaNode","find","releaseMediaNode","before","hasFlight","delete","remove","hasMediaNode","subscribeToMediaNodes","add","getMediaNodes","resetMediaNodes","values","clear"],"sourceRoot":"../../../src","sources":["media-flight/media-node.web.ts"],"mappings":";;;;;;;;;;;;AA6DA,IAAAA,MAAA,GAAAC,OAAA;AA7DA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAYA;AACO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,CAAC;AACnB,MAAME,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAAG,CAAC;;AAqC5B;;AAqBA,SAASC,QAAQA,CAAA,EAAiB;EAChCC,UAAU,CAACC,2B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 @@ import { StyleSheet, View } from 'react-native';
|
|
|
18
18
|
import { MediaSurface } from "./MediaSurface.js";
|
|
19
19
|
import { registerAnchor } from "./store.js";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
+
/**
|
|
22
|
+
* Hand a consumer's slot to `MediaSurface`, which is not generic.
|
|
23
|
+
*
|
|
24
|
+
* SOUND, and the reason is the invariant this whole family is built on: the
|
|
25
|
+
* only player Bloom ever passes to a slot is the one it took out of that
|
|
26
|
+
* slot's own `content`. Bloom transports the object and never substitutes one,
|
|
27
|
+
* so the value really is a `P` at runtime — the assertion says what the types
|
|
28
|
+
* cannot follow through a `memo`'d component, and it lives HERE, once, rather
|
|
29
|
+
* than in every consumer's `renderVideo`.
|
|
30
|
+
*/
|
|
31
|
+
function widenSlot(slot) {
|
|
32
|
+
return slot;
|
|
33
|
+
}
|
|
21
34
|
export function MediaFlightHost({
|
|
22
35
|
id,
|
|
23
36
|
content,
|
|
@@ -40,7 +53,7 @@ export function MediaFlightHost({
|
|
|
40
53
|
children: /*#__PURE__*/_jsx(MediaSurface, {
|
|
41
54
|
content: content,
|
|
42
55
|
contentFit: contentFit,
|
|
43
|
-
renderVideo: renderVideo,
|
|
56
|
+
renderVideo: widenSlot(renderVideo),
|
|
44
57
|
nativeControls: nativeControls,
|
|
45
58
|
accessibilityLabel: accessibilityLabel,
|
|
46
59
|
surfaceType: surfaceType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","StyleSheet","View","MediaSurface","registerAnchor","jsx","_jsx","MediaFlightHost","id","content","style","contentFit","renderVideo","nativeControls","accessibilityLabel","surfaceType","pointerEvents","flightId","setNode","node","ref","children","absoluteFill","displayName"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightHost.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,YAAY,QAAQ,mBAAgB;
|
|
1
|
+
{"version":3,"names":["useCallback","StyleSheet","View","MediaSurface","registerAnchor","jsx","_jsx","widenSlot","slot","MediaFlightHost","id","content","style","contentFit","renderVideo","nativeControls","accessibilityLabel","surfaceType","pointerEvents","flightId","setNode","node","ref","children","absoluteFill","displayName"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightHost.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,YAAY,QAAQ,mBAAgB;AAE7C,SAASC,cAAc,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAASA,CAChBC,IAAmC,EACP;EAC5B,OAAOA,IAAI;AACb;AAEA,OAAO,SAASC,eAAeA,CAA8C;EAC3EC,EAAE;EACFC,OAAO;EACPC,KAAK;EACLC,UAAU,GAAG,OAAO;EACpBC,WAAW;EACXC,cAAc,GAAG,KAAK;EACtBC,kBAAkB;EAClBC,WAAW;EACXC,aAAa;EACbC;AACuB,CAAC,EAAE;EAC1B;EACA;EACA,MAAMC,OAAO,GAAGpB,WAAW,CACxBqB,IAAiB,IAAKjB,cAAc,CAACM,EAAE,EAAEW,IAAI,CAAC,EAC/C,CAACX,EAAE,CACL,CAAC;EAED,oBACEJ,IAAA,CAACJ,IAAI;IAACoB,GAAG,EAAEF,OAAQ;IAACR,KAAK,EAAEA,KAAM;IAACM,aAAa,EAAEA,aAAc;IAAAK,QAAA,eAC7DjB,IAAA,CAACH,YAAY;MACXQ,OAAO,EAAEA,OAAQ;MACjBE,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEP,SAAS,CAACO,WAAW,CAAE;MACpCC,cAAc,EAAEA,cAAe;MAC/BC,kBAAkB,EAAEA,kBAAmB;MACvCC,WAAW,EAAEA,WAAY;MACzBE,QAAQ,EAAEA,QAAS;MACnBP,KAAK,EAAEX,UAAU,CAACuB;IAAa,CAChC;EAAC,CACE,CAAC;AAEX;AAEAf,eAAe,CAACgB,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -20,6 +20,13 @@ import { View } from 'react-native';
|
|
|
20
20
|
import { HOST_RANK, claimMediaNode, releaseMediaNode } from "./media-node.web.js";
|
|
21
21
|
import { handOffFlight, hasFlight, registerAnchor } from "./store.js";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
+
/**
|
|
24
|
+
* The web host publishes its slot to the layer, which paints every shared node
|
|
25
|
+
* through one non-generic `MediaSurface`. Widening is sound for the same reason
|
|
26
|
+
* as the native host's `widenSlot`: the only player Bloom ever hands a slot is
|
|
27
|
+
* the one it took out of that slot's own `content`. Bloom transports the
|
|
28
|
+
* object; it never substitutes one.
|
|
29
|
+
*/
|
|
23
30
|
export function MediaFlightHost({
|
|
24
31
|
id,
|
|
25
32
|
content,
|
|
@@ -41,7 +48,8 @@ export function MediaFlightHost({
|
|
|
41
48
|
const render = useMemo(() => ({
|
|
42
49
|
content,
|
|
43
50
|
contentFit,
|
|
44
|
-
|
|
51
|
+
// See `widenSlot`: the player a slot gets back is the one it put in.
|
|
52
|
+
renderVideo: renderVideo,
|
|
45
53
|
nativeControls,
|
|
46
54
|
accessibilityLabel,
|
|
47
55
|
flightId
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useLayoutEffect","useMemo","useRef","useState","View","HOST_RANK","claimMediaNode","releaseMediaNode","handOffFlight","hasFlight","registerAnchor","jsx","_jsx","MediaFlightHost","id","content","style","contentFit","renderVideo","nativeControls","accessibilityLabel","pointerEvents","flightId","node","setNode","setHost","next","render","renderRef","current","el","undefined","ref","displayName"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightHost.web.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,eAAe,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/E,SAASC,IAAI,QAAQ,cAAc;AAEnC,SACEC,SAAS,EACTC,cAAc,EACdC,gBAAgB,QAEX,qBAAkB;
|
|
1
|
+
{"version":3,"names":["useCallback","useLayoutEffect","useMemo","useRef","useState","View","HOST_RANK","claimMediaNode","releaseMediaNode","handOffFlight","hasFlight","registerAnchor","jsx","_jsx","MediaFlightHost","id","content","style","contentFit","renderVideo","nativeControls","accessibilityLabel","pointerEvents","flightId","node","setNode","setHost","next","render","renderRef","current","el","undefined","ref","displayName"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightHost.web.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,eAAe,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/E,SAASC,IAAI,QAAQ,cAAc;AAEnC,SACEC,SAAS,EACTC,cAAc,EACdC,gBAAgB,QAEX,qBAAkB;AAEzB,SAASC,aAAa,EAAEC,SAAS,EAAEC,cAAc,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAA8C;EAC3EC,EAAE;EACFC,OAAO;EACPC,KAAK;EACLC,UAAU,GAAG,OAAO;EACpBC,WAAW;EACXC,cAAc,GAAG,KAAK;EACtBC,kBAAkB;EAClBC,aAAa;EACbC;AACuB,CAAC,EAAE;EAC1B;EACA;EACA,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGrB,QAAQ,CAAc,IAAI,CAAC;EAEnD,MAAMsB,OAAO,G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G,EAAEP,OAAQ;IAACT,KAAK,EAAEA,KAAM;IAACK,aAAa,EAAEA;EAAc,CAAE,CAAC;AAC3E;AAEAR,eAAe,CAACoB,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -6,11 +6,10 @@
|
|
|
6
6
|
* ## The problem it exists for
|
|
7
7
|
*
|
|
8
8
|
* A shared-element transition normally assumes the ORIGIN screen is still
|
|
9
|
-
* mounted while the element travels
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* before the first frame of the transition.
|
|
9
|
+
* mounted while the element travels. Under expo-router on web the origin route
|
|
10
|
+
* is UNMOUNTED the moment the URL changes, so anything the origin was rendering
|
|
11
|
+
* (a `VideoView`, a decoded image) is gone before the first frame of the
|
|
12
|
+
* transition.
|
|
14
13
|
*
|
|
15
14
|
* The fix is to move the surface OUT of both screens for the duration of the
|
|
16
15
|
* flight. `<MediaFlightLayer>` is mounted ONCE at the app root and renders
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","useSyncExternalStore","StyleSheet","interpolate","useAnimatedStyle","OverlayRoot","Portal","MediaSurface","getFlights","notifySurfaceMounted","subscribeToFlights","jsx","_jsx","MediaFlightLayer","flights","length","children","map","flight","MediaFlightSurface","id","displayName","from","to","progress","content","cornerRadius","contentFit","surfaceType","unbinding","originX","x","originY","y","boxStyle","transform","translateX","value","translateY","width","height","detached","pointerEvents","style","styles","box","left","top","borderRadius","create","position","overflow"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightLayer.tsx"],"mappings":";;AAAA;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
|
|
1
|
+
{"version":3,"names":["useEffect","useSyncExternalStore","StyleSheet","interpolate","useAnimatedStyle","OverlayRoot","Portal","MediaSurface","getFlights","notifySurfaceMounted","subscribeToFlights","jsx","_jsx","MediaFlightLayer","flights","length","children","map","flight","MediaFlightSurface","id","displayName","from","to","progress","content","cornerRadius","contentFit","surfaceType","unbinding","originX","x","originY","y","boxStyle","transform","translateX","value","translateY","width","height","detached","pointerEvents","style","styles","box","left","top","borderRadius","create","position","overflow"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightLayer.tsx"],"mappings":";;AAAA;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,SAASA,SAAS,EAAEC,oBAAoB,QAAQ,OAAO;AACvD,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,WAAW,EAAEC,gBAAgB,QAAQ,yBAAyB;AAEvE,SAASC,WAAW,QAAQ,qBAAY;AACxC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,YAAY,QAAQ,mBAAgB;AAC7C,SAASC,UAAU,EAAEC,oBAAoB,EAAEC,kBAAkB,QAAQ,YAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG/E;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAA,EAAG;EACjC,MAAMC,OAAO,GAAGb,oBAAoB,CAACS,kBAAkB,EAAEF,UAAU,EAAEA,UAAU,CAAC;EAEhF,IAAIM,OAAO,CAACC,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAErC,oBACEH,IAAA,CAACN,MAAM;IAAAU,QAAA,eAKLJ,IAAA,CAACP,WAAW;MAAAW,QAAA,EACTF,OAAO,CAACG,GAAG,CAAEC,MAAM,iBAClBN,IAAA,CAACO,kBAAkB;QAAiBD,MAAM,EAAEA;MAAO,GAA1BA,MAAM,CAACE,EAAqB,CACtD;IAAC,CACS;EAAC,CACR,CAAC;AAEb;A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