mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-15 17:47:49 +08:00
[react-native-video] Add onProgress data test
This commit is contained in:
@@ -7,16 +7,27 @@ import {
|
||||
} from 'react-native';
|
||||
import Video from 'react-native-video';
|
||||
|
||||
class SwiperTest extends React.Component {
|
||||
class VideoTest extends React.Component {
|
||||
constructor(props: {}) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render(): React.ReactElement<any> {
|
||||
return (
|
||||
<Video source={{uri: '//:example.com/test.mp4'}}/>
|
||||
<Video
|
||||
source={{ uri: '//:example.com/test.mp4' }}
|
||||
onProgress={this.onProgress}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
onProgress = (data: {
|
||||
currentTime: number,
|
||||
playableDuration: number,
|
||||
}): void => {
|
||||
console.log(data.currentTime, data.playableDuration);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
Reference in New Issue
Block a user