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/
|
node_modules/
|
||||||
npm-debug.log
|
npm-debug.log
|
||||||
|
|
||||||
|
# yarn
|
||||||
|
yarn.lock
|
||||||
|
|
||||||
|
# editor workspace settings
|
||||||
|
.vscode
|
||||||
|
|
||||||
# BUCK
|
# BUCK
|
||||||
buck-out/
|
buck-out/
|
||||||
\.buckd/
|
\.buckd/
|
||||||
|
@ -5,14 +5,30 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { Component } from "react";
|
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 = {};
|
type Props = {};
|
||||||
export default class App extends Component<Props> {
|
export default class App extends Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<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>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "16.2.0",
|
"react": "16.2.0",
|
||||||
|
"react-native-video": "file:../../react-native-video-2.0.0.tgz",
|
||||||
"react-native": "0.53.3"
|
"react-native": "0.53.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"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