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/reactuseVideoPlayer
Function●Since v1.0

useVideoPlayer

Bind a VideoMedia handle to a caller-owned <video> element.

Contract

  • The caller renders <video ref={videoRef}> and styles it however they like; the hook never injects DOM nor overrides layout.
  • On message-finish, the underlying blob URL is minted and assigned as video.src. Progressive playback of streamed container video (fragmented mp4 / webm via MSE) is out of scope for this version; status stays in "buffering" until the blob resolves.
  • Element events (play / pause / ended / timeupdate / loadedmetadata / error) are translated into the shared PlayerStatus enum.
  • On unmount, media.revoke() is called to free the object URL.
Copy
useVideoPlayer(
  videoRef: RefObject<HTMLVideoElement | null>,
  media: VideoMedia | undefined,
  options: UseVideoPlayerOptions
): VideoPlayerHandle

Parameters

NameTypeDescription
videoRef*RefObject<HTMLVideoElement | null>

Ref to the <video> element the caller renders.

media*VideoMedia | undefined

Video handle from useVideo.

optionsUseVideoPlayerOptions

Auto-play toggle.

View source on GitHub