You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/types/youtube.ts
+25-7Lines changed: 25 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,17 +4,33 @@ import type { WebViewProps } from 'react-native-webview';
4
4
5
5
exporttypeYoutubePlayerVars={
6
6
/**
7
-
* @description If the `muted` is not set to true when activating the `autoplay`, it may not work properly depending on browser policy. (https://developer.chrome.com/blog/autoplay)
7
+
* @description If the `muted` is not set to true when activating the `autoplay`,
8
+
* it may not work properly depending on browser policy. (https://developer.chrome.com/blog/autoplay)
8
9
*/
9
10
autoplay?: boolean;
11
+
/**
12
+
* @description If the `controls` is set to true, the player will display the controls.
13
+
*/
10
14
controls?: boolean;
15
+
/**
16
+
* @description If the `loop` is set to true, the player will loop the video.
17
+
*/
11
18
loop?: boolean;
19
+
/**
20
+
* @description If the `muted` is set to true, the player will be muted.
21
+
*/
12
22
muted?: boolean;
13
23
startTime?: number;
14
24
endTime?: number;
15
25
playsinline?: boolean;
16
-
rel?: boolean;// 관련 동영상 표시
17
-
origin?: string;// 보안을 위한 origin 설정
26
+
/**
27
+
* @description If the `rel` is set to true, the related videos will be displayed.
28
+
*/
29
+
rel?: boolean;
30
+
/**
31
+
* @description The origin of the player.
32
+
*/
33
+
origin?: string;
18
34
};
19
35
20
36
// YouTube IFrame API official documentation based
@@ -24,8 +40,6 @@ export type YoutubePlayerProps = {
24
40
height?: DimensionValue;
25
41
/**
26
42
* @description The interval (in milliseconds) at which `onProgress` callback is called.
27
-
* Must be a positive number to enable progress tracking.
28
-
* If not provided or set to 0/falsy value, progress tracking is disabled.
29
43
*/
30
44
progressInterval?: number;
31
45
style?: StyleProp<ViewStyle>;
@@ -43,12 +57,16 @@ export type YoutubePlayerProps = {
43
57
iframeStyle?: CSSProperties;
44
58
45
59
// Events
60
+
/**
61
+
* @description Callback function called when the player is ready.
62
+
*/
46
63
onReady?: (playerInfo: PlayerInfo)=>void;
47
64
onStateChange?: (state: PlayerState)=>void;
48
65
onError?: (error: YouTubeError)=>void;
49
66
/**
50
-
* @description Callback function called at the specified `progressInterval`.
51
-
* Only invoked when `progressInterval` is provided as a positive number.
67
+
* @description Callback function called at the specified `progressInterval`
68
+
* or when `seekTo` is invoked. Only triggered when `progressInterval` is
0 commit comments