LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/angularinjectMediaUrl
Functionā—Since v1.0

injectMediaUrl

Copy
injectMediaUrl(
  media: MediaBase | Signal<MediaBase | undefined> | undefined
): Signal<string |
View source on GitHub
undefined
>

Parameters

NameTypeDescription
media*MediaBase | Signal<MediaBase | undefined> | undefined

Resolve the lazy MediaBase.objectURL promise into a string suitable for direct use in <audio src> / <img src> / <video src> / <a href download>. Returns undefined until the URL is available.

Lifecycle:

  • On first read (or when media changes) the helper awaits media.objectURL, then commits the resolved string to the returned signal.
  • On destroy (or when media changes) the helper calls media.revoke() to free the object URL slot. The next consumer that accesses media.objectURL mints a fresh URL from the same Blob, so live re-renders just work.
  • If the underlying handle errored before settling, the promise rejects and injectMediaUrl stays at undefined. Inspect media.error to surface the failure.

Pair with injectAudio / injectImages / injectVideo / injectFiles to bridge SDK media handles into Angular templates without manual URL.createObjectURL bookkeeping.

media accepts a plain handle or a Signal<MediaBase | undefined> so callers can feed a computed(() => stream.audio()[0]).