Custom WebView Player
You only need @react-native-youtube-bridge/web when you want to host your own external player page.
Typical flow
- Build a small web page with
@react-native-youtube-bridge/web - Host that page
- Pass the hosted URL to
YoutubeViewthroughwebViewUrl
Install
Minimal custom page
Use it from native
Query-string contract
When native YoutubeView loads your hosted page, it appends player state into the URL query string. The hosted @react-native-youtube-bridge/web player reads these values:
videoIdstartTimeendTimeoriginautoplaycontrolsloopmutedplaysinlinerel
That means a custom page should either:
- render the stock
@react-native-youtube-bridge/webplayer, or - preserve the same query contract if you build your own wrapper around it
Message bridge expectation
When used inside React Native WebView, the hosted page is expected to send player events and command results back through window.ReactNativeWebView.postMessage(...). If you stay with the stock @react-native-youtube-bridge/web player, this is already handled for you.
When this is worth it
- custom hosting requirements
- origin-specific iframe needs
- apps that need to avoid inline HTML mode for compatibility reasons
