Skip to content

Commit 8fd6f4f

Browse files
author
Michał Kardyś
committed
style: update according to prettier
1 parent 2467e97 commit 8fd6f4f

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/YoutubeIframe.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ import {View, StyleSheet, Platform} from 'react-native';
1010
import WebView from 'react-native-webview';
1111
import {PLAYER_STATES, PLAYER_ERROR, CUSTOM_USER_AGENT} from './constants';
1212
import {EventEmitter} from 'events';
13-
import {MAIN_SCRIPT, PLAYER_FUNCTIONS, playMode, soundMode} from './PlayerScripts';
13+
import {
14+
MAIN_SCRIPT,
15+
PLAYER_FUNCTIONS,
16+
playMode,
17+
soundMode,
18+
} from './PlayerScripts';
1419

1520
const YoutubeIframe = (
1621
{
@@ -94,17 +99,18 @@ const YoutubeIframe = (
9499
);
95100

96101
useEffect(() => {
97-
if (!playerReady) {
98-
return;
99-
}
102+
if (!playerReady) {
103+
return;
104+
}
105+
106+
[
107+
playMode[play],
108+
soundMode[mute],
109+
PLAYER_FUNCTIONS.setVolume(volume),
110+
PLAYER_FUNCTIONS.setPlaybackRate(playbackRate),
111+
].forEach(webViewRef.current.injectJavaScript);
100112

101-
[
102-
playMode[play],
103-
soundMode[mute],
104-
PLAYER_FUNCTIONS.setVolume(volume),
105-
PLAYER_FUNCTIONS.setPlaybackRate(playbackRate),
106-
].forEach(webViewRef.current.injectJavaScript)
107-
}, [play, playerReady, mute, volume, playbackRate]);
113+
}, [play, playerReady, mute, volume, playbackRate]);
108114

109115
const onWebMessage = useCallback(
110116
event => {

0 commit comments

Comments
 (0)