useMediaURL(media: ValueOrGetter<MediaBase | undefined>): ReactiveValue<string | undefined>| Name | Type | Description |
|---|---|---|
media* | ValueOrGetter<MediaBase | undefined> |
Resolve the lazy MediaBase.objectURL promise into a
reactive string suitable for <audio src>, <img src>,
<video src>, or <a download href>. Reads .current for the
latest URL, or undefined until the promise settles.
Lifecycle:
$effect (or whenever the supplied media value
changes), awaits media.objectURL and commits the resolved
string to state.media changes), calls media.revoke() to
free the blob-URL slot. The next consumer that accesses
media.objectURL mints a fresh URL from the same Blob, so
live re-renders just work.undefined. Surface the failure via media.error.media accepts a raw handle or a getter so the composable rebinds
automatically to the latest media without a manual effect at the
call site.