API Reference
This page summarizes the legacy 1.x component API and prevents version switching from the 2.x API reference from landing on a 404.
Main exports
Main component
YoutubePlayer
Renders a YouTube player directly and exposes imperative controls through ref.
Common props
source: YouTube video ID, YouTube URL, or source object.playerVars: YouTube embedded player parameters.height/width: player size.style: React Native player container style.iframeStyle: iframe wrapper style on web.webViewStyle: WebView style on iOS and Android.webViewProps: additional WebView props on iOS and Android.useInlineHtml: choose inline HTML or external WebView mode on iOS and Android.webViewUrl: custom WebView source URL or inline HTMLbaseUrl.progressInterval: enablesonProgresswhen set to a positive interval.
Event props
onReadyonStateChangeonErroronProgressonPlaybackRateChangeonPlaybackQualityChangeonAutoplayBlocked
Wrap event handlers with useCallback to avoid unstable callback references.
Ref methods
play,pause,stop,seekTosetVolume,getVolume,mute,unMute,isMutedgetCurrentTime,getDuration,getVideoUrl,getVideoEmbedCodegetPlaybackRate,setPlaybackRate,getAvailablePlaybackRatesgetPlayerState,getVideoLoadedFractionloadVideoById,cueVideoById,setSize
Metadata hook
useYoutubeOEmbed(url?) fetches optional YouTube oEmbed metadata for a YouTube URL.
New projects
1.x is legacy. New projects should start with the 2.x API reference and useYouTubePlayer + YoutubeView.
