@oxyhq/bloom 1.5.0 → 1.6.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/docs/media-flight.mdx +11 -0
- 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/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/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/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/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/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/types.d.ts +24 -7
- package/lib/typescript/module/media-flight/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/media-flight/MediaFlightHost.tsx +21 -4
- package/src/media-flight/MediaFlightHost.web.tsx +20 -4
- package/src/media-flight/index.ts +3 -0
- package/src/media-flight/index.web.ts +3 -0
- package/src/media-flight/types.ts +27 -7
package/docs/media-flight.mdx
CHANGED
|
@@ -323,6 +323,17 @@ and a media element that does not fill its wrapper warns once with both
|
|
|
323
323
|
rectangles. Neither is a gate — they are the three trap-doors of this contract
|
|
324
324
|
turned into three messages.
|
|
325
325
|
|
|
326
|
+
**The invariant that keeps this a primitive and not a coupling:** Bloom decides
|
|
327
|
+
`player`, `style` and `contentFit`, and those three are exactly the three that
|
|
328
|
+
depend on WHERE THE NODE IS. Nothing else about the media is Bloom's business.
|
|
329
|
+
If a fourth prop ever has to be added beside them, that is the signal that
|
|
330
|
+
coupling is leaking in — not a reason to add a fifth.
|
|
331
|
+
|
|
332
|
+
The player's own type flows from `content` into the slot, so a slot hands it
|
|
333
|
+
straight to `VideoView` with no cast. Bloom transports that object; it never
|
|
334
|
+
reads it, and narrowing what you only transport is what pushes a consumer
|
|
335
|
+
towards `as`.
|
|
336
|
+
|
|
326
337
|
The flight itself never brings an element. Its claim on a shared node says only
|
|
327
338
|
WHERE the node lives — a flight that published its own render would swap a
|
|
328
339
|
consumer's element out for Bloom's and back again, which is two remounts in the
|
|
@@ -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,IAAK;IACrB,IAAAC,qBAAc,EAACf,EAAE,EAAEc,IAAI,CAAC;IACxBJ,OAAO,CAACI,IAAI,CAAC;EACf,CAAC,EACD,CAACd,EAAE,CACL,CAAC;EAED,MAAMgB,MAAM,GAAG,IAAAC,cAAO,EACpB,OAAO;IACLhB,OAAO;IACPE,UAAU;IACV;IACAC,WAAW,EAAEA,WAAyC;IACtDC,cAAc;IACdC,kBAAkB;IAClBE;EACF,CAAC,CAAC,EACF,CAACP,OAAO,EAAEE,UAAU,EAAEC,WAAW,EAAEC,cAAc,EAAEC,kBAAkB,EAAEE,QAAQ,CACjF,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,EAACvB,EAAE,EAAEsB,EAAE,EAAEE,uBAAS,EAAER,MAAM,CAAC;EAC5D,CAAC,EAAE,CAAChB,EAAE,EAAES,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,EAACvB,EAAE,EAAEsB,EAAE,EAAEE,uBAAS,EAAEN,SAAS,CAACG,OAAO,CAAC;IACpD;IACA;IACA;IACA;IACA;IACA,IAAI,IAAAK,gBAAS,EAAC1B,EAAE,CAAC,EAAE,IAAA2B,oBAAa,EAAC3B,EAAE,CAAC;IACpC,OAAO,MAAM,IAAA4B,8BAAgB,EAAC5B,EAAE,EAAEsB,EAAE,EAAEE,uBAAS,CAAC;EAClD,CAAC,EAAE,CAACxB,EAAE,EAAES,IAAI,CAAC,CAAC;EAEd,oBAAO,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,6 +18,19 @@ 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,GAAG1B,WAAW,CACxB2B,IAAiB,IAAK;IACrBhB,cAAc,CAACI,EAAE,EAAEY,IAAI,CAAC;IACxBF,OAAO,CAACE,IAAI,CAAC;EACf,CAAC,EACD,CAACZ,EAAE,CACL,CAAC;EAED,MAAMa,MAAM,GAAG1B,OAAO,CACpB,OAAO;IACLc,OAAO;IACPE,UAAU;IACV;IACAC,WAAW,EAAEA,WAAyC;IACtDC,cAAc;IACdC,kBAAkB;IAClBE;EACF,CAAC,CAAC,EACF,CAACP,OAAO,EAAEE,UAAU,EAAEC,WAAW,EAAEC,cAAc,EAAEC,kBAAkB,EAAEE,QAAQ,CACjF,CAAC;EACD,MAAMM,SAAS,GAAG1B,MAAM,CAACyB,MAAM,CAAC;;EAEhC;EACA;EACA;EACA;EACA3B,eAAe,CAAC,MAAM;IACpB4B,SAAS,CAACC,OAAO,GAAGF,MAAM;IAC1B,MAAMG,EAAE,GAAGP,IAAqC;IAChD,IAAIO,EAAE,KAAK,IAAI,EAAExB,cAAc,CAACQ,EAAE,EAAEgB,EAAE,EAAEzB,SAAS,EAAEsB,MAAM,CAAC;EAC5D,CAAC,EAAE,CAACb,EAAE,EAAES,IAAI,EAAEI,MAAM,CAAC,CAAC;;EAEtB;EACA;EACA3B,eAAe,CAAC,MAAM;IACpB,MAAM8B,EAAE,GAAGP,IAAqC;IAChD,IAAIO,EAAE,KAAK,IAAI,EAAE,OAAOC,SAAS;IACjCzB,cAAc,CAACQ,EAAE,EAAEgB,EAAE,EAAEzB,SAAS,EAAEuB,SAAS,CAACC,OAAO,CAAC;IACpD;IACA;IACA;IACA;IACA;IACA,IAAIpB,SAAS,CAACK,EAAE,CAAC,EAAEN,aAAa,CAACM,EAAE,CAAC;IACpC,OAAO,MAAMP,gBAAgB,CAACO,EAAE,EAAEgB,EAAE,EAAEzB,SAAS,CAAC;EAClD,CAAC,EAAE,CAACS,EAAE,EAAES,IAAI,CAAC,CAAC;EAEd,oBAAOX,IAAA,CAACR,IAAI;IAAC4B,GAAG,EAAEP,OAAQ;IAACT,KAAK,EAAEA,KAAM;IAACK,aAAa,EAAEA;EAAc,CAAE,CAAC;AAC3E;AAEAR,eAAe,CAACoB,WAAW,GAAG,iBAAiB","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { VideoPlayerLike } from './expo-video-module';
|
|
1
2
|
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 function MediaFlightHost<P extends VideoPlayerLike = VideoPlayerLike>({ id, content, style, contentFit, renderVideo, nativeControls, accessibilityLabel, surfaceType, pointerEvents, flightId, }: MediaFlightHostProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export declare namespace MediaFlightHost {
|
|
4
5
|
var displayName: string;
|
|
5
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFlightHost.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaFlightHost.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AAkBpE,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,EAC3E,EAAE,EACF,OAAO,EACP,KAAK,EACL,UAAoB,EACpB,WAAW,EACX,cAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,QAAQ,GACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAsBzB;yBAjCe,eAAe"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import type { VideoPlayerLike } from './expo-video-module';
|
|
1
2
|
import type { MediaFlightHostProps } from './types';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The web host publishes its slot to the layer, which paints every shared node
|
|
5
|
+
* through one non-generic `MediaSurface`. Widening is sound for the same reason
|
|
6
|
+
* as the native host's `widenSlot`: the only player Bloom ever hands a slot is
|
|
7
|
+
* the one it took out of that slot's own `content`. Bloom transports the
|
|
8
|
+
* object; it never substitutes one.
|
|
9
|
+
*/
|
|
10
|
+
export declare function MediaFlightHost<P extends VideoPlayerLike = VideoPlayerLike>({ id, content, style, contentFit, renderVideo, nativeControls, accessibilityLabel, pointerEvents, flightId, }: MediaFlightHostProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
3
11
|
export declare namespace MediaFlightHost {
|
|
4
12
|
var displayName: string;
|
|
5
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFlightHost.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.web.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaFlightHost.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.web.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AAEpE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,EAC3E,EAAE,EACF,OAAO,EACP,KAAK,EACL,UAAoB,EACpB,WAAW,EACX,cAAsB,EACtB,kBAAkB,EAClB,aAAa,EACb,QAAQ,GACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAqDzB;yBA/De,eAAe"}
|
|
@@ -5,6 +5,6 @@ export { useMediaFlight } from './use-media-flight';
|
|
|
5
5
|
export { DEFAULT_FLIGHT_CORNER_RADIUS, flightProgress, handOffFlight, hasFlight, releaseFlight, resetMediaFlight, } from './store';
|
|
6
6
|
export { SURFACE_MOUNT_TIMEOUT_MS } from './constants';
|
|
7
7
|
export { loadExpoVideo, warnExpoVideoUnavailable, provideExpoVideo, resetExpoVideoModule, type ExpoVideoLike, type VideoPlayerLike, type VideoSurfaceContentFit, type VideoSurfaceType, type VideoViewLikeProps, } from './expo-video-module';
|
|
8
|
-
export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightHostProps, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
|
|
8
|
+
export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightHostProps, MediaSurfaceVideoOf, MediaVideoSlot, MediaVideoSlotProps, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
|
|
9
9
|
export type { MediaSurfaceProps } from './MediaSurface';
|
|
10
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,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"}
|
|
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,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -14,6 +14,6 @@ export { useMediaFlight } from './use-media-flight';
|
|
|
14
14
|
export { DEFAULT_FLIGHT_CORNER_RADIUS, flightProgress, handOffFlight, hasFlight, releaseFlight, resetMediaFlight, } from './store';
|
|
15
15
|
export { SURFACE_MOUNT_TIMEOUT_MS } from './constants';
|
|
16
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';
|
|
17
|
+
export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightHostProps, MediaSurfaceVideoOf, MediaVideoSlot, MediaVideoSlotProps, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
|
|
18
18
|
export type { MediaSurfaceProps } from './MediaSurface';
|
|
19
19
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +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"}
|
|
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,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -57,6 +57,18 @@ export interface MediaSurfaceVideo {
|
|
|
57
57
|
}
|
|
58
58
|
/** What a media surface paints: a still image, or a consumer-owned video. */
|
|
59
59
|
export type MediaSurfaceContent = MediaSurfaceImage | MediaSurfaceVideo;
|
|
60
|
+
/**
|
|
61
|
+
* `MediaSurfaceVideo` carrying the consumer's OWN player type.
|
|
62
|
+
*
|
|
63
|
+
* Bloom transports that object; it never reads it. Narrowing it to
|
|
64
|
+
* `VideoPlayerLike` on the way through would be Bloom asserting something about
|
|
65
|
+
* cargo — and it would land on the consumer, who then has to cast the player
|
|
66
|
+
* back before handing it to expo-video's `VideoView`. A contract that pushes a
|
|
67
|
+
* consumer towards `as` ends up as an `as any` in someone's repo.
|
|
68
|
+
*/
|
|
69
|
+
export interface MediaSurfaceVideoOf<P extends VideoPlayerLike> extends MediaSurfaceVideo {
|
|
70
|
+
player: P;
|
|
71
|
+
}
|
|
60
72
|
/**
|
|
61
73
|
* A media surface currently owned by the flight layer.
|
|
62
74
|
*
|
|
@@ -216,7 +228,7 @@ export interface MediaFlightController {
|
|
|
216
228
|
* INTRINSIC size (300x150) instead of stretching — so a slot that drops this
|
|
217
229
|
* style paints a 300x150 video inside whatever box it was given. Spread it.
|
|
218
230
|
*/
|
|
219
|
-
export interface MediaVideoSlotProps {
|
|
231
|
+
export interface MediaVideoSlotProps<P extends VideoPlayerLike = VideoPlayerLike> {
|
|
220
232
|
/**
|
|
221
233
|
* The player Bloom was given — never one Bloom created.
|
|
222
234
|
*
|
|
@@ -227,7 +239,7 @@ export interface MediaVideoSlotProps {
|
|
|
227
239
|
* anything else here — keeping the old player, unmounting instead — brings
|
|
228
240
|
* that defect back. See `releaseFlight`.
|
|
229
241
|
*/
|
|
230
|
-
player:
|
|
242
|
+
player: P | null;
|
|
231
243
|
/** Fills the box. Spread it — see above. */
|
|
232
244
|
style: StyleProp<ViewStyle>;
|
|
233
245
|
contentFit: 'contain' | 'cover';
|
|
@@ -249,7 +261,7 @@ export interface MediaVideoSlotProps {
|
|
|
249
261
|
* layer, compared by identity — a new function every render republishes every
|
|
250
262
|
* render. Correct either way, wasteful if you skip it.
|
|
251
263
|
*/
|
|
252
|
-
export type MediaVideoSlot = (props: MediaVideoSlotProps) => ReactNode;
|
|
264
|
+
export type MediaVideoSlot<P extends VideoPlayerLike = VideoPlayerLike> = (props: MediaVideoSlotProps<P>) => ReactNode;
|
|
253
265
|
/**
|
|
254
266
|
* A place a media surface may live: the feed row it starts in, the fullscreen
|
|
255
267
|
* player it lands in, and every other end of a flight.
|
|
@@ -260,11 +272,16 @@ export type MediaVideoSlot = (props: MediaVideoSlotProps) => ReactNode;
|
|
|
260
272
|
* ever leaving the document. On native a host renders its media inline, which
|
|
261
273
|
* is what it has always done and what the platform makes correct there.
|
|
262
274
|
*/
|
|
263
|
-
export interface MediaFlightHostProps {
|
|
275
|
+
export interface MediaFlightHostProps<P extends VideoPlayerLike = VideoPlayerLike> {
|
|
264
276
|
/** The id this host shares with the flight and with the other end. */
|
|
265
277
|
id: string;
|
|
266
|
-
/**
|
|
267
|
-
|
|
278
|
+
/**
|
|
279
|
+
* What to paint: a still image, or a consumer-owned expo-video player.
|
|
280
|
+
*
|
|
281
|
+
* The player's own type flows from here into {@link renderVideo}, so a slot
|
|
282
|
+
* gets back exactly what it put in and hands it to `VideoView` with no cast.
|
|
283
|
+
*/
|
|
284
|
+
content: MediaSurfaceImage | MediaSurfaceVideoOf<P>;
|
|
268
285
|
/** Style of the host BOX. Give it the radius and `overflow: 'hidden'` you want. */
|
|
269
286
|
style?: StyleProp<ViewStyle>;
|
|
270
287
|
/** How the media fills the box. Defaults to `'cover'`. */
|
|
@@ -273,7 +290,7 @@ export interface MediaFlightHostProps {
|
|
|
273
290
|
* Paint the video yourself, keeping your own `ref` and expo-video props. See
|
|
274
291
|
* {@link MediaVideoSlot}; memoise it.
|
|
275
292
|
*/
|
|
276
|
-
renderVideo?: MediaVideoSlot
|
|
293
|
+
renderVideo?: MediaVideoSlot<P>;
|
|
277
294
|
/** Whether the video arm shows expo-video's own controls. Defaults to `false`. */
|
|
278
295
|
nativeControls?: boolean;
|
|
279
296
|
accessibilityLabel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/types.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;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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { VideoPlayerLike } from './expo-video-module';
|
|
1
2
|
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 function MediaFlightHost<P extends VideoPlayerLike = VideoPlayerLike>({ id, content, style, contentFit, renderVideo, nativeControls, accessibilityLabel, surfaceType, pointerEvents, flightId, }: MediaFlightHostProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
export declare namespace MediaFlightHost {
|
|
4
5
|
var displayName: string;
|
|
5
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFlightHost.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaFlightHost.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AAkBpE,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,EAC3E,EAAE,EACF,OAAO,EACP,KAAK,EACL,UAAoB,EACpB,WAAW,EACX,cAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,QAAQ,GACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAsBzB;yBAjCe,eAAe"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import type { VideoPlayerLike } from './expo-video-module';
|
|
1
2
|
import type { MediaFlightHostProps } from './types';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The web host publishes its slot to the layer, which paints every shared node
|
|
5
|
+
* through one non-generic `MediaSurface`. Widening is sound for the same reason
|
|
6
|
+
* as the native host's `widenSlot`: the only player Bloom ever hands a slot is
|
|
7
|
+
* the one it took out of that slot's own `content`. Bloom transports the
|
|
8
|
+
* object; it never substitutes one.
|
|
9
|
+
*/
|
|
10
|
+
export declare function MediaFlightHost<P extends VideoPlayerLike = VideoPlayerLike>({ id, content, style, contentFit, renderVideo, nativeControls, accessibilityLabel, pointerEvents, flightId, }: MediaFlightHostProps<P>): import("react/jsx-runtime").JSX.Element;
|
|
3
11
|
export declare namespace MediaFlightHost {
|
|
4
12
|
var displayName: string;
|
|
5
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaFlightHost.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.web.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MediaFlightHost.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightHost.web.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AAEpE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,EAC3E,EAAE,EACF,OAAO,EACP,KAAK,EACL,UAAoB,EACpB,WAAW,EACX,cAAsB,EACtB,kBAAkB,EAClB,aAAa,EACb,QAAQ,GACT,EAAE,oBAAoB,CAAC,CAAC,CAAC,2CAqDzB;yBA/De,eAAe"}
|
|
@@ -5,6 +5,6 @@ export { useMediaFlight } from './use-media-flight';
|
|
|
5
5
|
export { DEFAULT_FLIGHT_CORNER_RADIUS, flightProgress, handOffFlight, hasFlight, releaseFlight, resetMediaFlight, } from './store';
|
|
6
6
|
export { SURFACE_MOUNT_TIMEOUT_MS } from './constants';
|
|
7
7
|
export { loadExpoVideo, warnExpoVideoUnavailable, provideExpoVideo, resetExpoVideoModule, type ExpoVideoLike, type VideoPlayerLike, type VideoSurfaceContentFit, type VideoSurfaceType, type VideoViewLikeProps, } from './expo-video-module';
|
|
8
|
-
export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightHostProps, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
|
|
8
|
+
export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightHostProps, MediaSurfaceVideoOf, MediaVideoSlot, MediaVideoSlotProps, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
|
|
9
9
|
export type { MediaSurfaceProps } from './MediaSurface';
|
|
10
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,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"}
|
|
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,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -14,6 +14,6 @@ export { useMediaFlight } from './use-media-flight';
|
|
|
14
14
|
export { DEFAULT_FLIGHT_CORNER_RADIUS, flightProgress, handOffFlight, hasFlight, releaseFlight, resetMediaFlight, } from './store';
|
|
15
15
|
export { SURFACE_MOUNT_TIMEOUT_MS } from './constants';
|
|
16
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';
|
|
17
|
+
export type { MediaFlight, MediaFlightAnchorNode, MediaFlightController, MediaFlightHostProps, MediaSurfaceVideoOf, MediaVideoSlot, MediaVideoSlotProps, MediaFlightOptions, MediaSurfaceContent, MediaSurfaceImage, MediaSurfaceVideo, MeasuredRect, } from './types';
|
|
18
18
|
export type { MediaSurfaceProps } from './MediaSurface';
|
|
19
19
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +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"}
|
|
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,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -57,6 +57,18 @@ export interface MediaSurfaceVideo {
|
|
|
57
57
|
}
|
|
58
58
|
/** What a media surface paints: a still image, or a consumer-owned video. */
|
|
59
59
|
export type MediaSurfaceContent = MediaSurfaceImage | MediaSurfaceVideo;
|
|
60
|
+
/**
|
|
61
|
+
* `MediaSurfaceVideo` carrying the consumer's OWN player type.
|
|
62
|
+
*
|
|
63
|
+
* Bloom transports that object; it never reads it. Narrowing it to
|
|
64
|
+
* `VideoPlayerLike` on the way through would be Bloom asserting something about
|
|
65
|
+
* cargo — and it would land on the consumer, who then has to cast the player
|
|
66
|
+
* back before handing it to expo-video's `VideoView`. A contract that pushes a
|
|
67
|
+
* consumer towards `as` ends up as an `as any` in someone's repo.
|
|
68
|
+
*/
|
|
69
|
+
export interface MediaSurfaceVideoOf<P extends VideoPlayerLike> extends MediaSurfaceVideo {
|
|
70
|
+
player: P;
|
|
71
|
+
}
|
|
60
72
|
/**
|
|
61
73
|
* A media surface currently owned by the flight layer.
|
|
62
74
|
*
|
|
@@ -216,7 +228,7 @@ export interface MediaFlightController {
|
|
|
216
228
|
* INTRINSIC size (300x150) instead of stretching — so a slot that drops this
|
|
217
229
|
* style paints a 300x150 video inside whatever box it was given. Spread it.
|
|
218
230
|
*/
|
|
219
|
-
export interface MediaVideoSlotProps {
|
|
231
|
+
export interface MediaVideoSlotProps<P extends VideoPlayerLike = VideoPlayerLike> {
|
|
220
232
|
/**
|
|
221
233
|
* The player Bloom was given — never one Bloom created.
|
|
222
234
|
*
|
|
@@ -227,7 +239,7 @@ export interface MediaVideoSlotProps {
|
|
|
227
239
|
* anything else here — keeping the old player, unmounting instead — brings
|
|
228
240
|
* that defect back. See `releaseFlight`.
|
|
229
241
|
*/
|
|
230
|
-
player:
|
|
242
|
+
player: P | null;
|
|
231
243
|
/** Fills the box. Spread it — see above. */
|
|
232
244
|
style: StyleProp<ViewStyle>;
|
|
233
245
|
contentFit: 'contain' | 'cover';
|
|
@@ -249,7 +261,7 @@ export interface MediaVideoSlotProps {
|
|
|
249
261
|
* layer, compared by identity — a new function every render republishes every
|
|
250
262
|
* render. Correct either way, wasteful if you skip it.
|
|
251
263
|
*/
|
|
252
|
-
export type MediaVideoSlot = (props: MediaVideoSlotProps) => ReactNode;
|
|
264
|
+
export type MediaVideoSlot<P extends VideoPlayerLike = VideoPlayerLike> = (props: MediaVideoSlotProps<P>) => ReactNode;
|
|
253
265
|
/**
|
|
254
266
|
* A place a media surface may live: the feed row it starts in, the fullscreen
|
|
255
267
|
* player it lands in, and every other end of a flight.
|
|
@@ -260,11 +272,16 @@ export type MediaVideoSlot = (props: MediaVideoSlotProps) => ReactNode;
|
|
|
260
272
|
* ever leaving the document. On native a host renders its media inline, which
|
|
261
273
|
* is what it has always done and what the platform makes correct there.
|
|
262
274
|
*/
|
|
263
|
-
export interface MediaFlightHostProps {
|
|
275
|
+
export interface MediaFlightHostProps<P extends VideoPlayerLike = VideoPlayerLike> {
|
|
264
276
|
/** The id this host shares with the flight and with the other end. */
|
|
265
277
|
id: string;
|
|
266
|
-
/**
|
|
267
|
-
|
|
278
|
+
/**
|
|
279
|
+
* What to paint: a still image, or a consumer-owned expo-video player.
|
|
280
|
+
*
|
|
281
|
+
* The player's own type flows from here into {@link renderVideo}, so a slot
|
|
282
|
+
* gets back exactly what it put in and hands it to `VideoView` with no cast.
|
|
283
|
+
*/
|
|
284
|
+
content: MediaSurfaceImage | MediaSurfaceVideoOf<P>;
|
|
268
285
|
/** Style of the host BOX. Give it the radius and `overflow: 'hidden'` you want. */
|
|
269
286
|
style?: StyleProp<ViewStyle>;
|
|
270
287
|
/** How the media fills the box. Defaults to `'cover'`. */
|
|
@@ -273,7 +290,7 @@ export interface MediaFlightHostProps {
|
|
|
273
290
|
* Paint the video yourself, keeping your own `ref` and expo-video props. See
|
|
274
291
|
* {@link MediaVideoSlot}; memoise it.
|
|
275
292
|
*/
|
|
276
|
-
renderVideo?: MediaVideoSlot
|
|
293
|
+
renderVideo?: MediaVideoSlot<P>;
|
|
277
294
|
/** Whether the video arm shows expo-video's own controls. Defaults to `false`. */
|
|
278
295
|
nativeControls?: boolean;
|
|
279
296
|
accessibilityLabel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACpC,eAAe,CACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GACtE,IAAI,CAAC;CACT;AAED,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wCAAwC;IACxC,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,kEAAkE;IAClE,MAAM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;OAKG;IACH,OAAO,EAAE,iBAAiB,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;IACpD,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,CAAC,CAAC,CAAC;IAChC,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"}
|
package/package.json
CHANGED
|
@@ -15,10 +15,27 @@ import { useCallback } from 'react';
|
|
|
15
15
|
import { StyleSheet, View } from 'react-native';
|
|
16
16
|
|
|
17
17
|
import { MediaSurface } from './MediaSurface';
|
|
18
|
+
import type { VideoPlayerLike } from './expo-video-module';
|
|
18
19
|
import { registerAnchor } from './store';
|
|
19
|
-
import type { MediaFlightHostProps } from './types';
|
|
20
|
+
import type { MediaFlightHostProps, MediaVideoSlot } from './types';
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Hand a consumer's slot to `MediaSurface`, which is not generic.
|
|
24
|
+
*
|
|
25
|
+
* SOUND, and the reason is the invariant this whole family is built on: the
|
|
26
|
+
* only player Bloom ever passes to a slot is the one it took out of that
|
|
27
|
+
* slot's own `content`. Bloom transports the object and never substitutes one,
|
|
28
|
+
* so the value really is a `P` at runtime — the assertion says what the types
|
|
29
|
+
* cannot follow through a `memo`'d component, and it lives HERE, once, rather
|
|
30
|
+
* than in every consumer's `renderVideo`.
|
|
31
|
+
*/
|
|
32
|
+
function widenSlot<P extends VideoPlayerLike>(
|
|
33
|
+
slot: MediaVideoSlot<P> | undefined,
|
|
34
|
+
): MediaVideoSlot | undefined {
|
|
35
|
+
return slot as MediaVideoSlot | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function MediaFlightHost<P extends VideoPlayerLike = VideoPlayerLike>({
|
|
22
39
|
id,
|
|
23
40
|
content,
|
|
24
41
|
style,
|
|
@@ -29,7 +46,7 @@ export function MediaFlightHost({
|
|
|
29
46
|
surfaceType,
|
|
30
47
|
pointerEvents,
|
|
31
48
|
flightId,
|
|
32
|
-
}: MediaFlightHostProps) {
|
|
49
|
+
}: MediaFlightHostProps<P>) {
|
|
33
50
|
// A callback ref rather than an effect: the anchor must be measurable the
|
|
34
51
|
// moment the box is on screen, and a tap can come one frame later.
|
|
35
52
|
const setNode = useCallback(
|
|
@@ -42,7 +59,7 @@ export function MediaFlightHost({
|
|
|
42
59
|
<MediaSurface
|
|
43
60
|
content={content}
|
|
44
61
|
contentFit={contentFit}
|
|
45
|
-
renderVideo={renderVideo}
|
|
62
|
+
renderVideo={widenSlot(renderVideo)}
|
|
46
63
|
nativeControls={nativeControls}
|
|
47
64
|
accessibilityLabel={accessibilityLabel}
|
|
48
65
|
surfaceType={surfaceType}
|
|
@@ -22,10 +22,18 @@ import {
|
|
|
22
22
|
releaseMediaNode,
|
|
23
23
|
type MediaNodeRender,
|
|
24
24
|
} from './media-node.web';
|
|
25
|
+
import type { VideoPlayerLike } from './expo-video-module';
|
|
25
26
|
import { handOffFlight, hasFlight, registerAnchor } from './store';
|
|
26
|
-
import type { MediaFlightHostProps } from './types';
|
|
27
|
+
import type { MediaFlightHostProps, MediaVideoSlot } from './types';
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* The web host publishes its slot to the layer, which paints every shared node
|
|
31
|
+
* through one non-generic `MediaSurface`. Widening is sound for the same reason
|
|
32
|
+
* as the native host's `widenSlot`: the only player Bloom ever hands a slot is
|
|
33
|
+
* the one it took out of that slot's own `content`. Bloom transports the
|
|
34
|
+
* object; it never substitutes one.
|
|
35
|
+
*/
|
|
36
|
+
export function MediaFlightHost<P extends VideoPlayerLike = VideoPlayerLike>({
|
|
29
37
|
id,
|
|
30
38
|
content,
|
|
31
39
|
style,
|
|
@@ -35,7 +43,7 @@ export function MediaFlightHost({
|
|
|
35
43
|
accessibilityLabel,
|
|
36
44
|
pointerEvents,
|
|
37
45
|
flightId,
|
|
38
|
-
}: MediaFlightHostProps) {
|
|
46
|
+
}: MediaFlightHostProps<P>) {
|
|
39
47
|
// State rather than a ref, because the claim runs in a layout effect and an
|
|
40
48
|
// effect cannot depend on a ref's mutation. One extra render at mount.
|
|
41
49
|
const [node, setNode] = useState<View | null>(null);
|
|
@@ -49,7 +57,15 @@ export function MediaFlightHost({
|
|
|
49
57
|
);
|
|
50
58
|
|
|
51
59
|
const render = useMemo<MediaNodeRender>(
|
|
52
|
-
() => ({
|
|
60
|
+
() => ({
|
|
61
|
+
content,
|
|
62
|
+
contentFit,
|
|
63
|
+
// See `widenSlot`: the player a slot gets back is the one it put in.
|
|
64
|
+
renderVideo: renderVideo as MediaVideoSlot | undefined,
|
|
65
|
+
nativeControls,
|
|
66
|
+
accessibilityLabel,
|
|
67
|
+
flightId,
|
|
68
|
+
}),
|
|
53
69
|
[content, contentFit, renderVideo, nativeControls, accessibilityLabel, flightId],
|
|
54
70
|
);
|
|
55
71
|
const renderRef = useRef(render);
|
|
@@ -66,6 +66,19 @@ export interface MediaSurfaceVideo {
|
|
|
66
66
|
/** What a media surface paints: a still image, or a consumer-owned video. */
|
|
67
67
|
export type MediaSurfaceContent = MediaSurfaceImage | MediaSurfaceVideo;
|
|
68
68
|
|
|
69
|
+
/**
|
|
70
|
+
* `MediaSurfaceVideo` carrying the consumer's OWN player type.
|
|
71
|
+
*
|
|
72
|
+
* Bloom transports that object; it never reads it. Narrowing it to
|
|
73
|
+
* `VideoPlayerLike` on the way through would be Bloom asserting something about
|
|
74
|
+
* cargo — and it would land on the consumer, who then has to cast the player
|
|
75
|
+
* back before handing it to expo-video's `VideoView`. A contract that pushes a
|
|
76
|
+
* consumer towards `as` ends up as an `as any` in someone's repo.
|
|
77
|
+
*/
|
|
78
|
+
export interface MediaSurfaceVideoOf<P extends VideoPlayerLike> extends MediaSurfaceVideo {
|
|
79
|
+
player: P;
|
|
80
|
+
}
|
|
81
|
+
|
|
69
82
|
/**
|
|
70
83
|
* A media surface currently owned by the flight layer.
|
|
71
84
|
*
|
|
@@ -233,7 +246,7 @@ export interface MediaFlightController {
|
|
|
233
246
|
* INTRINSIC size (300x150) instead of stretching — so a slot that drops this
|
|
234
247
|
* style paints a 300x150 video inside whatever box it was given. Spread it.
|
|
235
248
|
*/
|
|
236
|
-
export interface MediaVideoSlotProps {
|
|
249
|
+
export interface MediaVideoSlotProps<P extends VideoPlayerLike = VideoPlayerLike> {
|
|
237
250
|
/**
|
|
238
251
|
* The player Bloom was given — never one Bloom created.
|
|
239
252
|
*
|
|
@@ -244,7 +257,7 @@ export interface MediaVideoSlotProps {
|
|
|
244
257
|
* anything else here — keeping the old player, unmounting instead — brings
|
|
245
258
|
* that defect back. See `releaseFlight`.
|
|
246
259
|
*/
|
|
247
|
-
player:
|
|
260
|
+
player: P | null;
|
|
248
261
|
/** Fills the box. Spread it — see above. */
|
|
249
262
|
style: StyleProp<ViewStyle>;
|
|
250
263
|
contentFit: 'contain' | 'cover';
|
|
@@ -267,7 +280,9 @@ export interface MediaVideoSlotProps {
|
|
|
267
280
|
* layer, compared by identity — a new function every render republishes every
|
|
268
281
|
* render. Correct either way, wasteful if you skip it.
|
|
269
282
|
*/
|
|
270
|
-
export type MediaVideoSlot =
|
|
283
|
+
export type MediaVideoSlot<P extends VideoPlayerLike = VideoPlayerLike> = (
|
|
284
|
+
props: MediaVideoSlotProps<P>,
|
|
285
|
+
) => ReactNode;
|
|
271
286
|
|
|
272
287
|
/**
|
|
273
288
|
* A place a media surface may live: the feed row it starts in, the fullscreen
|
|
@@ -279,11 +294,16 @@ export type MediaVideoSlot = (props: MediaVideoSlotProps) => ReactNode;
|
|
|
279
294
|
* ever leaving the document. On native a host renders its media inline, which
|
|
280
295
|
* is what it has always done and what the platform makes correct there.
|
|
281
296
|
*/
|
|
282
|
-
export interface MediaFlightHostProps {
|
|
297
|
+
export interface MediaFlightHostProps<P extends VideoPlayerLike = VideoPlayerLike> {
|
|
283
298
|
/** The id this host shares with the flight and with the other end. */
|
|
284
299
|
id: string;
|
|
285
|
-
/**
|
|
286
|
-
|
|
300
|
+
/**
|
|
301
|
+
* What to paint: a still image, or a consumer-owned expo-video player.
|
|
302
|
+
*
|
|
303
|
+
* The player's own type flows from here into {@link renderVideo}, so a slot
|
|
304
|
+
* gets back exactly what it put in and hands it to `VideoView` with no cast.
|
|
305
|
+
*/
|
|
306
|
+
content: MediaSurfaceImage | MediaSurfaceVideoOf<P>;
|
|
287
307
|
/** Style of the host BOX. Give it the radius and `overflow: 'hidden'` you want. */
|
|
288
308
|
style?: StyleProp<ViewStyle>;
|
|
289
309
|
/** How the media fills the box. Defaults to `'cover'`. */
|
|
@@ -292,7 +312,7 @@ export interface MediaFlightHostProps {
|
|
|
292
312
|
* Paint the video yourself, keeping your own `ref` and expo-video props. See
|
|
293
313
|
* {@link MediaVideoSlot}; memoise it.
|
|
294
314
|
*/
|
|
295
|
-
renderVideo?: MediaVideoSlot
|
|
315
|
+
renderVideo?: MediaVideoSlot<P>;
|
|
296
316
|
/** Whether the video arm shows expo-video's own controls. Defaults to `false`. */
|
|
297
317
|
nativeControls?: boolean;
|
|
298
318
|
accessibilityLabel?: string;
|