/** * Sample React Native App * * adapted from App.js generated by the following command: * * react-native init example * * https://github.com/facebook/react-native */ import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View } from 'react-native'; import convertToCache from 'react-native-video-cache'; export default class App extends Component<{}> { state = { status: 'starting', message: '--' }; componentDidMount() { convertToCache('https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4').then((message) => { this.setState({ status: 'native callback received', message }); }); } render() { return ( ☆VideoCache example☆ STATUS: {this.state.status} ☆NATIVE CALLBACK MESSAGE☆ {this.state.message} ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#F5FCFF', }, welcome: { fontSize: 20, textAlign: 'center', margin: 10, }, instructions: { textAlign: 'center', color: '#333333', marginBottom: 5, }, });