Update example
This commit is contained in:
parent
c926d8ba6c
commit
4b5ac43ded
6
.gitignore
vendored
6
.gitignore
vendored
@ -35,6 +35,12 @@ local.properties
|
||||
node_modules/
|
||||
npm-debug.log
|
||||
|
||||
# yarn
|
||||
yarn.lock
|
||||
|
||||
# editor workspace settings
|
||||
.vscode
|
||||
|
||||
# BUCK
|
||||
buck-out/
|
||||
\.buckd/
|
||||
|
@ -5,14 +5,30 @@
|
||||
*/
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
import { StyleSheet, Text, View, Dimensions } from "react-native";
|
||||
import Video from "react-native-video";
|
||||
|
||||
const { height, width } = Dimensions.get("screen");
|
||||
|
||||
type Props = {};
|
||||
export default class App extends Component<Props> {
|
||||
render() {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.welcome}>The implementation will follow!</Text>
|
||||
<Video
|
||||
cache={true}
|
||||
source={{
|
||||
uri:
|
||||
"https://rawgit.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4"
|
||||
}}
|
||||
ref={player => {
|
||||
this.player = player;
|
||||
}}
|
||||
onEnd={() => {
|
||||
this.player.seek(0);
|
||||
}}
|
||||
style={{ flex: 1, height, width }}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "16.2.0",
|
||||
"react-native-video": "file:../../react-native-video-2.0.0.tgz",
|
||||
"react-native": "0.53.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Simple http server for serving the .mp4 file
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const express = require("express");
|
||||
|
||||
const app = express();
|
||||
|
||||
const publicPath = path.join(__dirname, "../basic");
|
||||
|
||||
app.use(express.static(publicPath));
|
||||
|
||||
app.listen(3000, function(err) {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
}
|
||||
console.log("Listening on port 3000");
|
||||
});
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user