Skip to content

Commit 9b85d97

Browse files
committed
remove duplicate call to MAIN_SCRIPT
1 parent c44fa5b commit 9b85d97

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

src/YoutubeIframe.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -178,26 +178,20 @@ const YoutubeIframe = (props, ref) => {
178178
);
179179

180180
const source = useMemo(() => {
181-
if (useLocalHTML) {
182-
return {
183-
html: MAIN_SCRIPT(
184-
videoId,
185-
playList,
186-
initialPlayerParams,
187-
allowWebViewZoom,
188-
contentScale,
189-
).htmlString,
190-
};
191-
}
192-
193-
const base = baseUrlOverride || defaultBaseUrl;
194-
const data = MAIN_SCRIPT(
181+
const ytScript = MAIN_SCRIPT(
195182
videoId,
196183
playList,
197184
initialPlayerParams,
198185
allowWebViewZoom,
199186
contentScale,
200-
).urlEncodedJSON;
187+
);
188+
189+
if (useLocalHTML) {
190+
return {html: ytScript.htmlString};
191+
}
192+
193+
const base = baseUrlOverride || defaultBaseUrl;
194+
const data = ytScript.urlEncodedJSON;
201195

202196
return {uri: base + '?data=' + data};
203197
}, [

0 commit comments

Comments
 (0)