UNPKG

react-native-youtube-bridge

Version:

🎥 Easy-to-use YouTube player for React Native with cross-platform support

35 lines • 1.08 kB
import type { YoutubePlayerVars, YoutubeSource } from '@react-native-youtube-bridge/core'; import YoutubePlayer from '../modules/YoutubePlayer'; /** * @param source - The source of the Youtube video. * @example * ```ts * const player = useYouTubePlayer('AbZH7XWDW_k'); * const player = useYouTubePlayer({ videoId: 'AbZH7XWDW_k' }); * const player = useYouTubePlayer({ url: 'https://www.youtube.com/watch?v=AbZH7XWDW_k' }); * ``` * @param config - The config for the Youtube player. * @returns The Youtube player instance. * @example * ```ts * const player = useYouTubePlayer('AbZH7XWDW_k', { * autoplay: true, * controls: true, * playsinline: true, * rel: false, * muted: true, * }); * * player.play(); * player.pause(); * player.seekTo(10); * player.setVolume(50); * player.mute(); * player.unMute(); * player.getVolume(); * player.getPlayerState(); * ``` */ declare const useYouTubePlayer: (source: YoutubeSource, config?: YoutubePlayerVars) => YoutubePlayer; export default useYouTubePlayer; //# sourceMappingURL=useYouTubePlayer.d.ts.map