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/svelteuseVideoPlayer
Functionā—Since v0.4

useVideoPlayer

Copy
useVideoPlayer(
  videoRef: ValueOrGetter<HTMLVideoElement | null | undefined>,
  media: ValueOrGetter<VideoMedia | undefined>,
  
View source on GitHub
options
:
UseVideoPlayerOptions
)
:
VideoPlayerHandle

Parameters

NameTypeDescription
videoRef*ValueOrGetter<HTMLVideoElement | null | undefined>
media*ValueOrGetter<VideoMedia | undefined>
optionsUseVideoPlayerOptions

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

Svelte idioms:

  • videoRef accepts a raw HTMLVideoElement, a $state binding, or a getter. Use Svelte 5's bind:this to assign a template reference and pass it via a getter so the composable re-binds when the element first mounts:
<script lang="ts">
  let videoEl = $state<HTMLVideoElement>();
  const player = useVideoPlayer(() => videoEl, () => media);
</script>
<video bind:this={videoEl} />
  • The composable never injects DOM nor overrides layout.
  • On component destroy (or when media changes) the composable calls media.revoke() to free the object URL.

Reactive reference to the <video> element.

Video handle from useVideo.

Auto-play toggle.