@@ -5,6 +5,7 @@ import React, {
55 useImperativeHandle ,
66 forwardRef ,
77 useState ,
8+ Platform ,
89} from 'react' ;
910import { View , StyleSheet } from 'react-native' ;
1011import WebView from 'react-native-webview' ;
@@ -18,19 +19,20 @@ const YoutubeIframe = (
1819 width,
1920 videoId,
2021 playList,
21- playListStartIndex = 0 ,
2222 play = false ,
23- onChangeState = _event => { } ,
24- onReady = _event => { } ,
25- onError = _err => { } ,
26- onPlaybackQualityChange = _quality => { } ,
2723 mute = false ,
2824 volume = 100 ,
29- playbackRate = 1 ,
30- onPlaybackRateChange = _playbackRate => { } ,
31- initialPlayerParams = { } ,
3225 webViewStyle,
3326 webViewProps,
27+ playbackRate = 1 ,
28+ onError = _err => { } ,
29+ onReady = _event => { } ,
30+ playListStartIndex = 0 ,
31+ initialPlayerParams = { } ,
32+ forceAndroidAutoplay = false ,
33+ onChangeState = _event => { } ,
34+ onPlaybackQualityChange = _quality => { } ,
35+ onPlaybackRateChange = _playbackRate => { } ,
3436 } ,
3537 ref ,
3638) => {
@@ -170,6 +172,10 @@ const YoutubeIframe = (
170172 mediaPlaybackRequiresUserAction = { false }
171173 allowsInlineMediaPlayback
172174 onMessage = { onWebMessage }
175+ userAgent = { Platform . select ( {
176+ android :
177+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36' ,
178+ } ) }
173179 { ...webViewProps }
174180 />
175181 </ View >
0 commit comments