File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,16 @@ import React from 'react';
22import { StyleProp , ViewStyle } from 'react-native' ;
33import { WebViewProps } from 'react-native-webview' ;
44
5+ export interface YoutubeIframeRef {
6+ getDuration : ( ) => Promise < number > ;
7+ getCurrentTime : ( ) => Promise < number > ;
8+ isMuted : ( ) => Promise < boolean > ;
9+ getVolume : ( ) => Promise < number > ;
10+ getPlaybackRate : ( ) => Promise < number > ;
11+ getAvailablePlaybackRates : ( ) => Promise < number [ ] > ;
12+ seekTo : ( seconds : number , allowSeekAhead : boolean ) => void ;
13+ }
14+
515export interface InitialPlayerParams {
616 loop ?: boolean ;
717 controls ?: boolean ;
@@ -108,6 +118,10 @@ export interface YoutubeIframeProps {
108118 * Flag to decide whether or not a user can zoom the video webview.
109119 */
110120 allowWebViewZoom ?: Boolean ;
121+ /**
122+ * Set this React Ref to use ref functions such as getDuration.
123+ */
124+ ref ?: React . MutableRefObject < YoutubeIframeRef | null > ;
111125}
112126
113127declare const YoutubeIframe : React . SFC < YoutubeIframeProps > ;
Original file line number Diff line number Diff line change 3131 },
3232 "homepage" : " https://lonelycpp.github.io/react-native-youtube-iframe/" ,
3333 "peerDependencies" : {
34- "react" : " >=16.8.0 " ,
35- "react-native" : " >=0.59 " ,
36- "react-native-webview" : " ^7.5.2 "
34+ "react" : " >=16.8.6 " ,
35+ "react-native" : " >=0.60 " ,
36+ "react-native-webview" : " >=7.0.0 "
3737 },
3838 "devDependencies" : {
3939 "@react-native-community/eslint-config" : " ^1.1.0" ,
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ const [playing, setPlaying] = useState(true);
5858 onPlaybackQualityChange= {q => console .log (q)}
5959 volume= {50 }
6060 playbackRate= {1 }
61- playerParams = {{
61+ initialPlayerParams = {{
6262 cc_lang_pref: " us" ,
6363 showClosedCaptions: true
6464 }}
You can’t perform that action at this time.
0 commit comments