Updated save function README, updated video-caching example to test saving function

This commit is contained in:
Nicolas Gonzalez
2018-11-06 20:33:33 -06:00
parent dd1c6867ad
commit 8a3b6490dc
3 changed files with 24 additions and 4 deletions

View File

@@ -5,7 +5,7 @@
*/
import React, { Component } from "react";
import { StyleSheet, Text, View, Dimensions } from "react-native";
import { StyleSheet, Text, View, Dimensions, TouchableOpacity } from "react-native";
import Video from "react-native-video";
const { height, width } = Dimensions.get("screen");
@@ -28,6 +28,16 @@ export default class App extends Component<Props> {
}}
style={{ flex: 1, height, width }}
/>
<TouchableOpacity
onPress={async () => {
let response = await this.player.save();
let uri = response.uri;
console.log("Download URI", uri);
}}
style={styles.button}
>
<Text style={{color: 'white'}}>Save</Text>
</TouchableOpacity>
</View>
);
}
@@ -40,6 +50,14 @@ const styles = StyleSheet.create({
alignItems: "center",
backgroundColor: "#F5FCFF"
},
button: {
position: 'absolute',
top: 50,
right: 16,
padding: 10,
backgroundColor: '#9B2FAE',
borderRadius: 8
},
welcome: {
fontSize: 20,
textAlign: "center",