Skip to content

Commit 18c33ec

Browse files
committed
Merge branch 'master' of github.com:LonelyCpp/react-native-youtube-iframe into docusaurus
2 parents 29fc98b + 56c771a commit 18c33ec

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

index.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ import React from 'react';
22
import {StyleProp, ViewStyle} from 'react-native';
33
import {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+
515
export 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

113127
declare const YoutubeIframe: React.SFC<YoutubeIframeProps>;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
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",

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}}

0 commit comments

Comments
 (0)