react-native-af-video-player
react-native-af-video-player copied to clipboard
warnings and error
"react-native": "0.54.1", "react-native-af-video-player": "^0.2.0", OS : windows 10
i am getting these sometimes when full screen pressed sometimes
1)Warning:Failed prop type: Invalid prop color
supplied to Icon
.
in Icon (at Video.js:316)
2)Warning: Failed prop type: Invalid prop color
supplied to Text
: [object Object]
Valid color formats are
- '#f0f' (#rgb)
- '#f0fc' (#rgba)
- '#ff00ff' (#rrggbb)
- '#ff00ff00' (#rrggbbaa)
- 'rgb(255, 255, 255)'
- 'rgba(255, 255, 255, 1.0)'
- 'hsl(360, 100%, 100%)'
- 'hsla(360, 100%, 100%, 1.0)'
- 'transparent'
- 'red'
- 0xff00ff00 (0xrrggbbaa)
Bad object: { "fontSize": 60, "color": { "title": "#FFF", "more": "#FFF", "center": "#FFF", "fullscreen": "#FFF", "volume": "#FFF", "scrubberThumb": "#FFF", "scrubberBar": "#FFF", "seconds": "#FFF", "duration": "#FFF", "progress": "#FFF", "loading": "#FFF" }, "fontFamily": "MaterialIcons", "fontWeight": "normal", "fontStyle": "normal" } in Text (at create-icon-set.js:82) in Icon (at Video.js:316)
3)TypeError: Cannot read property 'seek' of null This error is located at: in Video
In video.js line 351 color={this.props.theme} replace it with color="white"
hey @crzycoder sry for the late replay
do not fix the color="white"
as static
i have changed it to
color={this.props.theme,iconColor} in the <Icons />
in the video.js file in react-native-af-video library
and in your code where you are calling react-native-af-video-player you can do like this
<Video
......
theme={styles.videoTheme} />
where you can pass the theme as declared styles from there it will take iconColor. you can also pass the color to different views like this
const styles={
videoTheme :
{title:'#FFF',
more: '#FFF',
center: '#FFF',
fullscreen: '#FFF',
volume: '#FFF',
scrubberThumb: '#FFF',
scrubberBar: '#FFF',
seconds: '#FFF',
duration: '#FFF',
progress: '#FFF',
loading: '#FFF',
iconColor:'#FFF'},
}
Make these two changes:
diff --git a/node_modules/react-native-af-video-player/components/Time.js b/node_modules/react-native-af-video-player/components/Time.js
index 01be913..9e847ac 100644
--- a/node_modules/react-native-af-video-player/components/Time.js
+++ b/node_modules/react-native-af-video-player/components/Time.js
@@ -32,7 +32,7 @@ class Time extends Component {
render() {
return (
<View style={styles.container}>
- <Text style={{ color: this.props.theme }}>{this.getTime(parseInt(this.props.time, 10))}</Text>
+ <Text style={{ color: this.props.theme.iconColor }}>{this.getTime(parseInt(this.props.time, 10))}</Text>
</View>
)
}
diff --git a/node_modules/react-native-af-video-player/components/Video.js b/node_modules/react-native-af-video-player/components/Video.js
index 258171b..ae7cfd6 100644
--- a/node_modules/react-native-af-video-player/components/Video.js
+++ b/node_modules/react-native-af-video-player/components/Video.js
@@ -318,7 +318,7 @@ class Video extends Component {
<Icons
name="replay"
size={60}
- color={this.props.theme}
+ color={this.props.theme.iconColor}
onPress={() => this.setState({ renderError: false })}
/>
</Animated.View>
And then the theme will work correctly. Im using patch-package. npx patch-package react-native-af-video-player
will apply it for you without waiting on this library to be updated.