For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /guide/getting-started/quick-start.md.
  • English
  • 2.x
  • Quick Start

    Examples & Demo

    The smallest working example looks like this:

    import { YoutubeView, useYouTubePlayer } from 'react-native-youtube-bridge';
    
    function App() {
      const player = useYouTubePlayer('AbZH7XWDW_k');
    
      return <YoutubeView player={player} />;
    }

    Accepted source forms

    You can initialize the player with:

    const playerA = useYouTubePlayer('AbZH7XWDW_k');
    const playerB = useYouTubePlayer({ videoId: 'AbZH7XWDW_k' });
    const playerC = useYouTubePlayer({ url: 'https://www.youtube.com/watch?v=AbZH7XWDW_k' });

    Add initial player options

    const player = useYouTubePlayer('AbZH7XWDW_k', {
      autoplay: true,
      controls: true,
      playsinline: true,
      rel: false,
      muted: true,
    });

    Next steps