@@ -13,97 +13,11 @@ A wrapper of the Youtube IFrame player API build for react native.
1313- ✅ Works on modals and overlay components
1414- ✅ Expo support
1515
16- ![ ios] ( ./doc /demo.gif?raw=true ' ios ')
16+ ![ ios] ( ./website/static/img /demo.gif?raw=true ' ios ')
1717
18- ## Prerequisite
18+ ## Installation and Documentation
1919
20- This package uses react-hooks and therefore will need ** react-native ` 0.59 ` or above**
21-
22- (recommended - react native version - ` 0.60 ` or above)
23-
24- ## Installation
25-
26- 1 . First install ` react-native-webview ` .
27-
28- - Bare React Native app - [ Instructions] ( https://github.com/react-native-community/react-native-webview/blob/master/docs/Getting-Started.md )
29-
30- - React Native version ** ` 0.60 ` and above** , install the latest version of react-native-webview
31- - React Native version ** below ` 0.60 ` ** , react-native-webview version ` 6.11.1 ` is the last version that supports it.
32-
33- - Expo Managed App - [ Instructions] ( https://docs.expo.io/versions/latest/sdk/webview/ )
34-
35- 2 . Run - ` npm install react-native-youtube-iframe `
36-
37- ## Usage
38-
39- ``` js
40- import React , {useRef , useState } from ' react' ;
41- import YoutubePlayer from ' react-native-youtube-iframe' ;
42-
43- const playerRef = useRef (null );
44- const [playing , setPlaying ] = useState (true );
45- ```
46-
47- ``` JSX
48- < YoutubePlayer
49- ref= {playerRef}
50- height= {300 }
51- width= {400 }
52- videoId= {" AVAc1gYLZK0" }
53- play= {playing}
54- onChangeState= {event => console .log (event )}
55- onReady= {() => console .log (" ready" )}
56- onError= {e => console .log (e)}
57- onFullScreenChange= {status => console .log (status)}
58- onPlaybackQualityChange= {q => console .log (q)}
59- volume= {50 }
60- playbackRate= {1 }
61- initialPlayerParams= {{
62- cc_lang_pref: " us" ,
63- showClosedCaptions: true
64- }}
65- / >
66- ```
67-
68- ## API reference
69-
70- ** [ Click here for full reference] ( ./doc ) **
71-
72- list of available APIs -
73-
74- ### props
75-
76- - videoId
77- - playList
78- - playListStartIndex
79- - play
80- - onChangeState
81- - onReady
82- - onError
83- - onFullScreenChange
84- - onPlaybackQualityChange
85- - mute
86- - volume
87- - playbackRate
88- - onPlaybackRateChange
89- - initialPlayerParams
90- - webViewStyle
91- - webViewProps
92- - allowWebViewZoom
93-
94- ### Ref functions
95-
96- - getDuration
97- - getCurrentTime
98- - isMuted
99- - getVolume
100- - getPlaybackRate
101- - getAvailablePlaybackRates
102- - seekTo
103-
104- ## methods
105-
106- - getYoutubeMeta
20+ [ react-native-youtube-iframe] ( https://lonelycpp.github.io/react-native-youtube-iframe/ )
10721
10822## Contributing
10923
0 commit comments